From: Don S. <ri...@us...> - 2005-01-13 22:43:48
|
Update of /cvsroot/gaim-bnet/gaim-bnet/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22610/src Modified Files: bnet.c buddy.c Log Message: Checking in some in-progress code for calling /stats from buddy menu. Not working yet but not breaking anything Index: bnet.c =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/bnet.c,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** bnet.c 9 Jan 2005 09:59:59 -0000 1.26 --- bnet.c 13 Jan 2005 22:43:25 -0000 1.27 *************** *** 81,84 **** --- 81,140 ---- } + void + bnet_user_stats(GaimBlistNode *node, gpointer data) { + GaimBuddy *buddy; + /* + BNetConn *conn = BNET_CONN(gc->proto_data); + + bnet_conn_send(conn, "/stats %s %s\n", who, gametype); + */ + + g_return_if_fail(GAIM_BLIST_NODE_IS_BUDDY(node)); + + buddy = (GaimBuddy *) node; + + gaim_debug_info("bnet_user_stats", "I want to call stats for %s in %s\n", buddy->name, data); + } + + + /* + * Statistics sub-menu + */ + static void blist_node_menu(GaimBlistNode *node, GList **menu, gpointer data) { + + GaimBuddy *buddy = (GaimBuddy *) node; + GaimBlistNodeAction *act; + + g_return_if_fail(node != NULL); + g_return_if_fail(menu != NULL); + + if(! GAIM_BLIST_NODE_IS_BUDDY(node)) + return; + + //if(buddy->account != mw_acct) return; + + *menu = g_list_append(*menu, NULL); + + act = gaim_blist_node_action_new(_("StarCraft"), bnet_user_stats, "STAR"); + *menu = g_list_append(*menu, act); + + act = gaim_blist_node_action_new(_("StarCraft Broodwar"), bnet_user_stats, "SEXP"); + *menu = g_list_append(*menu, act); + + act = gaim_blist_node_action_new(_("WarCraft II Battle.net Edition"), bnet_user_stats, "W2BN"); + *menu = g_list_append(*menu, act); + + act = gaim_blist_node_action_new(_("WarCraft III"), bnet_user_stats, "WAR3"); + *menu = g_list_append(*menu, act); + + act = gaim_blist_node_action_new(_("WarCraft III The Frozen Throne"), bnet_user_stats, "W3XP"); + *menu = g_list_append(*menu, act); + + } + + + + + /****************************************************************************** * Protocol/Plugin stuff *************** *** 177,180 **** --- 233,237 ---- static void init_plugin(GaimPlugin *plugin) { + void *blist_handle = gaim_blist_get_handle(); #if 0 GList *server_list = NULL; *************** *** 190,193 **** --- 247,254 ---- info.description = _("Allows Gaim to send messages over Battle.net."); + + gaim_signal_connect(blist_handle, "blist-node-extended-menu", plugin, + GAIM_CALLBACK(blist_node_menu), NULL); + GaimAccountOption *option; Index: buddy.c =================================================================== RCS file: /cvsroot/gaim-bnet/gaim-bnet/src/buddy.c,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** buddy.c 13 Jan 2005 15:50:54 -0000 1.10 --- buddy.c 13 Jan 2005 22:43:25 -0000 1.11 *************** *** 20,23 **** --- 20,24 ---- */ #include "buddy.h" + #include "intl.h" /****************************************************************************** *************** *** 78,81 **** --- 79,83 ---- } + void bnet_user_info(GaimConnection *gc, const gchar *who) { |