comparison src/protocols/sametime/sametime.c @ 12919:248b8b39c671

[gaim-migrate @ 15272] Replace GaimBlistNodeAction with the more generic GaimMenuAction, this is in preparation for letting the chat room user list have extensible menus like the blist entries do. (I know it's not exactly the prettiest, and the callback isn't exactly type-safe, when we eventually gobjectify everything we can get some safety back by using (GObject, gpointer) but that's for later.) I'm planning to look into merging GaimPluginActions into GaimMenuActions as well. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Tue, 17 Jan 2006 23:22:19 +0000
parents 2c0f8815aa2e
children 66e424d4bc77
comparison
equal deleted inserted replaced
12918:a05fbd9dcc31 12919:248b8b39c671
1220 static void blist_node_menu_cb(GaimBlistNode *node, 1220 static void blist_node_menu_cb(GaimBlistNode *node,
1221 GList **menu, struct mwGaimPluginData *pd) { 1221 GList **menu, struct mwGaimPluginData *pd) {
1222 const char *owner; 1222 const char *owner;
1223 GaimGroup *group; 1223 GaimGroup *group;
1224 GaimAccount *acct; 1224 GaimAccount *acct;
1225 GaimBlistNodeAction *act; 1225 GaimMenuAction *act;
1226 1226
1227 /* we only want groups */ 1227 /* we only want groups */
1228 if(! GAIM_BLIST_NODE_IS_GROUP(node)) return; 1228 if(! GAIM_BLIST_NODE_IS_GROUP(node)) return;
1229 group = (GaimGroup *) node; 1229 group = (GaimGroup *) node;
1230 1230
1236 1236
1237 #if 0 1237 #if 0
1238 /* if there's anyone in the group for this acct, offer to invite 1238 /* if there's anyone in the group for this acct, offer to invite
1239 them all to a conference */ 1239 them all to a conference */
1240 if(gaim_group_on_account(group, acct)) { 1240 if(gaim_group_on_account(group, acct)) {
1241 act = gaim_blist_node_action_new(_("Invite Group to Conference..."), 1241 act = gaim_menu_action_new(_("Invite Group to Conference..."),
1242 blist_menu_group_invite, pd, NULL); 1242 blist_menu_group_invite, pd, NULL);
1243 *menu = g_list_append(*menu, NULL); 1243 *menu = g_list_append(*menu, NULL);
1244 } 1244 }
1245 #endif 1245 #endif
1246 1246
1247 /* check if it's a NAB group for this account */ 1247 /* check if it's a NAB group for this account */
1248 owner = gaim_blist_node_get_string(node, GROUP_KEY_OWNER); 1248 owner = gaim_blist_node_get_string(node, GROUP_KEY_OWNER);
1249 if(owner && !strcmp(owner, gaim_account_get_username(acct))) { 1249 if(owner && !strcmp(owner, gaim_account_get_username(acct))) {
1250 act = gaim_blist_node_action_new(_("Get Notes Address Book Info"), 1250 act = gaim_menu_action_new(_("Get Notes Address Book Info"),
1251 blist_menu_nab, pd, NULL); 1251 blist_menu_nab, pd, NULL);
1252 *menu = g_list_append(*menu, act); 1252 *menu = g_list_append(*menu, act);
1253 } 1253 }
1254 } 1254 }
1255 1255
1256 1256
3482 } 3482 }
3483 3483
3484 3484
3485 static GList *mw_prpl_blist_node_menu(GaimBlistNode *node) { 3485 static GList *mw_prpl_blist_node_menu(GaimBlistNode *node) {
3486 GList *l = NULL; 3486 GList *l = NULL;
3487 GaimBlistNodeAction *act; 3487 GaimMenuAction *act;
3488 3488
3489 if(! GAIM_BLIST_NODE_IS_BUDDY(node)) 3489 if(! GAIM_BLIST_NODE_IS_BUDDY(node))
3490 return l; 3490 return l;
3491 3491
3492 l = g_list_append(l, NULL); 3492 l = g_list_append(l, NULL);
3493 3493
3494 act = gaim_blist_node_action_new(_("Invite to Conference..."), 3494 act = gaim_menu_action_new(_("Invite to Conference..."),
3495 blist_menu_conf, NULL, NULL); 3495 blist_menu_conf, NULL, NULL);
3496 l = g_list_append(l, act); 3496 l = g_list_append(l, act);
3497 3497
3498 /** note: this never gets called for a GaimGroup, have to use the 3498 /** note: this never gets called for a GaimGroup, have to use the
3499 blist-node-extended-menu signal for that. The function 3499 blist-node-extended-menu signal for that. The function
3500 blist_node_menu_cb is assigned to this signal in the function 3500 blist_node_menu_cb is assigned to this signal in the function