From d5d5dccc3c1da939fb26895d17de66c624cbd33a Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 6 May 2015 17:25:06 +0000 Subject: SkypeWeb: ProcessUserPresence fix. git-svn-id: http://svn.miranda-ng.org/main/trunk@13468 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_poll_processing.cpp | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'protocols/SkypeWeb') diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp index 137d620be9..2e48339b86 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -92,10 +92,20 @@ void CSkypeProto::ProcessUserPresenceRes(JSONNODE *node) ptrA selfLink(mir_t2a(ptrT(json_as_string(json_get(node, "selfLink"))))); ptrA status(mir_t2a(ptrT(json_as_string(json_get(node, "status"))))); - ptrA skypename(ContactUrlToName(selfLink)); - if (skypename == NULL) + char *skypename; + + if (strstr(selfLink, "/8:")) { - if (IsMe(ptrA(SelfUrlToName(selfLink)))) + skypename = ContactUrlToName(selfLink); + } + else if (strstr(selfLink, "/1:")) + { + skypename = SelfUrlToName(selfLink); + } + + if (skypename != NULL) + { + if (IsMe(skypename)) { int iNewStatus = SkypeToMirandaStatus(status); int old_status = m_iStatus; @@ -105,10 +115,12 @@ void CSkypeProto::ProcessUserPresenceRes(JSONNODE *node) ProtoBroadcastAck(NULL, ACKTYPE_STATUS, ACKRESULT_SUCCESS, (HANDLE)old_status, iNewStatus); return; } - return; + else + { + MCONTACT hContact = AddContact(skypename, true); + SetContactStatus(hContact, SkypeToMirandaStatus(status)); + } } - MCONTACT hContact = AddContact(skypename, true); - SetContactStatus(hContact, SkypeToMirandaStatus(status)); } void CSkypeProto::ProcessNewMessageRes(JSONNODE *node) -- cgit v1.2.3