summaryrefslogtreecommitdiff
path: root/protocols/SkypeClassic/src/gchat.cpp
diff options
context:
space:
mode:
authorRobert Pösel <robyer@seznam.cz>2014-10-08 08:55:53 +0000
committerRobert Pösel <robyer@seznam.cz>2014-10-08 08:55:53 +0000
commit0d11f71e3bb30c9760f7fc8b027897047530b136 (patch)
treef65324ac5278878e1bad871dd083b1c972590c38 /protocols/SkypeClassic/src/gchat.cpp
parenta134f7e823d5d334bfee65652534c206569e0b3e (diff)
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
Diffstat (limited to 'protocols/SkypeClassic/src/gchat.cpp')
-rw-r--r--protocols/SkypeClassic/src/gchat.cpp12
1 files changed, 9 insertions, 3 deletions
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
/*