changeset 25199:3f4bedafc86e

Print alias (if known) in some error/info messages when failing to buzz Removed some unused variables. Fixed a warning.
author Marcus Lundblad <ml@update.uu.se>
date Mon, 19 Jan 2009 21:53:53 +0000
parents b707ec143eee
children 65055671bbfc
files libpurple/protocols/jabber/jabber.c
diffstat 1 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/jabber.c	Fri Jan 16 21:40:25 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Mon Jan 19 21:53:53 2009 +0000
@@ -2445,25 +2445,25 @@
 	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 @@
 
 		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 @@
 	
 	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);