mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
Merge branch 'qml_app_notify_unread' into GSoC2017-evaluation-II
This commit is contained in:
commit
d70293c071
@ -41,10 +41,17 @@ QtObject
|
||||
"unread conversations")
|
||||
notificationsBridge.notify(
|
||||
qsTr("New message!"),
|
||||
qsTr("Unread messages in %1 %2").arg(convCnt).arg(
|
||||
convCnt > 1 ?
|
||||
qsTr("conversations") : qsTr("conversation")
|
||||
)
|
||||
(convCnt > 1) ?
|
||||
qsTr("Unread messages in %1 conversations").arg(convCnt):
|
||||
qsTr("%1 Unread %2 from %3")
|
||||
.arg(json.data[0].unread_count)
|
||||
.arg(json.data[0].unread_count > 1 ? "messages" : "message")
|
||||
.arg(json.data[0].remote_author_name),
|
||||
qsTr("/contacts%1").arg(
|
||||
convCnt == 1?
|
||||
"?gxsId="+json.data[0].remote_author_id +
|
||||
"&name="+json.data[0].remote_author_name
|
||||
: "")
|
||||
)
|
||||
}
|
||||
}
|
||||
|
@ -65,12 +65,16 @@ public class RetroShareQmlActivity extends QtActivity
|
||||
@Override
|
||||
public void onNewIntent(Intent intent)
|
||||
{
|
||||
Log.i("RetroShareQmlActivity", "onNewIntent(Intent intent)");
|
||||
Log.i("RetroShareQmlActivity", "on NewIntent(Intent intent)");
|
||||
|
||||
super.onNewIntent(intent);
|
||||
|
||||
String uri = intent.getDataString();
|
||||
if (uri != null) NativeCalls.notifyIntentUri(uri);
|
||||
if (uri != null)
|
||||
{
|
||||
NativeCalls.notifyIntentUri(uri);
|
||||
Log.i("RetroShareQmlActivity", "onNewIntent(Intent intent) Uri: " + uri);
|
||||
}
|
||||
}
|
||||
|
||||
@UsedByNativeCode @SuppressWarnings("unused")
|
||||
|
@ -41,6 +41,7 @@ ApplicationWindow
|
||||
{
|
||||
addUriHandler("/certificate", certificateLinkHandler)
|
||||
addUriHandler("/identity", contactLinkHandler)
|
||||
addUriHandler("/contacts", openContactsViewLinkHandler)
|
||||
|
||||
var argc = mainArgs.length
|
||||
for(var i=0; i<argc; ++i)
|
||||
@ -477,6 +478,32 @@ ApplicationWindow
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function openContactsViewLinkHandler (uriStr)
|
||||
{
|
||||
console.log("openContactsViewLinkHandler(uriStr)" , uriStr)
|
||||
if(coreReady)
|
||||
{
|
||||
var uri = new UriJs.URI(uriStr)
|
||||
var query = UriJs.URI.parseQuery(uri.search());
|
||||
if (query.gxsId && query.name)
|
||||
{
|
||||
|
||||
ChatCache.chatHelper.startDistantChat(ChatCache.contactsCache.own.gxs_id,
|
||||
query.gxsId,
|
||||
query.name,
|
||||
function (chatId)
|
||||
{
|
||||
stackView.push("qrc:/ChatView.qml", {'chatId': chatId})
|
||||
})
|
||||
}
|
||||
else
|
||||
{
|
||||
stackView.push("qrc:/Contacts.qml" )
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Popup
|
||||
{
|
||||
id: contactImportPopup
|
||||
|
Loading…
Reference in New Issue
Block a user