diff options
author | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-26 11:32:49 +0000 |
---|---|---|
committer | MikalaiR <nikolay.romanovich@narod.ru> | 2015-04-26 11:32:49 +0000 |
commit | 4bd53193619a889d58637779329fff6bc5fed865 (patch) | |
tree | 99988de1a498e64c2e6248d3e6d5ab7a3dd2c502 /protocols/SkypeWeb | |
parent | 1daece9859332aca46217ac48727d71e8f8c5661 (diff) |
SkypeWeb: Multiple invite fix.
git-svn-id: http://svn.miranda-ng.org/main/trunk@13163 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/SkypeWeb')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 36 |
1 files changed, 15 insertions, 21 deletions
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 = <addmember><eventtime>1429186229164</eventtime><initiator>8:initiator</initiator><target>8:user</target></addmember>
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);
-
}
}
}
|