From 297742b7868ed4b757ed04bf71a74f164c1db39f Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Wed, 8 Apr 2015 14:57:55 +0000 Subject: SkypeWeb: Fix receiving messages from users not on the list. git-svn-id: http://svn.miranda-ng.org/main/trunk@12676 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_poll_processing.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'protocols/SkypeWeb/src') diff --git a/protocols/SkypeWeb/src/skype_poll_processing.cpp b/protocols/SkypeWeb/src/skype_poll_processing.cpp index cdf2457813..8cf980e324 100644 --- a/protocols/SkypeWeb/src/skype_poll_processing.cpp +++ b/protocols/SkypeWeb/src/skype_poll_processing.cpp @@ -112,23 +112,26 @@ void CSkypeProto::ProcessNewMessageRes(JSONNODE *node) } else if (strstr(conversationLink, "/8:")) { + ptrA skypename(ContactUrlToName(from)); + MCONTACT hContact = GetContact(skypename); + + if (hContact == NULL && !IsMe(skypename)) + AddContact(skypename, true); + if (!mir_strcmpi(messageType, "Control/Typing")) { - MCONTACT hContact = GetContact(ContactUrlToName(from)); CallService(MS_PROTO_CONTACTISTYPING, hContact, 5); } else if (!mir_strcmpi(messageType, "Control/ClearTyping")) - { - MCONTACT hContact = GetContact(ContactUrlToName(from)); + { CallService(MS_PROTO_CONTACTISTYPING, hContact, 0); } else if (!mir_strcmpi(messageType, "Text") || !mir_strcmpi(messageType, "RichText")) { int emoteOffset = json_as_int(json_get(node, "skypeemoteoffset")); - ptrA skypename(ContactUrlToName(from)); if (IsMe(skypename)) { - MCONTACT hContact = GetContact(ptrA(ContactUrlToName(conversationLink))); + hContact = GetContact(ptrA(ContactUrlToName(conversationLink))); int hMessage = atoi(clientMsgId); ProtoBroadcastAck(hContact, ACKTYPE_MESSAGE, ACKRESULT_SUCCESS, (HANDLE)hMessage, 0); AddMessageToDb(hContact, timestamp, DBEF_UTF | DBEF_SENT, clientMsgId, &content[emoteOffset], emoteOffset); -- cgit v1.2.3