From 3506c2bc0bb148120db8e8c7c6a07cf3e683cc50 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 10 May 2015 09:28:16 +0000 Subject: SkypeWeb: Mark messsges as read rework. git-svn-id: http://svn.miranda-ng.org/main/trunk@13504 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_poll_processing.cpp | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) (limited to 'protocols/SkypeWeb/src/skype_poll_processing.cpp') diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp index 327bbaae3d..7682006a48 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -141,17 +141,29 @@ void CSkypeProto::ProcessConversationUpdateRes(JSONNODE *node) JSONNODE *properties = json_get(node, "properties" ); ptrA convLink(mir_t2a(json_as_string(json_get(lastMessage, "conversationLink")))); + ptrA fromLink(mir_t2a(json_as_string(json_get(lastMessage, "from")))); - if (strstr(convLink, "/8:")) + if (strstr(convLink, "/8:") && IsMe(ContactUrlToName(fromLink))) { ptrA skypename(ContactUrlToName(convLink)); MCONTACT hContact = FindContact(skypename); if (hContact != NULL) { - ptrA consumptionhorizon(mir_t2a(json_as_string(json_get(properties, "consumptionhorizon")))); + CMStringA consumptionhorizon(mir_t2a(json_as_string(json_get(properties, "consumptionhorizon")))); - //server return bad data + int iStart = 0; + CMStringA szToken1 = consumptionhorizon.Tokenize(";", iStart).Trim(); + + if (iStart != -1) + { + CMStringA szToken2 = consumptionhorizon.Tokenize(";", iStart).Trim(); + + time_t evttime = atoi(szToken2.GetBuffer()); + db_set_dw(hContact, m_szModuleName, "LastMsgReadTime", evttime); + + SetSrmmReadStatus(hContact); + } } } } -- cgit v1.2.3