changeset 31499:a769e6da0a8e

The mini-dialogs feature now allows you to request profile information for pending invites before accepting them. Since it's an invite there is no PurpleBuddy associated with the user, and therefore we cannot perform the contact-type check. So just skip the check if we cannot find the buddy.
author andrew.victor@mxit.com
date Thu, 31 Mar 2011 20:15:18 +0000
parents 9e9abd65b840
children 80bbed4cb649
files libpurple/protocols/mxit/mxit.c
diffstat 1 files changed, 10 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/mxit.c	Thu Mar 31 19:32:34 2011 +0000
+++ b/libpurple/protocols/mxit/mxit.c	Thu Mar 31 20:15:18 2011 +0000
@@ -571,19 +571,17 @@
 
 	/* find the buddy information for this contact (reference: "libpurple/blist.h") */
 	buddy = purple_find_buddy( session->acc, who );
-	if ( !buddy ) {
-		purple_debug_warning( MXIT_PLUGIN_ID, "mxit_get_info: unable to find the buddy '%s'\n", who );
-		return;
-	}
+	if ( buddy ) {
+		/* user is in our contact-list, so it's not an invite */
+		contact = purple_buddy_get_protocol_data( buddy );
+		if ( !contact )
+			return;
 
-	contact = purple_buddy_get_protocol_data( buddy );
-	if ( !contact )
-		return;
-
-	/* only MXit users have profiles */
-	if ( contact->type != MXIT_TYPE_MXIT ) {
-		mxit_popup( PURPLE_NOTIFY_MSG_WARNING, _( "No profile available" ), _( "This contact does not have a profile." ) );
-		return;
+		/* only MXit users have profiles */
+		if ( contact->type != MXIT_TYPE_MXIT ) {
+			mxit_popup( PURPLE_NOTIFY_MSG_WARNING, _( "No profile available" ), _( "This contact does not have a profile." ) );
+			return;
+		}
 	}
 
 	/* send profile request */