diff options
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/SkypeWeb/src/skype_chatrooms.cpp | 24 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_proto.h | 2 | ||||
-rw-r--r-- | protocols/SkypeWeb/src/skype_utils.cpp | 2 |
3 files changed, 19 insertions, 9 deletions
diff --git a/protocols/SkypeWeb/src/skype_chatrooms.cpp b/protocols/SkypeWeb/src/skype_chatrooms.cpp index dee5b12629..8f629d0d5a 100644 --- a/protocols/SkypeWeb/src/skype_chatrooms.cpp +++ b/protocols/SkypeWeb/src/skype_chatrooms.cpp @@ -206,20 +206,21 @@ void CSkypeProto::OnChatEvent(JSONNODE *node) }
else if (!mir_strcmpi(messageType, "ThreadActivity/AddMember"))
{
- ptrA initiator, target;
+ ptrA xinitiator, xtarget, initiator, target;
//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) {
HXML node = xi.getChildByPath(xml, _T("initiator"), 0);
- initiator = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ xinitiator = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
node = xi.getChildByPath(xml, _T("target"), 0);
- target = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ xtarget = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
xi.destroyNode(xml);
}
+ target = ParseUrl(xtarget, "8:");
GCDEST gcd = { m_szModuleName, ptrT(mir_a2t(chatname)), GC_EVENT_JOIN };
GCEVENT gce = { sizeof(GCEVENT), &gcd };
@@ -232,23 +233,30 @@ void CSkypeProto::OnChatEvent(JSONNODE *node) }
else if (!mir_strcmpi(messageType, "ThreadActivity/DeleteMember"))
{
- ptrA initiator, target;
+ ptrA xinitiator, xtarget, initiator, target;
//content = <addmember><eventtime>1429186229164</eventtime><initiator>8:initiator</initiator><target>8:user</target></addmember>
HXML xml = xi.parseString(ptrT(mir_a2t(content)), 0, _T("deletemember"));
if (xml != NULL) {
HXML node = xi.getChildByPath(xml, _T("initiator"), 0);
- initiator = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ xinitiator = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
node = xi.getChildByPath(xml, _T("target"), 0);
- target = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
+ xtarget = node != NULL ? mir_t2a(xi.getText(node)) : NULL;
xi.destroyNode(xml);
}
+ if(xtarget == NULL)
+ return;
+
+ target = ParseUrl(xtarget, "8:");
bool isKick = false;
- if (initiator != NULL)
- bool isKick = true;
+ if (xinitiator != NULL)
+ {
+ initiator = ParseUrl(xinitiator, "8:");
+ isKick = true;
+ }
if (isKick)
{
diff --git a/protocols/SkypeWeb/src/skype_proto.h b/protocols/SkypeWeb/src/skype_proto.h index 51d00df246..3956db072b 100644 --- a/protocols/SkypeWeb/src/skype_proto.h +++ b/protocols/SkypeWeb/src/skype_proto.h @@ -252,6 +252,8 @@ private: static void ShowNotification(const TCHAR *caption, const TCHAR *message, int flags = 0, MCONTACT hContact = NULL);
static bool IsFileExists(std::tstring path);
+ char *ParseUrl(const char *url, const char *token);
+
char *ChatUrlToName(const char *url);
char *ContactUrlToName(const char *url);
char *SelfUrlToName(const char *url);
diff --git a/protocols/SkypeWeb/src/skype_utils.cpp b/protocols/SkypeWeb/src/skype_utils.cpp index aa429017be..7a6f9f682d 100644 --- a/protocols/SkypeWeb/src/skype_utils.cpp +++ b/protocols/SkypeWeb/src/skype_utils.cpp @@ -240,7 +240,7 @@ bool CSkypeProto::IsFileExists(std::tstring path) // url parsing
-char *ParseUrl(const char *url, const char *token)
+char *CSkypeProto::ParseUrl(const char *url, const char *token)
{
const char *start = strstr(url, token);
if (start == NULL)
|