comparison src/protocols/silc/buddy.c @ 12058:d5daff460913

[gaim-migrate @ 14353] SILC whiteboard support from Pekka Riikonen. committer: Tailor Script <tailor@pidgin.im>
author Ethan Blanton <elb@pidgin.im>
date Sat, 12 Nov 2005 23:04:44 +0000
parents 03cd74ca2562
children b528f37d8e95
comparison
equal deleted inserted replaced
12057:68c18dd8a316 12058:d5daff460913
18 */ 18 */
19 19
20 #include "silcincludes.h" 20 #include "silcincludes.h"
21 #include "silcclient.h" 21 #include "silcclient.h"
22 #include "silcgaim.h" 22 #include "silcgaim.h"
23 #include "wb.h"
23 24
24 /***************************** Key Agreement *********************************/ 25 /***************************** Key Agreement *********************************/
25 26
26 static void 27 static void
27 silcgaim_buddy_keyagr(GaimBlistNode *node, gpointer data); 28 silcgaim_buddy_keyagr(GaimBlistNode *node, gpointer data);
1545 /* Call KILL */ 1546 /* Call KILL */
1546 silc_client_command_call(sg->client, sg->conn, NULL, "KILL", 1547 silc_client_command_call(sg->client, sg->conn, NULL, "KILL",
1547 b->name, "Killed by operator", NULL); 1548 b->name, "Killed by operator", NULL);
1548 } 1549 }
1549 1550
1551 typedef struct {
1552 SilcGaim sg;
1553 SilcClientEntry client_entry;
1554 } *SilcGaimBuddyWb;
1555
1556 static void
1557 silcgaim_buddy_wb(GaimBlistNode *node, gpointer data)
1558 {
1559 SilcGaimBuddyWb wb = data;
1560 silcgaim_wb_init(wb->sg, wb->client_entry);
1561 silc_free(wb);
1562 }
1563
1550 GList *silcgaim_buddy_menu(GaimBuddy *buddy) 1564 GList *silcgaim_buddy_menu(GaimBuddy *buddy)
1551 { 1565 {
1552
1553 GaimConnection *gc = gaim_account_get_connection(buddy->account); 1566 GaimConnection *gc = gaim_account_get_connection(buddy->account);
1554 SilcGaim sg = gc->proto_data; 1567 SilcGaim sg = gc->proto_data;
1555 SilcClientConnection conn = sg->conn; 1568 SilcClientConnection conn = sg->conn;
1556 const char *pkfile = NULL; 1569 const char *pkfile = NULL;
1557 SilcClientEntry client_entry = NULL; 1570 SilcClientEntry client_entry = NULL;
1558 GaimBlistNodeAction *act; 1571 GaimBlistNodeAction *act;
1559 GList *m = NULL; 1572 GList *m = NULL;
1573 SilcGaimBuddyWb wb;
1560 1574
1561 pkfile = gaim_blist_node_get_string((GaimBlistNode *) buddy, "public-key"); 1575 pkfile = gaim_blist_node_get_string((GaimBlistNode *) buddy, "public-key");
1562 client_entry = silc_client_get_client_by_id(sg->client, 1576 client_entry = silc_client_get_client_by_id(sg->client,
1563 sg->conn, 1577 sg->conn,
1564 buddy->proto_data); 1578 buddy->proto_data);
1595 act = gaim_blist_node_action_new(_("Kill User"), 1609 act = gaim_blist_node_action_new(_("Kill User"),
1596 silcgaim_buddy_kill, NULL, NULL); 1610 silcgaim_buddy_kill, NULL, NULL);
1597 m = g_list_append(m, act); 1611 m = g_list_append(m, act);
1598 } 1612 }
1599 1613
1614 wb = silc_calloc(1, sizeof(*wb));
1615 wb->sg = sg;
1616 wb->client_entry = client_entry;
1617 act = gaim_blist_node_action_new(_("Draw On Whiteboard"),
1618 silcgaim_buddy_wb, (void *)wb, NULL);
1619 m = g_list_append(m, act);
1620
1600 return m; 1621 return m;
1601 } 1622 }