pidgin.mxit: 9adf3d38: When receiving an invite to join a Group...

andrew.victor at mxit.com andrew.victor at mxit.com
Sat Aug 13 18:05:48 EDT 2011


----------------------------------------------------------------------
Revision: 9adf3d387affef84b59224cf0c9a6e10ed958159
Parent:   cb4ebf69baee194624a1e5c05c5f2372fd13a0b4
Author:   andrew.victor at mxit.com
Date:     08/13/11 18:01:39
Branch:   im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/9adf3d387affef84b59224cf0c9a6e10ed958159

Changelog: 

When receiving an invite to join a GroupChat, first check if a matching room entry
 already exists (ie, already joined, or invite popup still pending).
If so, just ignore the invite.


Changes against parent cb4ebf69baee194624a1e5c05c5f2372fd13a0b4

  patched  libpurple/protocols/mxit/multimx.c

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/multimx.c	899dc4b29cf84fbc68bdf2f4e451b26d49324574
+++ libpurple/protocols/mxit/multimx.c	13b5a9211d1f5cba73b4aae7db1266289b9f8961
@@ -277,8 +277,12 @@ void multimx_invite(struct MXitSession* 
 	GHashTable *components;
 	struct multimx* multimx = NULL;
 
-	purple_debug_info(MXIT_PLUGIN_ID, "Groupchat invite to '%s' by '%s'\n", contact->alias, creator);
+	purple_debug_info(MXIT_PLUGIN_ID, "Groupchat invite to '%s' (roomid='%s') by '%s'\n", contact->alias, contact->username, creator);
 
+	/* Check if the room already exists (ie, already joined or invite pending) */
+	if (find_room_by_username(session, contact->username) != NULL)
+		return;
+
 	/* Create a new room */
 	multimx = room_create(session, contact->username, contact->alias, STATE_INVITED);
 
@@ -307,7 +311,7 @@ void multimx_created(struct MXitSession*
 	multimx = find_room_by_username(session, contact->username);
 	if (multimx == NULL) {
 		multimx = room_create(session, contact->username, contact->alias, TRUE);
-		}
+	}
 	else if (multimx->state == STATE_INVITED) {
 		/* After successfully accepting an invitation */
 		multimx->state = STATE_JOINED;


More information about the Commits mailing list