changeset 31285:607ad979a753

propagate from branch 'im.pidgin.pidgin' (head 69a7107525200e51498ac5e48baaf043c4cd7b09) to branch 'im.pidgin.pidgin.mxit' (head 9bcb7ee341f06148f85197ea0d03df697e9fe5e3)
author andrew.victor@mxit.com
date Fri, 07 Jan 2011 19:56:19 +0000
parents 43ab38a1f55c (current diff) ed057c543e9e (diff)
children b8d9329dda4a
files ChangeLog libpurple/protocols/mxit/login.c libpurple/protocols/mxit/mxit.c
diffstat 2 files changed, 40 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/login.c	Fri Jan 07 11:42:13 2011 +0000
+++ b/libpurple/protocols/mxit/login.c	Fri Jan 07 19:56:19 2011 +0000
@@ -762,6 +762,12 @@
 {
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_reconnect\n" );
 
+	/* remove the input cb function */
+	if ( session->con->inpa ) {
+		purple_input_remove( session->con->inpa );
+		session->con->inpa = 0;
+	}
+
 	/* close existing connection */
 	session->flags &= ~MXIT_FLAG_CONNECTED;
 	purple_proxy_connect_cancel_with_handle( session->con );
--- a/libpurple/protocols/mxit/mxit.c	Fri Jan 07 11:42:13 2011 +0000
+++ b/libpurple/protocols/mxit/mxit.c	Fri Jan 07 19:56:19 2011 +0000
@@ -588,7 +588,33 @@
 
 
 /*------------------------------------------------------------------------
- * 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.
  */
@@ -597,6 +623,7 @@
 	PurpleBuddy*		buddy;
 	struct contact*		contact;
 	GList*				m = NULL;
+	PurpleMenuAction*	act;
 
 	if ( !PURPLE_BLIST_NODE_IS_BUDDY( node ) )
 		return NULL;
@@ -606,6 +633,12 @@
 	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;
 }