comparison src/protocols/jabber/buddy.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 41cf9be29754
children 75ac13ab161f
comparison
equal deleted inserted replaced
12918:a05fbd9dcc31 12919:248b8b39c671
1018 GaimConnection *gc = gaim_account_get_connection(buddy->account); 1018 GaimConnection *gc = gaim_account_get_connection(buddy->account);
1019 JabberStream *js = gc->proto_data; 1019 JabberStream *js = gc->proto_data;
1020 JabberBuddy *jb = jabber_buddy_find(js, buddy->name, TRUE); 1020 JabberBuddy *jb = jabber_buddy_find(js, buddy->name, TRUE);
1021 1021
1022 GList *m = NULL; 1022 GList *m = NULL;
1023 GaimBlistNodeAction *act; 1023 GaimMenuAction *act;
1024 1024
1025 if(!jb) 1025 if(!jb)
1026 return m; 1026 return m;
1027 1027
1028 /* XXX: fix the NOT ME below */ 1028 /* XXX: fix the NOT ME below */
1029 1029
1030 if(js->protocol_version == JABBER_PROTO_0_9 /* && NOT ME */) { 1030 if(js->protocol_version == JABBER_PROTO_0_9 /* && NOT ME */) {
1031 if(jb->invisible & JABBER_INVIS_BUDDY) { 1031 if(jb->invisible & JABBER_INVIS_BUDDY) {
1032 act = gaim_blist_node_action_new(_("Un-hide From"), 1032 act = gaim_menu_action_new(_("Un-hide From"),
1033 jabber_buddy_make_visible, NULL, NULL); 1033 GAIM_CALLBACK(jabber_buddy_make_visible),
1034 NULL, NULL);
1034 } else { 1035 } else {
1035 act = gaim_blist_node_action_new(_("Temporarily Hide From"), 1036 act = gaim_menu_action_new(_("Temporarily Hide From"),
1036 jabber_buddy_make_invisible, NULL, NULL); 1037 GAIM_CALLBACK(jabber_buddy_make_invisible),
1038 NULL, NULL);
1037 } 1039 }
1038 m = g_list_append(m, act); 1040 m = g_list_append(m, act);
1039 } 1041 }
1040 1042
1041 if(jb->subscription & JABBER_SUB_FROM /* && NOT ME */) { 1043 if(jb->subscription & JABBER_SUB_FROM /* && NOT ME */) {
1042 act = gaim_blist_node_action_new(_("Cancel Presence Notification"), 1044 act = gaim_menu_action_new(_("Cancel Presence Notification"),
1043 jabber_buddy_cancel_presence_notification, NULL, NULL); 1045 GAIM_CALLBACK(jabber_buddy_cancel_presence_notification),
1046 NULL, NULL);
1044 m = g_list_append(m, act); 1047 m = g_list_append(m, act);
1045 } 1048 }
1046 1049
1047 if(!(jb->subscription & JABBER_SUB_TO)) { 1050 if(!(jb->subscription & JABBER_SUB_TO)) {
1048 act = gaim_blist_node_action_new(_("(Re-)Request authorization"), 1051 act = gaim_menu_action_new(_("(Re-)Request authorization"),
1049 jabber_buddy_rerequest_auth, NULL, NULL); 1052 GAIM_CALLBACK(jabber_buddy_rerequest_auth),
1053 NULL, NULL);
1050 m = g_list_append(m, act); 1054 m = g_list_append(m, act);
1051 1055
1052 } else /* if(NOT ME) */{ 1056 } else /* if(NOT ME) */{
1053 1057
1054 /* shouldn't this just happen automatically when the buddy is 1058 /* shouldn't this just happen automatically when the buddy is
1055 removed? */ 1059 removed? */
1056 act = gaim_blist_node_action_new(_("Unsubscribe"), 1060 act = gaim_menu_action_new(_("Unsubscribe"),
1057 jabber_buddy_unsubscribe, NULL, NULL); 1061 GAIM_CALLBACK(jabber_buddy_unsubscribe),
1062 NULL, NULL);
1058 m = g_list_append(m, act); 1063 m = g_list_append(m, act);
1059 } 1064 }
1060 1065
1061 return m; 1066 return m;
1062 } 1067 }