Open chat when click notification of one chat new message

This commit is contained in:
Angela Mazzurco 2017-07-31 17:42:45 +02:00
parent c86b7c79ae
commit e39b310c78
2 changed files with 23 additions and 2 deletions

View File

@ -47,7 +47,11 @@ QtObject
.arg(json.data[0].unread_count) .arg(json.data[0].unread_count)
.arg(json.data[0].unread_count > 1 ? "messages" : "message") .arg(json.data[0].unread_count > 1 ? "messages" : "message")
.arg(json.data[0].remote_author_name), .arg(json.data[0].remote_author_name),
qsTr("/contacts") qsTr("/contacts%1").arg(
convCnt == 1?
"?gxsId="+json.data[0].remote_author_id +
"&name="+json.data[0].remote_author_name
: "")
) )
} }
} }

View File

@ -481,11 +481,28 @@ ApplicationWindow
function openContactsViewLinkHandler (uriStr) function openContactsViewLinkHandler (uriStr)
{ {
console.log("openContactsViewLinkHandler(uriStr)" , uriStr)
if(coreReady) 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" ) stackView.push("qrc:/Contacts.qml" )
} }
} }
}
Popup Popup
{ {