From dab02845fea8031dd3d7864dc1efc211a434f969 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Sat, 14 Jul 2012 19:40:31 +0000 Subject: - code cleaning - sync git-svn-id: http://svn.miranda-ng.org/main/trunk@975 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/MSN/msn_commands.cpp | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) (limited to 'protocols/MSN/msn_commands.cpp') diff --git a/protocols/MSN/msn_commands.cpp b/protocols/MSN/msn_commands.cpp index 3902f29a25..b83def22d2 100644 --- a/protocols/MSN/msn_commands.cpp +++ b/protocols/MSN/msn_commands.cpp @@ -67,7 +67,9 @@ void CMsnProto::sttSetMirVer(HANDLE hContact, DWORD dwValue, bool always) "WLM Unknown", }; - if (dwValue & 0x1) + if (dwValue == 0) + setString(hContact, "MirVer", "Windows Phone"); + else if (dwValue & 0x1) setString(hContact, "MirVer", "MSN Mobile"); else if (dwValue & 0x200) setString(hContact, "MirVer", "Webmessenger"); @@ -827,18 +829,18 @@ void CMsnProto::sttProcessStatusMessage(char* buf, unsigned len, const char* wli } // Process status message info - char* szStatMsg = ezxml_txt(ezxml_child(xmli, "PSM")); - if (*szStatMsg) { - stripBBCode(szStatMsg); - stripColorCode(szStatMsg); - mir_ptr tszStatMsg( mir_utf8decodeT(szStatMsg)); - DBWriteContactSettingTString(hContact, "CList", "StatusMsg", tszStatMsg); - SendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, (LPARAM)tszStatMsg); + const char* szStatMsg = ezxml_txt(ezxml_child(xmli, "PSM")); + if (*szStatMsg) + { + stripBBCode((char*)szStatMsg); + stripColorCode((char*)szStatMsg); + DBWriteContactSettingStringUtf(hContact, "CList", "StatusMsg", szStatMsg); } - else { + else DBDeleteContactSetting(hContact, "CList", "StatusMsg"); - SendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, NULL); - } + + mir_utf8decode((char*)szStatMsg, NULL); + SendBroadcast(hContact, ACKTYPE_AWAYMSG, ACKRESULT_SUCCESS, NULL, (LPARAM)szStatMsg); // Process current media info const char* szCrntMda = ezxml_txt(ezxml_child(xmli, "CurrentMedia")); @@ -1190,6 +1192,8 @@ LBL_InvalidCommand: if (strchr(data.userEmail, ';')) { + if (info->mJoinedContactsWLID.getCount() == 1) + p2p_clearThreadSessions(info->mJoinedContactsWLID[0], info->mType); info->contactLeft(data.userEmail); break; } @@ -1401,7 +1405,7 @@ LBL_InvalidCommand: sttSetMirVer(hContact, cont->cap1, always); } - if ((cont->cap1 & 0xf0000000) && data.cmdstring[0] && strcmp(data.cmdstring, "0")) + if (/*(cont->cap1 & 0xf0000000) &&*/ data.cmdstring[0] && strcmp(data.cmdstring, "0")) { char* szAvatarHash = MSN_GetAvatarHash(data.cmdstring); if (szAvatarHash == NULL) goto remove; @@ -1468,7 +1472,8 @@ remove: { UrlDecode(data.userNick); HANDLE hContact = MSN_HContactFromEmail(data.userEmail, data.userNick, true, true); - if (tNumTokens == 5) + + if (tNumTokens == 5 && strcmp(data.flags, "0:0")) { MsnContact *cont = Lists_Get(data.userEmail); if (cont) @@ -1780,6 +1785,7 @@ remove: case 10: // TURN setup + p2p_processSIP(info, msgBody, NULL, szEmail); break; } break; -- cgit v1.2.3