changeset 14341:1c104df05a38

[gaim-migrate @ 17038] Fixes GtR* Bug #1 Contactify "View User Log" in the Buddies menu. This has been on my TODO list forever. Yay for long trips with the laptop. * Gary to Richard, via IM ;) committer: Tailor Script <tailor@pidgin.im>
author Richard Laager <rlaager@wiktel.com>
date Sat, 26 Aug 2006 06:26:39 +0000
parents 2aaadbd919c4
children 12156328fb4f
files gtk/gtkdialogs.c
diffstat 1 files changed, 17 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/gtk/gtkdialogs.c	Sat Aug 26 06:26:25 2006 +0000
+++ b/gtk/gtkdialogs.c	Sat Aug 26 06:26:39 2006 +0000
@@ -809,6 +809,7 @@
 {
 	char *username;
 	GaimAccount *account;
+	GSList *cur;
 
 	account  = gaim_request_fields_get_account(fields, "account");
 
@@ -818,9 +819,25 @@
 	if (username != NULL && *username != '\0' && account != NULL)
 	{
 		GaimGtkBuddyList *gtkblist = gaim_gtk_blist_get_default_gtk_blist();
+		GSList *buddies;
 
 		gaim_gtk_set_cursor(gtkblist->window, GDK_WATCH);
 
+		buddies = gaim_find_buddies(account, username);
+		for (cur = buddies; cur != NULL; cur = cur->next)
+		{
+			GaimBlistNode *node = cur->data;
+			if ((node != NULL) && ((node->prev != NULL) || (node->next != NULL)))
+			{
+				gaim_gtk_log_show_contact((GaimContact *)node->parent);
+				g_slist_free(buddies);
+				gaim_gtk_clear_cursor(gtkblist->window);
+				g_free(username);
+				return;
+			}
+		}
+		g_slist_free(buddies);
+
 		gaim_gtk_log_show(GAIM_LOG_IM, username, account);
 
 		gaim_gtk_clear_cursor(gtkblist->window);