pidgin.mxit: e568399d: Add support for re-inviting contacts in ...

andrew.victor at mxit.com andrew.victor at mxit.com
Fri Jul 30 07:46:36 EDT 2010


----------------------------------------------------------------------
Revision: e568399dd287c4581c39324dcabfe0c3d3889143
Parent:   42ccfa6e4bc97f62d512937d3548a253f44659a4
Author:   andrew.victor at mxit.com
Date:     07/30/10 06:57:17
Branch:   im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/e568399dd287c4581c39324dcabfe0c3d3889143

Changelog: 

Add support for re-inviting contacts in the Deleted or Rejected state.
(right-click on Buddy list, and select Re-Invite)


Changes against parent 42ccfa6e4bc97f62d512937d3548a253f44659a4

  patched  libpurple/protocols/mxit/mxit.c

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/mxit.c	30e852a0681962e9cec0b05e6db5b8c75d3eeeb5
+++ libpurple/protocols/mxit/mxit.c	96fc8ebaaaaec3d1253ff7ac3632d847bc23d323
@@ -588,15 +588,42 @@ static GHashTable* mxit_get_text_table( 
 
 
 /*------------------------------------------------------------------------
- * Buddy list menu.
+ * Re-Invite was selected from the buddy-list menu.
  *
  *  @param node		The entry in the buddy list.
+ *  @param ignored	(not used)
  */
+static void mxit_reinvite( PurpleBlistNode *node, gpointer ignored )
+{
+	PurpleBuddy*		buddy;
+	struct contact*		contact;
+	PurpleConnection*	gc;
+	struct MXitSession*	session;
+
+	buddy = (PurpleBuddy *)node;
+	gc = purple_account_get_connection( purple_buddy_get_account( buddy ) );
+	session = gc->proto_data;
+
+	contact = purple_buddy_get_protocol_data( (PurpleBuddy*) node );
+	if ( !contact )
+		return;
+
+	/* send a new invite */
+	mxit_send_invite( session, contact->username, contact->alias, contact->groupname );
+}
+
+
+/*------------------------------------------------------------------------
+ * Buddy-list menu.
+ *
+ *  @param node		The entry in the buddy list.
+ */
 static GList* mxit_blist_menu( PurpleBlistNode *node )
 {
 	PurpleBuddy*		buddy;
 	struct contact*		contact;
 	GList*				m = NULL;
+	PurpleMenuAction*	act;
 
 	if ( !PURPLE_BLIST_NODE_IS_BUDDY( node ) )
 		return NULL;
@@ -606,6 +633,12 @@ static GList* mxit_blist_menu( PurpleBli
 	if ( !contact )
 		return NULL;
 
+	if ( ( contact->subtype == MXIT_SUBTYPE_DELETED ) || ( contact->subtype == MXIT_SUBTYPE_REJECTED ) || ( contact->subtype == MXIT_SUBTYPE_NONE ) ) {
+		/* contact is in Deleted, Rejected or None state */
+		act = purple_menu_action_new( _( "Re-Invite" ), PURPLE_CALLBACK( mxit_reinvite ), NULL, NULL );
+		m = g_list_append(m, act);
+	}
+
 	return m;
 }
 


More information about the Commits mailing list