Mercurial > pidgin.yaz
diff src/protocols/toc/toc.c @ 9030:7ab20f829190
[gaim-migrate @ 9806]
Siege updated the code for creating right-click menu's for
buddies, chats, groups, etc. It uses more stuff from the blist
API and less stuff from multi.h. It also combines the code
for right-click menus for chats, buddies, etc. (all types of
blist nodes). So PRPLs and plugins can easily add right-click
menu options to anything in the buddy list in a clean way.
committer: Tailor Script <tailor@pidgin.im>
| author | Mark Doliner <mark@kingant.net> |
|---|---|
| date | Sun, 23 May 2004 17:27:45 +0000 |
| parents | 67421e0dc497 |
| children | cde9fb3546ed |
line wrap: on
line diff
--- a/src/protocols/toc/toc.c Sun May 23 08:06:38 2004 +0000 +++ b/src/protocols/toc/toc.c Sun May 23 17:27:45 2004 +0000 @@ -25,7 +25,6 @@ #include "conversation.h" #include "debug.h" #include "prpl.h" -#include "multi.h" #include "notify.h" #include "proxy.h" #include "request.h" @@ -1119,10 +1118,19 @@ } /* Should be implemented as an Account Action? */ -static void toc_get_dir(GaimConnection *gc, const char *name) +static void toc_get_dir(GaimBlistNode *node, gpointer data) { + GaimBuddy *buddy; + GaimConnection *gc; char buf[BUF_LEN * 2]; - g_snprintf(buf, MSG_LEN, "toc_get_dir %s", gaim_normalize(gc->account, name)); + + g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node)); + + buddy = (GaimBuddy *) node; + gc = gaim_acount_get_connection(buddy->account); + + g_snprintf(buf, MSG_LEN, "toc_get_dir %s", + gaim_normalize(buddy->account, buddy->name)); sflap_send(gc, buf, -1, TYPE_DATA); } @@ -1400,16 +1408,16 @@ *ne = emblems[3]; } -static GList *toc_buddy_menu(GaimConnection *gc, const char *who) +static GList *toc_blist_node_menu(GaimBlistNode *node) { GList *m = NULL; - struct proto_buddy_menu *pbm; + GaimBlistNodeAction *act; - pbm = g_new0(struct proto_buddy_menu, 1); - pbm->label = _("Get Dir Info"); - pbm->callback = toc_get_dir; - pbm->gc = gc; - m = g_list_append(m, pbm); + if(GAIM_BLIST_NODE_IS_BUDDY(node)) { + act = gaim_blist_node_action_new(_("Get Dir Info"), + toc_get_dir, NULL); + m = g_list_append(m, act); + } return m; } @@ -2103,7 +2111,7 @@ NULL, NULL, toc_away_states, - toc_buddy_menu, + toc_blist_node_menu, toc_chat_info, toc_login, toc_close, @@ -2147,7 +2155,6 @@ NULL, NULL, NULL, - NULL, NULL };
