Mercurial > pidgin.yaz
diff src/buddy.c @ 2564:552a56d334ec
[gaim-migrate @ 2577]
Once upon a midnight dreary, robbie coded weak and weary...
committer: Tailor Script <tailor@pidgin.im>
author | Rob Flynn <gaim@robflynn.com> |
---|---|
date | Sun, 21 Oct 2001 00:15:55 +0000 |
parents | 0417ecaff0e5 |
children | a714b8223228 |
line wrap: on
line diff
--- a/src/buddy.c Sun Oct 21 00:14:41 2001 +0000 +++ b/src/buddy.c Sun Oct 21 00:15:55 2001 +0000 @@ -91,9 +91,6 @@ void BuddyTickerLogonTimeout(gpointer data); void BuddyTickerLogoutTimeout(gpointer data); -/* Predefine some functions */ -static void new_bp_callback(GtkWidget *w, char *name); - struct buddy_show { GtkWidget *item; GtkWidget *pix; @@ -117,6 +114,8 @@ }; static GSList *shows = NULL; +/* Predefine some functions */ +static void new_bp_callback(GtkWidget *w, struct buddy_show *bs); static struct group_show *find_group_show(char *group); static struct buddy_show *find_buddy_show(struct group_show *gs, char *name); static int group_number(char *group); @@ -623,7 +622,7 @@ button = gtk_menu_item_new_with_label(_("Add Buddy Pounce")); gtk_signal_connect(GTK_OBJECT(button), "activate", - GTK_SIGNAL_FUNC(new_bp_callback), b->name); + GTK_SIGNAL_FUNC(new_bp_callback), b); gtk_menu_append(GTK_MENU(menu), button); gtk_widget_show(button); @@ -779,7 +778,7 @@ button = gtk_menu_item_new_with_label(_("Add Buddy Pounce")); gtk_signal_connect(GTK_OBJECT(button), "activate", - GTK_SIGNAL_FUNC(new_bp_callback), b->name); + GTK_SIGNAL_FUNC(new_bp_callback), b); gtk_menu_append(GTK_MENU(menu), button); gtk_widget_show(button); @@ -1508,9 +1507,27 @@ g_free(who); } -static void new_bp_callback(GtkWidget *w, char *name) +static void new_bp_callback(GtkWidget *w, struct buddy_show *bs) { - show_new_bp(name); + struct gaim_connection *c = NULL; + struct buddy *b = NULL; + + if (bs) { + /* I really only care about the first account. If they've got multiple + * accounts in here then, as eric would say, butt fuck them. */ + c = (struct gaim_connection *)bs->connlist->data; + + b = find_buddy(c, bs->name); + + if (!b) { + /* What the hell? */ + return; + } + + show_new_bp(bs->name, c, b->idle, b->uc & UC_UNAVAILABLE); + } else { + show_new_bp(NULL, NULL, 0, 0); + } } void do_bp_menu()