Mercurial > pidgin
comparison src/protocols/yahoo/yay.c @ 2170:c24595d3c364
[gaim-migrate @ 2180]
buddy_menu
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Mon, 27 Aug 2001 07:11:50 +0000 |
parents | a464da684307 |
children | bc53b057732f |
comparison
equal
deleted
inserted
replaced
2169:b7807144bf44 | 2170:c24595d3c364 |
---|---|
590 default: | 590 default: |
591 return NULL; | 591 return NULL; |
592 } | 592 } |
593 } | 593 } |
594 | 594 |
595 static void yahoo_buddy_menu(GtkWidget *menu, struct gaim_connection *gc, char *who) { | 595 static GList *yahoo_buddy_menu(struct gaim_connection *gc, char *who) { |
596 GList *m = NULL; | |
597 struct proto_buddy_menu *pbm; | |
596 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; | 598 struct yahoo_data *yd = (struct yahoo_data *)gc->proto_data; |
597 GtkWidget *button; | |
598 struct buddy *b = find_buddy(gc, who); /* this should never be null. if it is, | 599 struct buddy *b = find_buddy(gc, who); /* this should never be null. if it is, |
599 segfault and get the bug report. */ | 600 segfault and get the bug report. */ |
600 char buf[1024]; | 601 static char buf[1024]; |
601 | 602 |
602 if (b->uc & UC_NORMAL) | 603 if (b->uc & UC_NORMAL) |
603 return; | 604 return NULL; |
604 | 605 |
606 pbm = g_new0(struct proto_buddy_menu, 1); | |
605 if ((b->uc >> 5) != YAHOO_STATUS_CUSTOM) | 607 if ((b->uc >> 5) != YAHOO_STATUS_CUSTOM) |
606 g_snprintf(buf, sizeof buf, "Status: %s", yahoo_get_status_string(b->uc >> 5)); | 608 g_snprintf(buf, sizeof buf, "Status: %s", yahoo_get_status_string(b->uc >> 5)); |
607 else | 609 else |
608 g_snprintf(buf, sizeof buf, "Custom Status: %s", | 610 g_snprintf(buf, sizeof buf, "Custom Status: %s", |
609 (char *)g_hash_table_lookup(yd->hash, b->name)); | 611 (char *)g_hash_table_lookup(yd->hash, b->name)); |
610 button = gtk_menu_item_new_with_label(buf); | 612 pbm->label = buf; |
611 gtk_menu_append(GTK_MENU(menu), button); | 613 pbm->callback = NULL; |
612 gtk_widget_show(button); | 614 pbm->gc = gc; |
615 m = g_list_append(m, pbm); | |
616 | |
617 return m; | |
613 } | 618 } |
614 | 619 |
615 static GList *yahoo_away_states() { | 620 static GList *yahoo_away_states() { |
616 GList *m = NULL; | 621 GList *m = NULL; |
617 | 622 |