cpw.malu.xmpp.attention: 171f6323: Print alias (if known) in some error/inf..

malu at pidgin.im malu at pidgin.im
Mon Jan 19 16:56:11 EST 2009


-----------------------------------------------------------------
Revision: 171f63237947186009487d6f7e6a736fee5b9bd7
Ancestor: 2b35112ffabaf2b2eb1099d7dcff42b98c654ccb
Author: malu at pidgin.im
Date: 2009-01-19T21:53:53
Branch: im.pidgin.cpw.malu.xmpp.attention
URL: http://d.pidgin.im/viewmtn/revision/info/171f63237947186009487d6f7e6a736fee5b9bd7

Modified files:
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

Print alias (if known) in some error/info messages when failing to buzz
Removed some unused variables.
Fixed a warning.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	097b6cdbd97a0560ef82988079a17e349ee723b5
+++ libpurple/protocols/jabber/jabber.c	c293608ac7c135dad548967a79ff412b998454af
@@ -2445,25 +2445,25 @@ static gboolean _jabber_send_buzz(Jabber
 	JabberBuddy *jb;
 	JabberBuddyResource *jbr;
 	PurpleConnection *gc = js->gc;
-	PurpleAccount *account = purple_connection_get_account(gc);
-	PurpleConversation *conv = 
-		purple_find_conversation_with_account(PURPLE_CONV_TYPE_ANY, username,
-			account);
-	gchar *str;
+	PurpleBuddy *buddy = 
+		purple_find_buddy(purple_connection_get_account(gc), username);
+	const gchar *alias = 
+		buddy ? purple_buddy_get_contact_alias(buddy) : username;
 	
 	if(!username)
 		return FALSE;
 
 	jb = jabber_buddy_find(js, username, FALSE);
 	if(!jb) {
-		*error = g_strdup_printf(_("Unable to buzz, because there is nothing known about user %s."), username);
+		*error = g_strdup_printf(_("Unable to buzz, because there is nothing "
+			"known about %s."), alias);
 		return FALSE;
 	}
 	
 	jbr = jabber_buddy_find_resource(jb, NULL);
 	if (!jbr) {
-		*error = g_strdup_printf(_("Unable to buzz, because user %s might be offline."), 
-			username);
+		*error = g_strdup_printf(_("Unable to buzz, because %s might be offline."), 
+			alias);
 		return FALSE;
 	}
 	
@@ -2486,9 +2486,8 @@ static gboolean _jabber_send_buzz(Jabber
 
 		return TRUE;
 	} else {
-		*error = g_strdup_printf(_("Unable to buzz, because the user %s does "
-			"not support it or do not wish to receive buzzes now."), 
-			username);
+		*error = g_strdup_printf(_("Unable to buzz, because %s does "
+			"not support it or do not wish to receive buzzes now."), alias);
 		return FALSE;
 	}
 }
@@ -2512,7 +2511,7 @@ static PurpleCmdRet jabber_cmd_buzz(Purp
 	
 	if (_jabber_send_buzz(js, who, error)) {
 		const gchar *alias;
-		const gchar *str;
+		gchar *str;
 		PurpleBuddy *buddy =
 			purple_find_buddy(purple_connection_get_account(conv->account->gc), 
 				who);


More information about the Commits mailing list