changeset 10250:89a25444401c

[gaim-migrate @ 11390] Minor changes to the creation of the list of pounces in the blist: 1. If the account is not online then don't attempt to lookup the buddy or get the buddy's alias 2. If the buddy does not exist in your buddy list then don't attempt to get the buddy's alias--just use the screen name committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 23 Nov 2004 06:37:42 +0000
parents a7c8a8735a31
children 645eb9804040
files src/gtkpounce.c
diffstat 1 files changed, 11 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkpounce.c	Tue Nov 23 06:28:01 2004 +0000
+++ b/src/gtkpounce.c	Tue Nov 23 06:37:42 2004 +0000
@@ -828,23 +828,30 @@
 	GtkWidget *item;
 	GdkPixbuf *pixbuf, *scale;
 	GaimPounce *pounce;
-	const char *buddy;
+	GaimBuddy *buddy;
+	const char *buddyname;
 	gboolean has_items = FALSE;
 	GList *bp;
 
 	for (bp = gaim_pounces_get_all(); bp != NULL; bp = bp->next)
 	{
 		pounce = (GaimPounce *)bp->data;
-		buddy = gaim_buddy_get_contact_alias(gaim_find_buddy(gaim_pounce_get_pouncer(pounce), gaim_pounce_get_pouncee(pounce)));
 
 		/* Check if account is online, if not skip it */
-		if (!gaim_account_is_connected(pounce->pouncer))
+		if (!gaim_account_is_connected(gaim_pounce_get_pouncer(pounce)))
 			continue;
 
+		buddy = gaim_find_buddy(gaim_pounce_get_pouncer(pounce), gaim_pounce_get_pouncee(pounce));
+
+		if (buddy != NULL)
+			buddyname = gaim_buddy_get_contact_alias(buddy);
+		else
+			buddyname = gaim_pounce_get_pouncee(pounce);
+
 		has_items = TRUE;
 
 		/* Build the menu item */
-		item = gtk_image_menu_item_new_with_label(buddy);
+		item = gtk_image_menu_item_new_with_label(buddyname);
 
 		/* Create a pixmap for the protocol icon. */
 		pixbuf = create_prpl_icon(gaim_pounce_get_pouncer(pounce));