|
From: xevuz <xe...@us...> - 2007-07-16 13:10:06
|
Update of /cvsroot/chix/chix_gaim/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16426/src Modified Files: chix_gaim.c Log Message: Index: chix_gaim.c =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/chix_gaim.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- chix_gaim.c 15 Jul 2007 11:23:10 -0000 1.22 +++ chix_gaim.c 16 Jul 2007 13:09:20 -0000 1.23 @@ -104,11 +104,15 @@ PurpleConn *pc = client->user_data; PurpleGroup *pg = purple_find_group(purple_connection_get_display_name(pc)); PurpleBuddy *pb = purple_find_buddy_in_group(pc->account, buddy->id, pg); + + printf("got here. event delete\n"); if (pb) { char mesg[128]; + + printf("got here. event delete\n"); - purple_blist_remove_buddy(pb); + pb->proto_data = NULL; g_snprintf(mesg, sizeof(mesg), _("You've been deleted by: %s."), buddy->alias ? buddy->alias : buddy->id); purple_notify_info(NULL, _("Chix System Message"), pg->name, mesg); @@ -343,18 +347,12 @@ ****************************************************************************/ static void -__block_callback(PurpleBuddy *pb) +__block_cb(PurpleBuddy *pb, gpointer data) { PurpleConn *pc = purple_account_get_connection(pb->account); - chix_buddy_block(pc->proto_data, pb->proto_data); -} -static void -block_buddy(PurpleBlistNode *node, gpointer data) -{ -// purple_request_yes_no(NULL, _("Block Buddy"), NULL, -// _("Blocking this buddy will also remove it from your list. Continue?"), -// 0, node, __block_callback, NULL); + printf("blocking...\n"); + chix_buddy_block(pc->proto_data, pb->proto_data); } static void @@ -368,10 +366,10 @@ { // PurpleConn *pc = action->context; // purple_request_input(pc, _("Unblock Buddy"), NULL, -// _("Please enter the Chix ID to unblock"), NULL, -// FALSE, FALSE, "09xxxxxxxxxx", -// _("Unblock"), G_CALLBACK(__unblock_cb), -// _("Cancel"), NULL, pc->proto_data); +// _("Please enter the Chix ID to unblock"), NULL, +// FALSE, FALSE, "09xxxxxxxxxx", +// _("Unblock"), G_CALLBACK(__unblock_cb), +// _("Cancel"), NULL, pc->proto_data); } /***************************************************************************** @@ -473,14 +471,15 @@ static GList * cp_blist_node_menu(PurpleBlistNode *node) { - if (!PURPLE_BLIST_NODE_IS_BUDDY(node)) - { - PurpleMenuAction *act; - act = purple_menu_action_new(_("Block Buddy"), PURPLE_CALLBACK(block_buddy), - node, NULL); - return g_list_append(NULL, act); - } - else return NULL; +// if (PURPLE_BLIST_NODE_IS_BUDDY(node)) +// { +// PurpleMenuAction *act; +// act = purple_menu_action_new(_("Block Buddy"), +// PURPLE_CALLBACK(block_buddy), node, NULL); +// return g_list_append(NULL, act); +// } +// else return NULL; + return NULL; } static void @@ -527,7 +526,7 @@ client->user_data = pc; pc->proto_data = client; pc->inpa = purple_input_add(chix_sockfd_get(client), PURPLE_INPUT_READ, - __process, client); + __process, client); } static void @@ -589,8 +588,6 @@ client = pc->proto_data; buddy = chix_blist_search(client->blist, who); - chix_buddy_print(buddy); - if (!buddy) return __unlisted(client, who, mesg); if ((CHIX_BUDDY_ON_PC(buddy)) || (!strcmp(buddy->provider, "Chikka"))) @@ -610,7 +607,6 @@ chix_buddy_info(client, buddy); } - static void cp_set_status(PurpleAccount *account, PurpleStatus *stat) { @@ -661,6 +657,20 @@ } static void +cp_add_deny(PurpleConn *pc, const char *name) +{ + PurpleBuddy *pb; + + pb = purple_find_buddy(pc->account, name); + + purple_request_yes_no(pc, _("Block Buddy"), NULL, + _("Blocking this buddy will also" + " remove it from your list. Continue?"), + 0, pc->account, name, NULL, pb, + __block_cb, NULL); +} + +static void cp_alias_buddy(PurpleConn *pc, const char *who, const char *alias) { ChixClient *client; @@ -908,7 +918,7 @@ g_snprintf(buf, sizeof(buf), _("%s's Info"), purple_connection_get_display_name(pc)); g_snprintf(buf2, sizeof(buf2), - _("Chix ID:\t\t%s\nProvider:\t%s\n"), info->id, info->provider); + _("Chix ID: %s\nProvider: %s\n"), info->id, info->provider); purple_request_fields(pc, _("Chix Info"), buf, buf2, fields, _("Update"), G_CALLBACK(__info_update_cb), @@ -918,7 +928,8 @@ static void __mood_update_cb(ChixClient *client, PurpleRequestFields *fields) { - chix_client_mood_set(client, purple_request_fields_get_choice(fields, "mood")); + chix_client_mood_set(client, + purple_request_fields_get_choice(fields, "mood")); } static void @@ -1002,6 +1013,7 @@ .change_passwd = cp_change_passwd, .add_buddy = cp_add_buddy, .remove_buddy = cp_remove_buddy, + .add_deny = cp_add_deny, .alias_buddy = cp_alias_buddy, }; |