comparison src/protocols/silc/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 95a73ce6e285
children 82e918444965
comparison
equal deleted inserted replaced
12918:a05fbd9dcc31 12919:248b8b39c671
1617 GaimConnection *gc = gaim_account_get_connection(buddy->account); 1617 GaimConnection *gc = gaim_account_get_connection(buddy->account);
1618 SilcGaim sg = gc->proto_data; 1618 SilcGaim sg = gc->proto_data;
1619 SilcClientConnection conn = sg->conn; 1619 SilcClientConnection conn = sg->conn;
1620 const char *pkfile = NULL; 1620 const char *pkfile = NULL;
1621 SilcClientEntry client_entry = NULL; 1621 SilcClientEntry client_entry = NULL;
1622 GaimBlistNodeAction *act; 1622 GaimMenuAction *act;
1623 GList *m = NULL; 1623 GList *m = NULL;
1624 SilcGaimBuddyWb wb; 1624 SilcGaimBuddyWb wb;
1625 1625
1626 pkfile = gaim_blist_node_get_string((GaimBlistNode *) buddy, "public-key"); 1626 pkfile = gaim_blist_node_get_string((GaimBlistNode *) buddy, "public-key");
1627 client_entry = silc_client_get_client_by_id(sg->client, 1627 client_entry = silc_client_get_client_by_id(sg->client,
1628 sg->conn, 1628 sg->conn,
1629 buddy->proto_data); 1629 buddy->proto_data);
1630 1630
1631 if (client_entry && client_entry->send_key) { 1631 if (client_entry && client_entry->send_key) {
1632 act = gaim_blist_node_action_new(_("Reset IM Key"), 1632 act = gaim_menu_action_new(_("Reset IM Key"),
1633 silcgaim_buddy_resetkey, NULL, NULL); 1633 GAIM_CALLBACK(silcgaim_buddy_resetkey),
1634 NULL, NULL);
1634 m = g_list_append(m, act); 1635 m = g_list_append(m, act);
1635 1636
1636 } else { 1637 } else {
1637 act = gaim_blist_node_action_new(_("IM with Key Exchange"), 1638 act = gaim_menu_action_new(_("IM with Key Exchange"),
1638 silcgaim_buddy_keyagr, NULL, NULL); 1639 GAIM_CALLBACK(silcgaim_buddy_keyagr),
1640 NULL, NULL);
1639 m = g_list_append(m, act); 1641 m = g_list_append(m, act);
1640 1642
1641 act = gaim_blist_node_action_new(_("IM with Password"), 1643 act = gaim_menu_action_new(_("IM with Password"),
1642 silcgaim_buddy_privkey_menu, 1644 GAIM_CALLBACK(silcgaim_buddy_privkey_menu),
1643 NULL, NULL); 1645 NULL, NULL);
1644 m = g_list_append(m, act); 1646 m = g_list_append(m, act);
1645 } 1647 }
1646 1648
1647 if (pkfile) { 1649 if (pkfile) {
1648 act = gaim_blist_node_action_new(_("Show Public Key"), 1650 act = gaim_menu_action_new(_("Show Public Key"),
1649 silcgaim_buddy_showkey, NULL, NULL); 1651 GAIM_CALLBACK(silcgaim_buddy_showkey),
1652 NULL, NULL);
1650 m = g_list_append(m, act); 1653 m = g_list_append(m, act);
1651 1654
1652 } else { 1655 } else {
1653 act = gaim_blist_node_action_new(_("Get Public Key..."), 1656 act = gaim_menu_action_new(_("Get Public Key..."),
1654 silcgaim_buddy_getkey_menu, 1657 GAIM_CALLBACK(silcgaim_buddy_getkey_menu),
1655 NULL, NULL); 1658 NULL, NULL);
1656 m = g_list_append(m, act); 1659 m = g_list_append(m, act);
1657 } 1660 }
1658 1661
1659 if (conn && conn->local_entry->mode & SILC_UMODE_ROUTER_OPERATOR) { 1662 if (conn && conn->local_entry->mode & SILC_UMODE_ROUTER_OPERATOR) {
1660 act = gaim_blist_node_action_new(_("Kill User"), 1663 act = gaim_menu_action_new(_("Kill User"),
1661 silcgaim_buddy_kill, NULL, NULL); 1664 GAIM_CALLBACK(silcgaim_buddy_kill),
1665 NULL, NULL);
1662 m = g_list_append(m, act); 1666 m = g_list_append(m, act);
1663 } 1667 }
1664 1668
1665 if (client_entry) { 1669 if (client_entry) {
1666 wb = silc_calloc(1, sizeof(*wb)); 1670 wb = silc_calloc(1, sizeof(*wb));
1667 wb->sg = sg; 1671 wb->sg = sg;
1668 wb->client_entry = client_entry; 1672 wb->client_entry = client_entry;
1669 act = gaim_blist_node_action_new(_("Draw On Whiteboard"), 1673 act = gaim_menu_action_new(_("Draw On Whiteboard"),
1670 silcgaim_buddy_wb, (void *)wb, NULL); 1674 GAIM_CALLBACK(silcgaim_buddy_wb),
1675 (void *)wb, NULL);
1671 m = g_list_append(m, act); 1676 m = g_list_append(m, act);
1672 } 1677 }
1673 return m; 1678 return m;
1674 } 1679 }
1675 1680