From 0d11f71e3bb30c9760f7fc8b027897047530b136 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Robert=20P=C3=B6sel?= Date: Wed, 8 Oct 2014 08:55:53 +0000 Subject: SkypeClassic: Sync from leecher's repo (r1963) - Fixed a severe bug that prevented the correct auth user to be read preventing every authentication accept. - Fixed a crash in Groupchat when only 2 users were left and user parted the groupchat - Added feature for blocking contacts git-svn-id: http://svn.miranda-ng.org/main/trunk@10744 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/SkypeClassic/src/gchat.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) (limited to 'protocols/SkypeClassic/src/gchat.cpp') diff --git a/protocols/SkypeClassic/src/gchat.cpp b/protocols/SkypeClassic/src/gchat.cpp index cefd1c891f..da5615dd5d 100644 --- a/protocols/SkypeClassic/src/gchat.cpp +++ b/protocols/SkypeClassic/src/gchat.cpp @@ -234,6 +234,10 @@ int __cdecl AddMembers(char *szSkypeMsg) { if (protocol>=7 && (pszMemObjs = SkypeGet ("CHAT", szSkypeMsg+5, "MEMBEROBJECTS"))) { // Add new contacts (protocol 7+ with memberobjects, supports roles) for (token=strtok_r(pszMemObjs, ", ", &nextoken); token; token=strtok_r(NULL, ", ", &nextoken)) { + if (!contactmask && !(contactmask = (unsigned char*)calloc(gc->mJoinedCount, 1))) { + iRet = -1; + break; + } if (!(who = SkypeGet ("CHATMEMBER", token, "IDENTITY"))) continue; if (strcmp(who, dbv2.pszVal)) { char *pszRole; @@ -245,7 +249,6 @@ int __cdecl AddMembers(char *szSkypeMsg) { i=AddChatContact(gc, who, ptszRole); free_nonutf_tchar_string (ptszRole); if (pszRole) free (pszRole); - if (i>=0 && !contactmask && !(contactmask = (unsigned char*)calloc(gc->mJoinedCount, 1))) i=-2; if (!(contactmask= (unsigned char *) realloc(contactmask, gc->mJoinedCount))) { iRet = -1; free (who); @@ -261,9 +264,12 @@ int __cdecl AddMembers(char *szSkypeMsg) { { // Add new contacts (normal) for (who=strtok_r(ptr, " ", &nextoken); who; who=strtok_r(NULL, " ", &nextoken)) { + if (!contactmask && !(contactmask = (unsigned char*)calloc(gc->mJoinedCount, 1))) { + iRet = -1; + break; + } if (strcmp(who, dbv2.pszVal)) { i=AddChatContact(gc, who, NULL); - if (i>=0 && !contactmask && !(contactmask = (unsigned char*)calloc(gc->mJoinedCount, 1))) i=-2; if (i<0 || !(contactmask= (unsigned char *) realloc(contactmask, gc->mJoinedCount))) { iRet = -1; break; @@ -290,13 +296,13 @@ int __cdecl AddMembers(char *szSkypeMsg) { ci.dwFlag = CNF_TCHAR; if (ci.hContact && !CallService(MS_CONTACT_GETCONTACTINFO,0,(LPARAM)&ci)) gce.ptszNick=ci.pszVal; else gce.ptszNick=gc->mJoinedContacts[i].who; - RemChatContact(gc, gc->mJoinedContacts[i].who); gce.ptszUID = gc->mJoinedContacts[i].who; CallService(MS_GC_EVENT, 0, (LPARAM)&gce); if (ci.pszVal) { mir_free (ci.pszVal); ci.pszVal=NULL; } + RemChatContact(gc, gc->mJoinedContacts[i].who); } // We don't do this, because the dialog group-chat may have been started intentionally /* -- cgit v1.2.3