From 4bd53193619a889d58637779329fff6bc5fed865 Mon Sep 17 00:00:00 2001 From: MikalaiR Date: Sun, 26 Apr 2015 11:32:49 +0000 Subject: SkypeWeb: Multiple invite fix. git-svn-id: http://svn.miranda-ng.org/main/trunk@13163 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeWeb/src/skype_chatrooms.cpp | 36 +++++++++++++----------------- 1 file changed, 15 insertions(+), 21 deletions(-) (limited to 'protocols/SkypeWeb') diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index 73b511b77d..a8324a66e1 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -306,17 +306,22 @@ void CSkypeProto::OnChatEvent(JSONNODE *node) //content = 14291862291648:initiator8:user HXML xml = xi.parseString(ptrT(mir_a2t(content)), 0, _T("addmember")); - if (xml != NULL) { + if (xml == NULL) + return; - HXML xmlNode = xi.getChildByPath(xml, _T("target"), 0); - xtarget = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL; + for (int i=0; i < xi.getChildCount(xml); i++) + { + HXML xmlNode = xi.getNthChild(xml, L"target", i); + if (xmlNode == NULL) + break; - xi.destroyNode(xml); - } + xtarget = xmlNode != NULL ? mir_t2a(xi.getText(xmlNode)) : NULL; - target = ParseUrl(xtarget, "8:"); + target = ParseUrl(xtarget, "8:"); - AddChatContact(_A2T(chatname), target, target, L"User"); + AddChatContact(_A2T(chatname), target, target, L"User"); + } + xi.destroyNode(xml); } else if (!mir_strcmpi(messageType, "ThreadActivity/DeleteMember")) { @@ -337,19 +342,10 @@ void CSkypeProto::OnChatEvent(JSONNODE *node) return; target = ParseUrl(xtarget, "8:"); - - bool isKick = false; initiator = ParseUrl(xinitiator, "8:"); - isKick = true; - if (isKick) - { - RemoveChatContact(_A2T(chatname), target, target, true, initiator); - } - else - { - RemoveChatContact(_A2T(chatname), target, target); - } + RemoveChatContact(_A2T(chatname), target, target, true, initiator); + } else if (!mir_strcmpi(messageType, "ThreadActivity/TopicUpdate")) { @@ -388,10 +384,9 @@ void CSkypeProto::OnChatEvent(JSONNODE *node) xRole = xmlNode != NULL ? mir_t2a(xi.getText(xmlRole)) : NULL; } xi.destroyNode(xml); - initiator = ParseUrl(xinitiator, "8:"); id = ParseUrl(xId, "8:"); - + GCDEST gcd = { m_szModuleName, _A2T(chatname), !mir_strcmpi(xRole, "Admin") ? GC_EVENT_ADDSTATUS : GC_EVENT_REMOVESTATUS}; GCEVENT gce = { sizeof(gce), &gcd }; ptrT tszId(mir_a2t(id)); @@ -406,7 +401,6 @@ void CSkypeProto::OnChatEvent(JSONNODE *node) gce.bIsMe = IsMe(id); gce.ptszStatus = TranslateT("Admin"); CallServiceSync(MS_GC_EVENT, 0, (LPARAM)&gce); - } } } -- cgit v1.2.3