changeset 18211:84b577372b90

Show screenname instead of alias in conversation infopanes
author Sean Egan <seanegan@gmail.com>
date Wed, 20 Jun 2007 20:14:17 +0000
parents b8572b937c09
children 77b9ceb83426
files pidgin/gtkblist.c pidgin/gtkblist.h pidgin/gtkconv.c
diffstat 3 files changed, 18 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtkblist.c	Wed Jun 20 18:23:49 2007 +0000
+++ b/pidgin/gtkblist.c	Wed Jun 20 20:14:17 2007 +0000
@@ -3284,7 +3284,7 @@
 	return ret;
 }
 
-gchar *pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected)
+gchar *pidgin_blist_get_name_markup(PurpleBuddy *b, gboolean selected, gboolean aliased)
 {
 	const char *name;
 	char *esc, *text = NULL;
@@ -3309,15 +3309,19 @@
 	}
 
 	/* XXX Good luck cleaning up this crap */
-
-	contact = (PurpleContact*)((PurpleBlistNode*)b)->parent;
-	if(contact)
-		gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data;
-
-	if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias)
-		name = contact->alias;
-	else
-		name = purple_buddy_get_alias(b);
+	if (aliased) {
+		contact = (PurpleContact*)((PurpleBlistNode*)b)->parent;
+		if(contact)
+			gtkcontactnode = ((PurpleBlistNode*)contact)->ui_data;
+
+		if(gtkcontactnode && !gtkcontactnode->contact_expanded && contact->alias)
+			name = contact->alias;
+		else
+			name = purple_buddy_get_alias(b);
+	} else {
+		name = b->name;
+	}
+	
 	esc = g_markup_escape_text(name, strlen(name));
 
 	presence = purple_buddy_get_presence(b);
@@ -4971,7 +4975,7 @@
 	}
 
 	emblem = pidgin_blist_get_emblem((PurpleBlistNode*) buddy);
-	mark = pidgin_blist_get_name_markup(buddy, selected);
+	mark = pidgin_blist_get_name_markup(buddy, selected, TRUE);
 
 	if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/blist/show_idle_time") &&
 		purple_presence_is_idle(presence) &&
--- a/pidgin/gtkblist.h	Wed Jun 20 18:23:49 2007 +0000
+++ b/pidgin/gtkblist.h	Wed Jun 20 20:14:17 2007 +0000
@@ -365,8 +365,9 @@
  *
  * @param buddy The buddy to return markup from
  * @param selected  Whether this buddy is selected. If TRUE, the markup will not change the color.
+ * @param aliased  TRUE to return the appropriate alias of this buddy, FALSE to return its screenname
  * @return The markup for this buddy
  */
-gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected);
+gchar *pidgin_blist_get_name_markup(PurpleBuddy *buddy, gboolean selected, gboolean aliased);
 
 #endif /* _PIDGINBLIST_H_ */
--- a/pidgin/gtkconv.c	Wed Jun 20 18:23:49 2007 +0000
+++ b/pidgin/gtkconv.c	Wed Jun 20 20:14:17 2007 +0000
@@ -6177,7 +6177,7 @@
 
 		buddy = purple_find_buddy(account, conv->name);
 		if (buddy)
-			markup = pidgin_blist_get_name_markup(buddy, FALSE);
+			markup = pidgin_blist_get_name_markup(buddy, FALSE, FALSE);
 		else
 			markup = title;
 		gtk_list_store_set(gtkconv->infopane_model, &(gtkconv->infopane_iter),