You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(3) |
Jun
(27) |
Jul
(1) |
Aug
(8) |
Sep
(7) |
Oct
|
Nov
|
Dec
(18) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(12) |
Aug
(1) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(35) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
|
From: xevuz <xe...@us...> - 2007-12-29 09:40:35
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv6654/src/lib Modified Files: chix.c chix_buddy.c chix_credit.c chix_info.c chix_mesg.c Log Message: this should be safer Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -d -r1.29 -r1.30 --- chix.c 29 Dec 2007 09:08:10 -0000 1.29 +++ chix.c 29 Dec 2007 09:40:26 -0000 1.30 @@ -391,28 +391,8 @@ { Chix_Event *ev; Chix_Packet *ack; - int evid; - - switch (chix_packet_get_int(pkt, KEY_LIST_TYPE)) - { - case VAL_BLIST: - evid = BLIST_TYPE; - break; - case VAL_INBOX: - case VAL_OUTBOX: - evid = MESG_BOX_TYPE; - break; - case VAL_SEARCH: - evid = INFO_RESULT_TYPE; - break; - case VAL_CREDITS: - evid = CLIST_TYPE; - break; - default: - break; - } - ev = chix_event_get(cl, evid); + ev = chix_event_get(cl, pkt->seqn - 2); if (!ev) return 0; chix_event_thaw(ev); Index: chix_info.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_info.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- chix_info.c 29 Dec 2007 09:21:29 -0000 1.16 +++ chix_info.c 29 Dec 2007 09:40:26 -0000 1.17 @@ -143,15 +143,18 @@ { Chix_Info_Result *res; Chix_Info *info; + Chix_Event *ev; - res = chix_event_data_get(cl, INFO_RESULT_TYPE); - if (!res) return 0; + ev = chix_event_data_get(cl, pkt->seqn - 2); + if (!ev) return 0; + ev->id = pkt->seqn; info = _chix_info_new(pkt); if (!info) return 0; info->id = chix_packet_get_str(pkt, KEY_BUDDY_ID); - + + res = ev->data; chix_list_add(&res->list, info); return 1; } @@ -165,7 +168,7 @@ res = malloc(sizeof(Chix_Info_Result)); if (!res) return 0; - ev = chix_event_set(cl, res, EVENT_SEARCH_RESULT, INFO_RESULT_TYPE, + ev = chix_event_set(cl, res, EVENT_SEARCH_RESULT, pkt->seqn, CHIX_FUNC_FREE(_chix_info_result_free)); if (!ev) return 0; chix_event_freeze(ev); Index: chix_buddy.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_buddy.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- chix_buddy.c 29 Dec 2007 09:08:10 -0000 1.25 +++ chix_buddy.c 29 Dec 2007 09:40:26 -0000 1.26 @@ -400,7 +400,7 @@ cl->blist = bl; SET_TYPE(bl, BLIST_TYPE); - ev = chix_event_set(cl, bl, EVENT_BUDDY_LIST, BLIST_TYPE, NULL); + ev = chix_event_set(cl, bl, EVENT_BUDDY_LIST, pkt->seqn, NULL); if (!ev) return 0; chix_event_freeze(ev); return 1; @@ -423,9 +423,14 @@ chix_blist_client(Chix_Client *cl, Chix_Packet *pkt) { Chix_Buddy *bud; + Chix_Event *ev; bud = _chix_buddy_new(pkt); if (!bud) return 0; + + ev = chix_event_get(cl, pkt->seqn - 2); + if (!ev) return 0; + ev->id = pkt->seqn; chix_list_add(&cl->blist->list, bud); return _chix_blist_hash_add(cl->blist, bud); Index: chix_credit.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_credit.c,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- chix_credit.c 29 Dec 2007 09:21:29 -0000 1.10 +++ chix_credit.c 29 Dec 2007 09:40:26 -0000 1.11 @@ -50,11 +50,13 @@ { Chix_Credit_List *clist; Chix_Credit *cr; + Chix_Event *ev; char buf[32]; int alloted, used; - clist = chix_event_data_get(cl, CLIST_TYPE); - if (!clist) return 0; + ev = chix_event_get(cl, pkt->seqn - 2); + if (!ev) return 0; + ev->id = pkt->seqn; cr = calloc(1, sizeof(Chix_Credit)); if (!cr) return 0; @@ -69,6 +71,7 @@ cr->left = strdup(buf); SET_TYPE(cr, CREDIT_TYPE); + clist = ev->data; chix_list_add(&clist->list, cr); return 1; } @@ -84,7 +87,7 @@ SET_TYPE(clist, CLIST_TYPE); - ev = chix_event_set(cl, clist, EVENT_CREDIT_LIST, CLIST_TYPE, + ev = chix_event_set(cl, clist, EVENT_CREDIT_LIST, pkt->seqn, CHIX_FUNC_FREE(_chix_clist_free)); chix_event_freeze(ev); return 1; Index: chix_mesg.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_mesg.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- chix_mesg.c 29 Dec 2007 09:08:10 -0000 1.17 +++ chix_mesg.c 29 Dec 2007 09:40:26 -0000 1.18 @@ -143,14 +143,16 @@ Chix_Mesg_Box *box; Chix_Mesg *msg; Chix_Buddy *bud; + Chix_Event *ev; char *id; id = chix_packet_get_ptr(pkt, KEY_MESG_FROM); bud = chix_blist_search(cl->blist, id); if (!bud) return 1; - box = chix_event_data_get(cl, MESG_BOX_TYPE); - if (!box) return 0; + ev = chix_event_get(cl, pkt->seqn - 2); + if (!ev) return 0; + ev->id = pkt->seqn; msg = calloc(1, sizeof(Chix_Mesg)); if (!msg) return 0; @@ -160,6 +162,7 @@ msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); + box = ev->data; chix_list_add(&box->list, msg); return 1; } @@ -170,14 +173,16 @@ Chix_Mesg_Box *box; Chix_Mesg *msg; Chix_Buddy *bud; + Chix_Event *ev; char *id; id = chix_packet_get_ptr(pkt, KEY_MESG_TO); bud = chix_blist_search(cl->blist, id); if (!bud) return 1; - box = chix_event_data_get(cl, MESG_BOX_TYPE); - if (!box) return 0; + ev = chix_event_get(cl, pkt->seqn - 2); + if (!ev) return 0; + ev->id = pkt->seqn; msg = calloc(1, sizeof(Chix_Mesg)); if (!msg) return 0; @@ -187,6 +192,7 @@ msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); + box = ev->data; chix_list_add(&box->list, msg); return 1; } @@ -207,7 +213,7 @@ else ev_type = EVENT_OUTBOX; - ev = chix_event_set(cl, box, ev_type, MESG_BOX_TYPE, + ev = chix_event_set(cl, box, ev_type, pkt->seqn, CHIX_FUNC_FREE(_chix_mesg_box_free)); if (!ev) return 0; chix_event_freeze(ev); |
|
From: xevuz <xe...@us...> - 2007-12-29 09:21:33
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv348/src/lib Modified Files: chix_credit.c chix_info.c Log Message: chikka server side changes. sequence no for list data (blist, buddy search, inbox/outbox, credit list) now gets incremented. can't use pkt->seqn as event id anymore. end of list data will also have the seqn incremented. quick fix for now. Index: chix_credit.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_credit.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- chix_credit.c 29 Dec 2007 09:08:10 -0000 1.9 +++ chix_credit.c 29 Dec 2007 09:21:29 -0000 1.10 @@ -53,7 +53,7 @@ char buf[32]; int alloted, used; - clist = chix_event_data_get(cl, pkt->seqn); + clist = chix_event_data_get(cl, CLIST_TYPE); if (!clist) return 0; cr = calloc(1, sizeof(Chix_Credit)); Index: chix_info.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_info.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- chix_info.c 29 Dec 2007 09:08:10 -0000 1.15 +++ chix_info.c 29 Dec 2007 09:21:29 -0000 1.16 @@ -144,7 +144,7 @@ Chix_Info_Result *res; Chix_Info *info; - res = chix_event_data_get(cl, pkt->seqn); + res = chix_event_data_get(cl, INFO_RESULT_TYPE); if (!res) return 0; info = _chix_info_new(pkt); |
|
From: xevuz <xe...@us...> - 2007-12-29 09:08:15
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27928/src/lib Modified Files: chix.c chix_buddy.c chix_credit.c chix_info.c chix_mesg.c Log Message: chikka server side changes. sequence no for list data (blist, buddy search, inbox/outbox, credit list) now gets incremented. can't use pkt->seqn as event id anymore. end of list data will also have the seqn incremented. quick fix for now. Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.28 retrieving revision 1.29 diff -u -d -r1.28 -r1.29 --- chix.c 15 Jul 2007 11:21:35 -0000 1.28 +++ chix.c 29 Dec 2007 09:08:10 -0000 1.29 @@ -245,7 +245,7 @@ if (!__chix_buffer_ready(buf)) return 1; - do { + do { Chix_Packet *pkt; if (!(pkt = chix_packet_new())) @@ -254,7 +254,7 @@ return 0; if (!__call(pkt->code, cl, pkt)) return 0; - chix_packet_free(pkt); + chix_packet_free(pkt); } while (__chix_buffer_string(buf)); return 1; @@ -390,9 +390,29 @@ _chix_list_end(Chix_Client *cl, Chix_Packet *pkt) { Chix_Event *ev; - Chix_Packet *ack; - - ev = chix_event_get(cl, pkt->seqn); + Chix_Packet *ack; + int evid; + + switch (chix_packet_get_int(pkt, KEY_LIST_TYPE)) + { + case VAL_BLIST: + evid = BLIST_TYPE; + break; + case VAL_INBOX: + case VAL_OUTBOX: + evid = MESG_BOX_TYPE; + break; + case VAL_SEARCH: + evid = INFO_RESULT_TYPE; + break; + case VAL_CREDITS: + evid = CLIST_TYPE; + break; + default: + break; + } + + ev = chix_event_get(cl, evid); if (!ev) return 0; chix_event_thaw(ev); Index: chix_info.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_info.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- chix_info.c 25 Jul 2006 12:07:07 -0000 1.14 +++ chix_info.c 29 Dec 2007 09:08:10 -0000 1.15 @@ -165,7 +165,7 @@ res = malloc(sizeof(Chix_Info_Result)); if (!res) return 0; - ev = chix_event_set(cl, res, EVENT_SEARCH_RESULT, pkt->seqn, + ev = chix_event_set(cl, res, EVENT_SEARCH_RESULT, INFO_RESULT_TYPE, CHIX_FUNC_FREE(_chix_info_result_free)); if (!ev) return 0; chix_event_freeze(ev); Index: chix_buddy.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_buddy.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- chix_buddy.c 16 Jul 2007 12:47:47 -0000 1.24 +++ chix_buddy.c 29 Dec 2007 09:08:10 -0000 1.25 @@ -400,7 +400,7 @@ cl->blist = bl; SET_TYPE(bl, BLIST_TYPE); - ev = chix_event_set(cl, bl, EVENT_BUDDY_LIST, pkt->seqn, NULL); + ev = chix_event_set(cl, bl, EVENT_BUDDY_LIST, BLIST_TYPE, NULL); if (!ev) return 0; chix_event_freeze(ev); return 1; Index: chix_credit.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_credit.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- chix_credit.c 10 Jul 2007 16:46:25 -0000 1.8 +++ chix_credit.c 29 Dec 2007 09:08:10 -0000 1.9 @@ -84,7 +84,7 @@ SET_TYPE(clist, CLIST_TYPE); - ev = chix_event_set(cl, clist, EVENT_CREDIT_LIST, pkt->seqn, + ev = chix_event_set(cl, clist, EVENT_CREDIT_LIST, CLIST_TYPE, CHIX_FUNC_FREE(_chix_clist_free)); chix_event_freeze(ev); return 1; Index: chix_mesg.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_mesg.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- chix_mesg.c 14 Jul 2007 02:46:40 -0000 1.16 +++ chix_mesg.c 29 Dec 2007 09:08:10 -0000 1.17 @@ -133,7 +133,7 @@ msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); - chix_event_set(cl, msg, EVENT_MESG, 0,CHIX_FUNC_FREE(_chix_mesg_free)); + chix_event_set(cl, msg, EVENT_MESG, 0, CHIX_FUNC_FREE(_chix_mesg_free)); return _chix_mesg_ack(cl, pkt); } @@ -149,7 +149,7 @@ bud = chix_blist_search(cl->blist, id); if (!bud) return 1; - box = chix_event_data_get(cl, pkt->seqn); + box = chix_event_data_get(cl, MESG_BOX_TYPE); if (!box) return 0; msg = calloc(1, sizeof(Chix_Mesg)); @@ -176,7 +176,7 @@ bud = chix_blist_search(cl->blist, id); if (!bud) return 1; - box = chix_event_data_get(cl, pkt->seqn); + box = chix_event_data_get(cl, MESG_BOX_TYPE); if (!box) return 0; msg = calloc(1, sizeof(Chix_Mesg)); @@ -207,7 +207,7 @@ else ev_type = EVENT_OUTBOX; - ev = chix_event_set(cl, box, ev_type, pkt->seqn, + ev = chix_event_set(cl, box, ev_type, MESG_BOX_TYPE, CHIX_FUNC_FREE(_chix_mesg_box_free)); if (!ev) return 0; chix_event_freeze(ev); |
|
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, }; |
|
From: xevuz <xe...@us...> - 2007-07-16 13:10:06
|
Update of /cvsroot/chix/chix_gaim/debian In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv16426/debian Modified Files: control Added Files: libchixpurple.files Removed Files: libchixgaim.files Log Message: Index: control =================================================================== RCS file: /cvsroot/chix/chix_gaim/debian/control,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- control 11 Jun 2005 13:11:41 -0000 1.1 +++ control 16 Jul 2007 13:09:20 -0000 1.2 @@ -2,12 +2,12 @@ Section: libs Priority: optional Maintainer: xevuz <x....@gm...> -Build-Depends: debhelper (>= 3.0.0), libchix-dev, gaim-dev (>= 1.0.0), autotools-dev, libtool +Build-Depends: debhelper (>= 3.0.0), libchix-dev, pidgin-dev (>= 2.0.0), autotools-dev, libtool Standards-Version: 3.5.7.0 -Package: libchixgaim +Package: libchixpurple Section: libs Architecture: any -Depends: gaim (>= 1.0.0), libchix (>= 1.0.0) -Description: Chix gaim plugin - Chix gaim plugin. +Depends: pidgin (>= 2.0.0), libchix (>= 1.1.99) +Description: Pidgin/Purple Chix protocol plugin + Pidgin/Purple Chix protocol plugin. --- libchixgaim.files DELETED --- --- NEW FILE: libchixpurple.files --- usr/lib/purple-2/*.so usr/share/pixmaps/gaim/*.png |
|
From: xevuz <xe...@us...> - 2007-07-16 12:47:51
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv8458/src/lib Modified Files: chix_buddy.c Log Message: one more Index: chix_buddy.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_buddy.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- chix_buddy.c 15 Jul 2007 10:30:33 -0000 1.23 +++ chix_buddy.c 16 Jul 2007 12:47:47 -0000 1.24 @@ -607,6 +607,8 @@ int away = chix_packet_get_int(pkt, KEY_STATUS_AWAY); if (away > MAX_AWAY) chix_status_away_set_extern(&bud->stat, AWAY_UNKNOWN); + else if ((!bud->pc) && (bud->mb)) + chix_status_away_set_extern(&bud->stat, AWAY_AVAILABLE); else chix_status_away_set_extern(&bud->stat, away); } |
|
From: xevuz <xe...@us...> - 2007-07-15 11:23:17
|
Update of /cvsroot/chix/chix_gaim/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31991/src Modified Files: chix_gaim.c Log Message: remove printfs Index: chix_gaim.c =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/chix_gaim.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- chix_gaim.c 15 Jul 2007 10:32:19 -0000 1.21 +++ chix_gaim.c 15 Jul 2007 11:23:10 -0000 1.22 @@ -61,8 +61,6 @@ static inline void __update_buddy_status(PurpleAccount *account, ChixBuddy *buddy) { - char buf[16]; - if (chix_buddy_away_get(buddy, NULL, 0) == AWAY_AWAY) purple_prpl_got_user_status(account, buddy->id, "away", NULL); else if (chix_buddy_away_get(buddy, NULL, 0) == AWAY_BUSY) @@ -404,8 +402,6 @@ char buf2[16]; chix_buddy_away_get(buddy, buf2, sizeof(buf2)); - printf("%s\n", __func__); - printf("%s\n", buf2); if (CHIX_BUDDY_ON_BOTH(buddy)) g_snprintf(buf, size, _("%s %s"), buf2, _("(PC/Mobile)")); @@ -422,12 +418,9 @@ { char buf[64]; - printf("%s\n", __func__); - if (!buddy->proto_data) return g_strdup(_("Buddy not listed")); __status_text(buddy->proto_data, buf, sizeof(buf)); - printf("%s\n", buf); return g_strdup(buf); } |
|
From: xevuz <xe...@us...> - 2007-07-15 11:21:52
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv22951/src/lib Modified Files: chix.c chix_packet.c chix_status.c Log Message: aaahhhh\!\! type == 5 not 4\!\!\! Index: chix_status.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_status.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -d -r1.9 -r1.10 --- chix_status.c 15 Jul 2007 10:03:47 -0000 1.9 +++ chix_status.c 15 Jul 2007 11:21:35 -0000 1.10 @@ -21,7 +21,7 @@ #include "Chix.h" /* - * Login away status (when buddy list is retrieved} is indexed + * Login away status (when buddy list is retrieved) is indexed * 0-3. But when buddy changes away status, its indexed 0-5 with * 1 and 3 are ignored. 3 means the buddy's mood changed. * The member 'type' is what we send to the server and what we @@ -60,8 +60,7 @@ CHIX_INTERN int chix_status_away_set_extern(Chix_Status *stat, int away) { - if ((away > 3) || (away < 0)) - return -1; + if ((away > 3) || (away < 0)) return -1; stat->away = away; return _status_away[away].type; } @@ -69,8 +68,7 @@ CHIX_INTERN void chix_status_away_set_intern(Chix_Status *stat, int away) { - if ((away > 5) || (away < 0)) - return; + if ((away > 5) || (away < 0)) return; switch (away) { @@ -103,16 +101,15 @@ CHIX_INTERN int chix_status_away_get(Chix_Status *stat, char *buf, int size) { - if ((!buf) || (size < 15)) return stat->away; - printf("%i\n", stat->away); - snprintf(buf, size, "%s", _status_away[stat->away].string); + if ((buf) && (size > 15)) + snprintf(buf, size, "%s", _status_away[stat->away].string); return stat->away; } CHIX_INTERN int chix_status_mood_get(Chix_Status *stat, char *buf, int size) { - if ((!buf) || (size < 15)) return stat->mood; - snprintf(buf, size, "%s", _status_mood[stat->mood]); + if ((buf) && (size > 15)) + snprintf(buf, size, "%s", _status_mood[stat->mood]); return stat->mood; } Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.27 retrieving revision 1.28 diff -u -d -r1.27 -r1.28 --- chix.c 15 Jul 2007 10:03:47 -0000 1.27 +++ chix.c 15 Jul 2007 11:21:35 -0000 1.28 @@ -474,7 +474,7 @@ { /* The buddy's away status changed */ chix_status_away_set_intern(&bud->stat, type); - if (type == 4) bud->pc = 0; + if (type == 5) bud->pc = 0; } chix_event_set(cl, bud, EVENT_BUDDY_NOTIFY, 0, NULL); Index: chix_packet.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_packet.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- chix_packet.c 10 Jul 2007 16:46:26 -0000 1.17 +++ chix_packet.c 15 Jul 2007 11:21:35 -0000 1.18 @@ -254,7 +254,7 @@ if ((len < 11) || (str[0] != 0x02) || (str[pos] != 0x09)) { - printf("Packet seems to be smelly.\n"); + printf("Packet smells like a stale rat.\n"); printf("%s\n", str); return 0; } |
|
From: xevuz <xe...@us...> - 2007-07-15 10:32:25
|
Update of /cvsroot/chix/chix_gaim/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv5068/src Modified Files: chix_gaim.c Log Message: mood settings Index: chix_gaim.c =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/chix_gaim.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -d -r1.20 -r1.21 --- chix_gaim.c 15 Jul 2007 10:04:19 -0000 1.20 +++ chix_gaim.c 15 Jul 2007 10:32:19 -0000 1.21 @@ -52,6 +52,7 @@ typedef Chix_Event ChixEvent; typedef Chix_Mesg ChixMesg; typedef Chix_Mesg_Box ChixMesgBox; +typedef Chix_Mood_Type ChixMoodType; /**************************************************************************** * Event Handlers * @@ -912,14 +913,13 @@ /***************************************************************/ g_snprintf(buf, sizeof(buf), _("%s's Info"), - purple_connection_get_display_name(pc)); + purple_connection_get_display_name(pc)); g_snprintf(buf2, sizeof(buf2), - _("<b> Chix ID:</b>\t\t%s\n<b> Provider:</b>\t%s\n"), - info->id, info->provider); + _("Chix ID:\t\t%s\nProvider:\t%s\n"), info->id, info->provider); purple_request_fields(pc, _("Chix Info"), buf, buf2, fields, - _("Update"), G_CALLBACK(__info_update_cb), - _("Cancel"), NULL, NULL, NULL, NULL, pc->proto_data); + _("Update"), G_CALLBACK(__info_update_cb), + _("Cancel"), NULL, NULL, NULL, NULL, pc->proto_data); } static void @@ -936,14 +936,15 @@ PurpleRequestField *field; PurpleConn *pc; ChixClient *cl; + ChixMoodType mood; - pc = action->context; - cl = pc->proto_data; + pc = action->context; + cl = pc->proto_data; + mood = chix_client_mood_get(cl, NULL, 0); fields = purple_request_fields_new(); group = purple_request_field_group_new(_("Mood")); - field = purple_request_field_choice_new("mood", _(""), - chix_clientcl->info->mood); + field = purple_request_field_choice_new("mood", _(""), mood); purple_request_field_choice_add(field, _("Not in the mood")); purple_request_field_choice_add(field, _("Happy")); @@ -958,9 +959,9 @@ purple_request_field_group_add_field(group, field); purple_request_fields_add_group(fields, group); - purple_request_fields(pc, _("Chix Info"), buf, buf2, fields, + purple_request_fields(pc, _("Mood Settings"), NULL, NULL, fields, _("Update"), G_CALLBACK(__mood_update_cb), - _("Cancel"), NULL, NULL, NULL, NULL, pc->proto_data); + _("Cancel"), NULL, NULL, NULL, NULL, cl); } static GList * @@ -983,6 +984,8 @@ m = g_list_append(m, a); a = purple_plugin_action_new(_("Unblock Buddy"), unblock_buddy); m = g_list_append(m, a); + a = purple_plugin_action_new(_("Mood Settings"), cp_action_mood); + m = g_list_append(m, a); return m; } |
|
From: xevuz <xe...@us...> - 2007-07-15 10:30:37
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv4317/src/lib Modified Files: chix_buddy.c Log Message: and that one too Index: chix_buddy.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_buddy.c,v retrieving revision 1.22 retrieving revision 1.23 diff -u -d -r1.22 -r1.23 --- chix_buddy.c 12 Jul 2007 13:54:29 -0000 1.22 +++ chix_buddy.c 15 Jul 2007 10:30:33 -0000 1.23 @@ -608,7 +608,7 @@ if (away > MAX_AWAY) chix_status_away_set_extern(&bud->stat, AWAY_UNKNOWN); else - chix_status_away_set_intern(&bud->stat, away); + chix_status_away_set_extern(&bud->stat, away); } else bud->stat.away = AWAY_OFFLINE; bud->stat.mood = chix_packet_get_int(pkt, KEY_STATUS_MOOD); |
|
From: xevuz <xe...@us...> - 2007-07-15 10:04:23
|
Update of /cvsroot/chix/chix_gaim/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv27218/src Modified Files: chix_gaim.c Log Message: fix status once and for all. (i hope) Index: chix_gaim.c =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/chix_gaim.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -d -r1.19 -r1.20 --- chix_gaim.c 14 Jul 2007 02:53:25 -0000 1.19 +++ chix_gaim.c 15 Jul 2007 10:04:19 -0000 1.20 @@ -62,9 +62,9 @@ { char buf[16]; - if (chix_buddy_away_get(buddy, buf, sizeof(buf)) == AWAY_AWAY) + if (chix_buddy_away_get(buddy, NULL, 0) == AWAY_AWAY) purple_prpl_got_user_status(account, buddy->id, "away", NULL); - else if (chix_buddy_away_get(buddy, buf, sizeof(buf)) == AWAY_BUSY) + else if (chix_buddy_away_get(buddy, NULL, 0) == AWAY_BUSY) purple_prpl_got_user_status(account, buddy->id, "busy", NULL); else if (CHIX_BUDDY_ON_PC(buddy)) purple_prpl_got_user_status(account, buddy->id, "available", NULL); @@ -403,6 +403,8 @@ char buf2[16]; chix_buddy_away_get(buddy, buf2, sizeof(buf2)); + printf("%s\n", __func__); + printf("%s\n", buf2); if (CHIX_BUDDY_ON_BOTH(buddy)) g_snprintf(buf, size, _("%s %s"), buf2, _("(PC/Mobile)")); @@ -419,9 +421,12 @@ { char buf[64]; + printf("%s\n", __func__); + if (!buddy->proto_data) return g_strdup(_("Buddy not listed")); __status_text(buddy->proto_data, buf, sizeof(buf)); + printf("%s\n", buf); return g_strdup(buf); } @@ -639,24 +644,6 @@ break; } -/* - else if (!strcmp(state, _("Not in the mood"))) - chix_client_mood_set(client, MOOD_NONE); - else if (!strcmp(state, _("Happy"))) - chix_client_mood_set(client, MOOD_HAPPY); - else if (!strcmp(state, _("Sad"))) - chix_client_mood_set(client, MOOD_SAD); - else if (!strcmp(state, _("Secretive"))) - chix_client_mood_set(client, MOOD_SECRETIVE); - else if (!strcmp(state, _("Playful"))) - chix_client_mood_set(client, MOOD_PLAYFUL); - else if (!strcmp(state, _("Surprised"))) - chix_client_mood_set(client, MOOD_SURPRISED); - else if (!strcmp(state, _("Intimate"))) - chix_client_mood_set(client, MOOD_INTIMATE); - else if (!strcmp(state, _("Angry"))) - chix_client_mood_set(client, MOOD_ANGRY); -*/ } static void @@ -894,7 +881,7 @@ purple_request_field_group_add_field(g, f); f = purple_request_field_string_new( - "state", _("State"), info->state, FALSE); + "mood", _("State"), info->state, FALSE); purple_request_field_group_add_field(g, f); f = purple_request_field_string_new( @@ -935,6 +922,47 @@ _("Cancel"), NULL, NULL, NULL, NULL, pc->proto_data); } +static void +__mood_update_cb(ChixClient *client, PurpleRequestFields *fields) +{ + chix_client_mood_set(client, purple_request_fields_get_choice(fields, "mood")); +} + +static void +cp_action_mood(PurplePluginAction *action) +{ + PurpleRequestFields *fields; + PurpleRequestFieldGroup *group; + PurpleRequestField *field; + PurpleConn *pc; + ChixClient *cl; + + pc = action->context; + cl = pc->proto_data; + + fields = purple_request_fields_new(); + group = purple_request_field_group_new(_("Mood")); + field = purple_request_field_choice_new("mood", _(""), + chix_clientcl->info->mood); + + purple_request_field_choice_add(field, _("Not in the mood")); + purple_request_field_choice_add(field, _("Happy")); + purple_request_field_choice_add(field, _("Sad")); + purple_request_field_choice_add(field, _("Secretive")); + purple_request_field_choice_add(field, _("Playful")); + purple_request_field_choice_add(field, _("Surprised")); + purple_request_field_choice_add(field, _("Intimate")); + purple_request_field_choice_add(field, _("Angry")); + + purple_request_field_set_required(field, TRUE); + purple_request_field_group_add_field(group, field); + purple_request_fields_add_group(fields, group); + + purple_request_fields(pc, _("Chix Info"), buf, buf2, fields, + _("Update"), G_CALLBACK(__mood_update_cb), + _("Cancel"), NULL, NULL, NULL, NULL, pc->proto_data); +} + static GList * cp_actions(PurplePlugin *plugin, gpointer context) { |
|
From: xevuz <xe...@us...> - 2007-07-15 10:03:52
|
Update of /cvsroot/chix/chix In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26848 Modified Files: TODO Log Message: fix status once and for all. (i hope) Index: TODO =================================================================== RCS file: /cvsroot/chix/chix/TODO,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- TODO 25 Jul 2006 12:07:07 -0000 1.7 +++ TODO 15 Jul 2007 10:03:46 -0000 1.8 @@ -1,5 +1,4 @@ some missing or unfinished features =================================== - * online alert * MMS |
|
From: xevuz <xe...@us...> - 2007-07-15 10:03:52
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv26848/src/lib Modified Files: chix.c chix_client.c chix_status.c chix_status.h Log Message: fix status once and for all. (i hope) Index: chix_status.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_status.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- chix_status.c 12 Jul 2007 13:54:29 -0000 1.8 +++ chix_status.c 15 Jul 2007 10:03:47 -0000 1.9 @@ -57,29 +57,29 @@ * Chix Status Internal Routines * *****************************************************************************/ -CHIX_INTERN char * +CHIX_INTERN int chix_status_away_set_extern(Chix_Status *stat, int away) { if ((away > 3) || (away < 0)) - return NULL; - stat->away = _status_away[away].type; - return strdup(_status_away[away].string); + return -1; + stat->away = away; + return _status_away[away].type; } -CHIX_INTERN char * +CHIX_INTERN void chix_status_away_set_intern(Chix_Status *stat, int away) { if ((away > 5) || (away < 0)) - return NULL; + return; switch (away) { - case 0: - stat->away = AWAY_AWAY; - break; case 2: stat->away = AWAY_AVAILABLE; break; + case 0: + stat->away = AWAY_AWAY; + break; case 4: stat->away = AWAY_BUSY; break; @@ -87,10 +87,9 @@ stat->away = AWAY_OFFLINE; break; default: - /* 1 or 3 */ + stat->away = AWAY_UNKNOWN; break; } - return strdup(_status_away[stat->away].string); } CHIX_INTERN int @@ -105,6 +104,7 @@ chix_status_away_get(Chix_Status *stat, char *buf, int size) { if ((!buf) || (size < 15)) return stat->away; + printf("%i\n", stat->away); snprintf(buf, size, "%s", _status_away[stat->away].string); return stat->away; } Index: chix_status.h =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_status.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- chix_status.h 10 Jul 2007 16:46:26 -0000 1.6 +++ chix_status.h 15 Jul 2007 10:03:47 -0000 1.7 @@ -54,10 +54,10 @@ int mood; }; -CHIX_API char *chix_status_away_set_intern(Chix_Status *stat, int away); -CHIX_API char *chix_status_away_set_extern(Chix_Status *stat, int away); -CHIX_API int chix_status_mood_set (Chix_Status *stat, int mood); -CHIX_API int chix_status_away_get (Chix_Status *stat, char *buf, int size); -CHIX_API int chix_status_mood_get (Chix_Status *stat, char *buf, int size); +CHIX_API void chix_status_away_set_intern(Chix_Status *stat, int away); +CHIX_API int chix_status_away_set_extern(Chix_Status *stat, int away); +CHIX_API int chix_status_mood_set (Chix_Status *stat, int mood); +CHIX_API int chix_status_away_get (Chix_Status *stat, char *buf, int size); +CHIX_API int chix_status_mood_get (Chix_Status *stat, char *buf, int size); #endif Index: chix_client.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_client.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- chix_client.c 10 Jul 2007 16:46:25 -0000 1.8 +++ chix_client.c 15 Jul 2007 10:03:47 -0000 1.9 @@ -136,20 +136,20 @@ chix_client_away_set(Chix_Client *cl, Chix_Away_Type away) { Chix_Packet *pkt; - char *str; + char buf[16]; + int type; CHECK_TYPE(cl, CLIENT_TYPE, 0); - str = chix_status_away_set_extern(&cl->stat, away); - if (!str) return 0; + type = chix_status_away_set_extern(&cl->stat, away); + chix_status_away_get(&cl->stat, buf, sizeof(buf)); pkt = chix_packet_new(); if (!pkt) return 0; chix_packet_set_hdr(pkt, CODE_STATUS, __seqn(cl)); - chix_packet_set_int(pkt, KEY_CLIENT_STATUS, cl->stat.away); - chix_packet_set_str(pkt, KEY_STATUS_STRING, str); - free(str); + chix_packet_set_int(pkt, KEY_CLIENT_STATUS, type); + chix_packet_set_str(pkt, KEY_STATUS_STRING, buf); return chix_flush(cl, pkt); } Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.26 retrieving revision 1.27 diff -u -d -r1.26 -r1.27 --- chix.c 14 Jul 2007 02:46:40 -0000 1.26 +++ chix.c 15 Jul 2007 10:03:47 -0000 1.27 @@ -253,7 +253,7 @@ if (!chix_packet_read(pkt, buf->str.ptr, buf->str.len)) return 0; if (!__call(pkt->code, cl, pkt)) - return 0; + return 0; chix_packet_free(pkt); } while (__chix_buffer_string(buf)); @@ -408,7 +408,7 @@ Chix_Buddy *bud; Chix_Packet *ack; int num; - + num = chix_packet_get_int(pkt, KEY_BUDDY_NUMBER); bud = chix_blist_search_num(cl->blist, num); if (!bud) return 0; @@ -440,7 +440,7 @@ */ if (!bud->online) chix_status_away_set_extern(&bud->stat, AWAY_OFFLINE); - else + else if ((!bud->pc) && (bud->mb)) chix_status_away_set_extern(&bud->stat, AWAY_AVAILABLE); chix_event_set(cl, bud, EVENT_BUDDY_NOTIFY, pkt->seqn, NULL); @@ -472,8 +472,9 @@ } else { - /* The buddy's away status changed */ - free(chix_status_away_set_intern(&bud->stat, type)); + /* The buddy's away status changed */ + chix_status_away_set_intern(&bud->stat, type); + if (type == 4) bud->pc = 0; } chix_event_set(cl, bud, EVENT_BUDDY_NOTIFY, 0, NULL); |
|
From: xevuz <xe...@us...> - 2007-07-14 02:53:29
|
Update of /cvsroot/chix/chix_gaim/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv9703/src Modified Files: chix_gaim.c Log Message: various fixes. Index: chix_gaim.c =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/chix_gaim.c,v retrieving revision 1.18 retrieving revision 1.19 diff -u -d -r1.18 -r1.19 --- chix_gaim.c 12 Jul 2007 13:55:47 -0000 1.18 +++ chix_gaim.c 14 Jul 2007 02:53:25 -0000 1.19 @@ -193,9 +193,13 @@ ChixMesgBox *inbox = event->data; ChixNode *node; + /* TODO: still dont know how to represent this in pidgin. + * we can't put gui code in here. + */ for (node = inbox->head; node; node = node->next) { ChixMesg *mesg = (ChixMesg *)node; + printf("FROM: %s\n", mesg->buddy->alias); printf("MESG: %s\n", mesg->mesg); } chix_event_done(event); @@ -208,6 +212,8 @@ ChixMesgBox *outbox = event->data; ChixNode *node; + /* TODO: same as above */ + for (node = outbox->head; node; node = node->next) { ChixMesg *mesg = (ChixMesg *)node; @@ -303,21 +309,16 @@ for (node = clist->head; node; node = node->next) { ChixCredit *credit = (ChixCredit *)node; - GList *row = NULL; + GList *row = NULL; + char *provider; - row = g_list_append(row, _(credit->provider)); - row = g_list_append(row, _(credit->alloted)); - row = g_list_append(row, _(credit->used)); - row = g_list_append(row, _(credit->left)); - - /* - * purple_notify_searchresults() frees these pointers - * when we close the dialog box. quick fix for now. - */ - credit->provider = NULL; - credit->alloted = NULL; - credit->used = NULL; - credit->left = NULL; + provider = g_convert(credit->provider, -1, "UTF-8", + "ISO-8859-1", NULL, NULL, NULL); + + row = g_list_append(row, provider); + row = g_list_append(row, g_strdup(credit->alloted)); + row = g_list_append(row, g_strdup(credit->used)); + row = g_list_append(row, g_strdup(credit->left)); purple_notify_searchresults_row_add(results, row); } @@ -396,61 +397,57 @@ return NULL; } -static char * -__status_text(ChixBuddy *buddy) +static void +__status_text(ChixBuddy *buddy, char *buf, int size) { - char buf[16]; + char buf2[16]; - chix_buddy_away_get(buddy, buf, sizeof(buf)); + chix_buddy_away_get(buddy, buf2, sizeof(buf2)); if (CHIX_BUDDY_ON_BOTH(buddy)) - return g_strdup_printf(_("%s %s"), buf, _("(PC/Mobile)")); + g_snprintf(buf, size, _("%s %s"), buf2, _("(PC/Mobile)")); else if (CHIX_BUDDY_ON_PC(buddy)) - return g_strdup_printf(_("%s %s"), buf, _("(PC)")); + g_snprintf(buf, size, _("%s %s"), buf2, _("(PC)")); else if (CHIX_BUDDY_ON_MB(buddy)) - return g_strdup_printf(_("%s %s"), buf, _("(Mobile)")); + g_snprintf(buf, size, _("%s %s"), buf2, _("(Mobile)")); else - return g_strdup_printf(_("%s"), buf); + g_snprintf(buf, size, _("%s"), buf2); } static char * cp_status_text(PurpleBuddy *buddy) { - PurplePresence *pres; - PurpleStatus *stat; - - pres = purple_buddy_get_presence(buddy); - stat = purple_presence_get_active_status(pres); + char buf[64]; if (!buddy->proto_data) return g_strdup(_("Buddy not listed")); - return __status_text(buddy->proto_data); + __status_text(buddy->proto_data, buf, sizeof(buf)); + return g_strdup(buf); } static void cp_tooltip_text(PurpleBuddy *pb, PurpleNotifyUserInfo *ui, gboolean full) { - ChixBuddy *buddy; - char *stat; - char mood[16]; + ChixBuddy *buddy = pb->proto_data; + char stat[64]; + char mood[64]; - if (!pb->proto_data) + if (!buddy) { purple_notify_user_info_add_pair(ui, _("Status"), _("Buddy not listed")); return; } - buddy = pb->proto_data; - stat = __status_text(buddy); + __status_text(buddy, stat, sizeof(stat)); if (CHIX_BUDDY_ON_ANY(buddy)) - purple_notify_user_info_add_pair(ui, _("Status"), stat); + purple_notify_user_info_add_pair(ui, _("Status"), stat); chix_buddy_mood_get(buddy, mood, sizeof(mood)); - purple_notify_user_info_add_pair(ui, _("Mood"), mood); - purple_notify_user_info_add_pair(ui, _("Provider"), buddy->provider); + purple_notify_user_info_add_pair(ui, _("Mood"), mood); - free(stat); + /* is this important for other people? */ + purple_notify_user_info_add_pair(ui, _("Provider"), buddy->provider); } static GList * @@ -597,14 +594,10 @@ if (!buddy) return __unlisted(client, who, mesg); - if ((CHIX_BUDDY_ON_PC(buddy)) || (!strcmp(buddy->provider, "Chikka"))) { - printf("Sending to pc\n"); + if ((CHIX_BUDDY_ON_PC(buddy)) || (!strcmp(buddy->provider, "Chikka"))) return chix_send_mesg(client, buddy, mesg, MESG_TO_PC); - } - else { - printf("Sending to mb\n"); + else return chix_send_mesg(client, buddy, mesg, MESG_TO_MOBILE); - } } static void @@ -632,22 +625,17 @@ { case PURPLE_STATUS_AVAILABLE: chix_client_away_set(client, AWAY_AVAILABLE); - printf("available\n"); break; case PURPLE_STATUS_AWAY: chix_client_away_set(client, AWAY_AWAY); - printf("away\n"); break; case PURPLE_STATUS_UNAVAILABLE: chix_client_away_set(client, AWAY_BUSY); - printf("busy\n"); break; case PURPLE_STATUS_INVISIBLE: chix_client_away_set(client, AWAY_OFFLINE); - printf("invisible\n"); break; default: - printf("DEBUG: Unknown Chix status type\n"); break; } @@ -794,7 +782,6 @@ static void __info_update_cb(ChixClient *client, PurpleRequestFields *fields) { -#if 1 ChixInfo info; char buf[4]; @@ -819,13 +806,11 @@ info.options.forward = purple_request_fields_get_bool(fields, "forward"); chix_client_update_info(client, &info); -#endif } static void cp_action_info(PurplePluginAction *action) { -#if 1 PurpleRequestFields *fields; PurpleRequestFieldGroup *g; PurpleRequestField *f; @@ -835,10 +820,9 @@ char buf[64]; char buf2[64]; - pc = action->context; + pc = action->context; client = pc->proto_data; - info = client->info; - chix_info_print(info); + info = client->info; fields = purple_request_fields_new(); @@ -949,7 +933,6 @@ purple_request_fields(pc, _("Chix Info"), buf, buf2, fields, _("Update"), G_CALLBACK(__info_update_cb), _("Cancel"), NULL, NULL, NULL, NULL, pc->proto_data); -#endif } static GList * |
|
From: xevuz <xe...@us...> - 2007-07-14 02:46:44
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv7115/src/lib Modified Files: chix.c chix_mesg.c Log Message: various fixes. Index: chix_mesg.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_mesg.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- chix_mesg.c 12 Jul 2007 13:54:29 -0000 1.15 +++ chix_mesg.c 14 Jul 2007 02:46:40 -0000 1.16 @@ -142,16 +142,20 @@ { Chix_Mesg_Box *box; Chix_Mesg *msg; + Chix_Buddy *bud; char *id; + id = chix_packet_get_ptr(pkt, KEY_MESG_FROM); + bud = chix_blist_search(cl->blist, id); + if (!bud) return 1; + box = chix_event_data_get(cl, pkt->seqn); if (!box) return 0; msg = calloc(1, sizeof(Chix_Mesg)); if (!msg) return 0; - id = chix_packet_get_ptr(pkt, KEY_MESG_FROM); - msg->buddy = chix_blist_search(cl->blist, id); + msg->buddy = bud; msg->mesg = chix_packet_get_str(pkt, KEY_MESG); msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); @@ -165,7 +169,12 @@ { Chix_Mesg_Box *box; Chix_Mesg *msg; + Chix_Buddy *bud; char *id; + + id = chix_packet_get_ptr(pkt, KEY_MESG_TO); + bud = chix_blist_search(cl->blist, id); + if (!bud) return 1; box = chix_event_data_get(cl, pkt->seqn); if (!box) return 0; @@ -173,8 +182,7 @@ msg = calloc(1, sizeof(Chix_Mesg)); if (!msg) return 0; - id = chix_packet_get_ptr(pkt, KEY_MESG_TO); - msg->buddy = chix_blist_search(cl->blist, id); + msg->buddy = bud; msg->mesg = chix_packet_get_str(pkt, KEY_MESG); msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.25 retrieving revision 1.26 diff -u -d -r1.25 -r1.26 --- chix.c 12 Jul 2007 13:54:29 -0000 1.25 +++ chix.c 14 Jul 2007 02:46:40 -0000 1.26 @@ -315,8 +315,6 @@ { Chix_Packet *pkt; - printf("LOGIN_ACK\n"); - if (cl->login.type != 2) return 1; @@ -461,7 +459,7 @@ int num, type; /* This get's called when the buddy changes status. */ - + num = chix_packet_get_int(pkt, KEY_BUDDY_NUMBER); bud = chix_blist_search_num(cl->blist, num); type = chix_packet_get_int(pkt, KEY_STATUS_TYPE); |
|
From: xevuz <xe...@us...> - 2007-07-12 13:55:53
|
Update of /cvsroot/chix/chix_gaim/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11761/src Modified Files: chix_gaim.c Log Message: status fix Index: chix_gaim.c =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/chix_gaim.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -d -r1.17 -r1.18 --- chix_gaim.c 10 Jul 2007 16:48:45 -0000 1.17 +++ chix_gaim.c 12 Jul 2007 13:55:47 -0000 1.18 @@ -51,6 +51,7 @@ typedef Chix_Credit_List ChixCreditList; typedef Chix_Event ChixEvent; typedef Chix_Mesg ChixMesg; +typedef Chix_Mesg_Box ChixMesgBox; /**************************************************************************** * Event Handlers * @@ -65,12 +66,10 @@ purple_prpl_got_user_status(account, buddy->id, "away", NULL); else if (chix_buddy_away_get(buddy, buf, sizeof(buf)) == AWAY_BUSY) purple_prpl_got_user_status(account, buddy->id, "busy", NULL); - else if (CHIX_BUDDY_ON_BOTH(buddy)) - purple_prpl_got_user_status(account, buddy->id, "mobile", NULL); - else if (CHIX_BUDDY_ON_MB(buddy)) - purple_prpl_got_user_status_deactive(account, buddy->id, "mobile"); else if (CHIX_BUDDY_ON_PC(buddy)) purple_prpl_got_user_status(account, buddy->id, "available", NULL); + else if (CHIX_BUDDY_ON_MB(buddy)) + purple_prpl_got_user_status(account, buddy->id, "mobile", NULL); else purple_prpl_got_user_status(account, buddy->id, "offline", NULL); } @@ -189,6 +188,37 @@ } static int +cp_event_inbox(ChixClient *client, ChixEvent *event) +{ + ChixMesgBox *inbox = event->data; + ChixNode *node; + + for (node = inbox->head; node; node = node->next) + { + ChixMesg *mesg = (ChixMesg *)node; + printf("MESG: %s\n", mesg->mesg); + } + chix_event_done(event); + return 1; +} + +static int +cp_event_outbox(ChixClient *client, ChixEvent *event) +{ + ChixMesgBox *outbox = event->data; + ChixNode *node; + + for (node = outbox->head; node; node = node->next) + { + ChixMesg *mesg = (ChixMesg *)node; + printf("SENT TO: %s\n", mesg->buddy->alias); + printf("MESG: %s\n", mesg->mesg); + } + chix_event_done(event); + return 1; +} + +static int cp_event_buddy_notify(ChixClient *client, ChixEvent *event) { ChixBuddy *buddy = event->data; @@ -230,7 +260,6 @@ else g_snprintf(buf, sizeof(buf), _("Unspecified")); - pinfo = purple_notify_user_info_new(); purple_notify_user_info_add_pair(pinfo, _("Chix ID"), info->id); purple_notify_user_info_add_pair(pinfo, _("Provider"), info->provider); @@ -271,7 +300,6 @@ purple_notify_searchresults_column_add(results, column); clist = event->data; -// chix_clist_print(clist); for (node = clist->head; node; node = node->next) { ChixCredit *credit = (ChixCredit *)node; @@ -294,7 +322,7 @@ purple_notify_searchresults_row_add(results, row); } purple_notify_searchresults(client->user_data, _("Available Credits"), - NULL, NULL, results, NULL, NULL); + NULL, NULL, results, NULL, NULL); chix_event_done(event); return 1; @@ -1015,10 +1043,9 @@ chix_event_handler_set(EVENT_CREDIT_LIST, cp_event_credits); /* chix_event_handler_set(EVENT_SEARCH_RESULT, cp_event_search_result);*/ chix_event_handler_set(EVENT_MESG, cp_event_mesg); -/* chix_event_handler_set(EVENT_INBOX, cp_event_inbox); chix_event_handler_set(EVENT_OUTBOX, cp_event_outbox); -*/ + chix_event_handler_set(EVENT_SYS_MESG, cp_event_sys_mesg); chix_event_handler_set(EVENT_SYS_ERROR, cp_event_sys_error); |
|
From: xevuz <xe...@us...> - 2007-07-12 13:54:33
|
Update of /cvsroot/chix/chix/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11276/src Modified Files: Chix.h Log Message: status/away fixes that introduces more bugs :) Index: Chix.h =================================================================== RCS file: /cvsroot/chix/chix/src/Chix.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- Chix.h 10 Jul 2007 16:46:25 -0000 1.6 +++ Chix.h 12 Jul 2007 13:54:29 -0000 1.7 @@ -83,6 +83,7 @@ AWAY_AWAY, AWAY_BUSY, AWAY_OFFLINE, + AWAY_UNKNOWN, }; enum _Chix_Mood_Type |
|
From: xevuz <xe...@us...> - 2007-07-12 13:54:33
|
Update of /cvsroot/chix/chix/debian In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11276/debian Modified Files: changelog Log Message: status/away fixes that introduces more bugs :) Index: changelog =================================================================== RCS file: /cvsroot/chix/chix/debian/changelog,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- changelog 10 Jun 2005 16:39:30 -0000 1.1 +++ changelog 12 Jul 2007 13:54:26 -0000 1.2 @@ -1,4 +1,4 @@ -chix (1.0.0-1) unstable; urgency=low +chix (1.1.99-1) unstable; urgency=low * CVS release. |
|
From: xevuz <xe...@us...> - 2007-07-12 13:54:33
|
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv11276/src/lib Modified Files: chix.c chix_buddy.c chix_mesg.c chix_mesg.h chix_status.c Log Message: status/away fixes that introduces more bugs :) Index: chix_status.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_status.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- chix_status.c 10 Jul 2007 16:46:26 -0000 1.7 +++ chix_status.c 12 Jul 2007 13:54:29 -0000 1.8 @@ -38,6 +38,7 @@ {"Away", 0}, {"Busy", 4}, {"Offline", 5}, + {"Unknown", -1}, }; static const char *_status_mood[] = Index: chix_mesg.h =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_mesg.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -r1.8 -r1.9 --- chix_mesg.h 25 Jul 2006 12:07:07 -0000 1.8 +++ chix_mesg.h 12 Jul 2007 13:54:29 -0000 1.9 @@ -61,6 +61,6 @@ int chix_mesg_instant (Chix_Client *cl, Chix_Packet *pkt); int chix_mesg_inbox (Chix_Client *cl, Chix_Packet *pkt); int chix_mesg_outbox (Chix_Client *cl, Chix_Packet *pkt); -int chix_mesg_box_new (Chix_Client *cl, Chix_Packet *pkt); +int chix_mesg_box_new (Chix_Client *cl, Chix_Packet *pkt, int type); #endif Index: chix_buddy.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_buddy.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -d -r1.21 -r1.22 --- chix_buddy.c 25 Jul 2006 12:07:07 -0000 1.21 +++ chix_buddy.c 12 Jul 2007 13:54:29 -0000 1.22 @@ -424,8 +424,6 @@ { Chix_Buddy *bud; - printf("blist_client()..........\n"); - bud = _chix_buddy_new(pkt); if (!bud) return 0; @@ -606,8 +604,11 @@ if (bud->online) { - bud->stat.away = chix_packet_get_int(pkt, KEY_STATUS_AWAY); - if (bud->stat.away > MAX_AWAY) return NULL; + int away = chix_packet_get_int(pkt, KEY_STATUS_AWAY); + if (away > MAX_AWAY) + chix_status_away_set_extern(&bud->stat, AWAY_UNKNOWN); + else + chix_status_away_set_intern(&bud->stat, away); } else bud->stat.away = AWAY_OFFLINE; bud->stat.mood = chix_packet_get_int(pkt, KEY_STATUS_MOOD); Index: chix_mesg.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_mesg.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -d -r1.14 -r1.15 --- chix_mesg.c 10 Jul 2007 16:46:26 -0000 1.14 +++ chix_mesg.c 12 Jul 2007 13:54:29 -0000 1.15 @@ -133,12 +133,6 @@ msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); - printf("DEBUG: MESSAGE RECIEVED\n"); - printf("Time: %s\n", ctime(&msg->time)); - printf("From: %s\n", msg->buddy->alias); - printf("Mesg: %s\n", msg->mesg); - - chix_event_set(cl, msg, EVENT_MESG, 0,CHIX_FUNC_FREE(_chix_mesg_free)); return _chix_mesg_ack(cl, pkt); } @@ -153,7 +147,7 @@ box = chix_event_data_get(cl, pkt->seqn); if (!box) return 0; - msg = malloc(sizeof(Chix_Mesg)); + msg = calloc(1, sizeof(Chix_Mesg)); if (!msg) return 0; id = chix_packet_get_ptr(pkt, KEY_MESG_FROM); @@ -176,7 +170,7 @@ box = chix_event_data_get(cl, pkt->seqn); if (!box) return 0; - msg = malloc(sizeof(Chix_Mesg)); + msg = calloc(1, sizeof(Chix_Mesg)); if (!msg) return 0; id = chix_packet_get_ptr(pkt, KEY_MESG_TO); @@ -190,19 +184,23 @@ } CHIX_INTERN int -chix_mesg_box_new(Chix_Client *cl, Chix_Packet *pkt) +chix_mesg_box_new(Chix_Client *cl, Chix_Packet *pkt, int type) { Chix_Mesg_Box *box; Chix_Event *ev; - int type; + int ev_type; box = calloc(1, sizeof(Chix_Mesg_Box)); if (!box) return 0; SET_TYPE(box, MESG_BOX_TYPE); - type = chix_packet_get_int(pkt, KEY_LIST_TYPE); - ev = chix_event_set(cl, box, type, pkt->seqn, - CHIX_FUNC_FREE(_chix_mesg_box_free)); + if (type == VAL_INBOX) + ev_type = EVENT_INBOX; + else + ev_type = EVENT_OUTBOX; + + ev = chix_event_set(cl, box, ev_type, pkt->seqn, + CHIX_FUNC_FREE(_chix_mesg_box_free)); if (!ev) return 0; chix_event_freeze(ev); return 1; Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -d -r1.24 -r1.25 --- chix.c 10 Jul 2007 16:46:25 -0000 1.24 +++ chix.c 12 Jul 2007 13:54:29 -0000 1.25 @@ -379,8 +379,8 @@ switch (chix_packet_get_int(pkt, KEY_LIST_TYPE)) { case VAL_BLIST: return chix_blist_new(cl, pkt); - case VAL_INBOX: return chix_mesg_box_new(cl, pkt); - case VAL_OUTBOX: return chix_mesg_box_new(cl, pkt); + case VAL_INBOX: return chix_mesg_box_new(cl, pkt, VAL_INBOX); + case VAL_OUTBOX: return chix_mesg_box_new(cl, pkt, VAL_OUTBOX); case VAL_SEARCH: return chix_info_result_new(cl, pkt); case VAL_CREDITS: return chix_clist_new(cl, pkt); default: break; @@ -440,8 +440,10 @@ * mobile phones? I dont think so. So we'll set either * Available or Offline here. */ - if (!bud->online) bud->stat.away = AWAY_OFFLINE; - else bud->stat.away = AWAY_AVAILABLE; + if (!bud->online) + chix_status_away_set_extern(&bud->stat, AWAY_OFFLINE); + else + chix_status_away_set_extern(&bud->stat, AWAY_AVAILABLE); chix_event_set(cl, bud, EVENT_BUDDY_NOTIFY, pkt->seqn, NULL); @@ -460,8 +462,8 @@ /* This get's called when the buddy changes status. */ - num = chix_packet_get_int(pkt, KEY_BUDDY_NUMBER); - bud = chix_blist_search_num(cl->blist, num); + num = chix_packet_get_int(pkt, KEY_BUDDY_NUMBER); + bud = chix_blist_search_num(cl->blist, num); type = chix_packet_get_int(pkt, KEY_STATUS_TYPE); if (type == VAL_STATUS_MOOD) |
Update of /cvsroot/chix/chix/src/lib In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31130/src/lib Modified Files: chix.c chix_buddy.h chix_client.c chix_credit.c chix_mesg.c chix_packet.c chix_status.c chix_status.h Log Message: status setting should work properly now Index: chix_credit.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_credit.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- chix_credit.c 25 Jul 2006 12:07:07 -0000 1.7 +++ chix_credit.c 10 Jul 2007 16:46:25 -0000 1.8 @@ -115,10 +115,14 @@ _chix_credit_free(Chix_Credit *cr) { CHECK_TYPE(cr, CREDIT_TYPE,); - if (cr->provider) free(cr->provider); - if (cr->alloted) free(cr->alloted); - if (cr->used) free(cr->used); - if (cr->left) free(cr->left); + if (cr->provider) + free(cr->provider); + if (cr->alloted) + free(cr->alloted); + if (cr->used) + free(cr->used); + if (cr->left) + free(cr->left); free(cr); } Index: chix_buddy.h =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_buddy.h,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- chix_buddy.h 25 Jul 2006 12:07:07 -0000 1.12 +++ chix_buddy.h 10 Jul 2007 16:46:25 -0000 1.13 @@ -41,8 +41,8 @@ union { struct { - int mb : 8; int pc : 8; + int mb : 8; }; int online; }; Index: chix_status.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_status.c,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- chix_status.c 25 Jul 2006 12:07:07 -0000 1.6 +++ chix_status.c 10 Jul 2007 16:46:26 -0000 1.7 @@ -57,19 +57,38 @@ *****************************************************************************/ CHIX_INTERN char * -chix_status_away_set(Chix_Status *stat, int away) +chix_status_away_set_extern(Chix_Status *stat, int away) { - if ((away > 5) || (away < 0)) + if ((away > 3) || (away < 0)) return NULL; - if (away == _status_away[0].type) - stat->away = AWAY_AVAILABLE; - else if (away == _status_away[1].type) - stat->away = AWAY_AWAY; - else if (away == _status_away[2].type) - stat->away = AWAY_BUSY; - else if (away == _status_away[3].type) - stat->away = AWAY_OFFLINE; - else return NULL; + stat->away = _status_away[away].type; + return strdup(_status_away[away].string); +} + +CHIX_INTERN char * +chix_status_away_set_intern(Chix_Status *stat, int away) +{ + if ((away > 5) || (away < 0)) + return NULL; + + switch (away) + { + case 0: + stat->away = AWAY_AWAY; + break; + case 2: + stat->away = AWAY_AVAILABLE; + break; + case 4: + stat->away = AWAY_BUSY; + break; + case 5: + stat->away = AWAY_OFFLINE; + break; + default: + /* 1 or 3 */ + break; + } return strdup(_status_away[stat->away].string); } Index: chix_status.h =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_status.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- chix_status.h 25 Jul 2006 12:07:07 -0000 1.5 +++ chix_status.h 10 Jul 2007 16:46:26 -0000 1.6 @@ -54,7 +54,8 @@ int mood; }; -CHIX_API char *chix_status_away_set (Chix_Status *stat, int away); +CHIX_API char *chix_status_away_set_intern(Chix_Status *stat, int away); +CHIX_API char *chix_status_away_set_extern(Chix_Status *stat, int away); CHIX_API int chix_status_mood_set (Chix_Status *stat, int mood); CHIX_API int chix_status_away_get (Chix_Status *stat, char *buf, int size); CHIX_API int chix_status_mood_get (Chix_Status *stat, char *buf, int size); Index: chix_client.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_client.c,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- chix_client.c 25 Jul 2006 12:07:07 -0000 1.7 +++ chix_client.c 10 Jul 2007 16:46:25 -0000 1.8 @@ -140,14 +140,14 @@ CHECK_TYPE(cl, CLIENT_TYPE, 0); - str = chix_status_away_set(&cl->stat, away); + str = chix_status_away_set_extern(&cl->stat, away); if (!str) return 0; pkt = chix_packet_new(); if (!pkt) return 0; chix_packet_set_hdr(pkt, CODE_STATUS, __seqn(cl)); - chix_packet_set_int(pkt, KEY_CLIENT_STATUS, away); + chix_packet_set_int(pkt, KEY_CLIENT_STATUS, cl->stat.away); chix_packet_set_str(pkt, KEY_STATUS_STRING, str); free(str); Index: chix_mesg.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_mesg.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -d -r1.13 -r1.14 --- chix_mesg.c 25 Jul 2006 12:07:07 -0000 1.13 +++ chix_mesg.c 10 Jul 2007 16:46:26 -0000 1.14 @@ -133,7 +133,13 @@ msg->time = _chix_mesg_time(chix_packet_get_ptr(pkt, KEY_MESG_TIME)); SET_TYPE(msg, MESG_TYPE); - chix_event_set(cl, msg, EVENT_MESG, 0,CHIX_FUNC_FREE(_chix_mesg_free)); + printf("DEBUG: MESSAGE RECIEVED\n"); + printf("Time: %s\n", ctime(&msg->time)); + printf("From: %s\n", msg->buddy->alias); + printf("Mesg: %s\n", msg->mesg); + + + chix_event_set(cl, msg, EVENT_MESG, 0,CHIX_FUNC_FREE(_chix_mesg_free)); return _chix_mesg_ack(cl, pkt); } Index: chix.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -d -r1.23 -r1.24 --- chix.c 26 Jul 2006 12:15:33 -0000 1.23 +++ chix.c 10 Jul 2007 16:46:25 -0000 1.24 @@ -456,15 +456,15 @@ { Chix_Buddy *bud; Chix_Packet *ack; - int num, away; + int num, type; /* This get's called when the buddy changes status. */ num = chix_packet_get_int(pkt, KEY_BUDDY_NUMBER); bud = chix_blist_search_num(cl->blist, num); - away = chix_packet_get_int(pkt, KEY_STATUS_AWAY); + type = chix_packet_get_int(pkt, KEY_STATUS_TYPE); - if (away == VAL_STATUS_MOOD) + if (type == VAL_STATUS_MOOD) { /* The buddy's mood status changed. */ int mood = chix_packet_get_int(pkt, KEY_STATUS_MOODTYPE); @@ -473,7 +473,7 @@ else { /* The buddy's away status changed */ - free(chix_status_away_set(&bud->stat, away)); + free(chix_status_away_set_intern(&bud->stat, type)); } chix_event_set(cl, bud, EVENT_BUDDY_NOTIFY, 0, NULL); Index: chix_packet.c =================================================================== RCS file: /cvsroot/chix/chix/src/lib/chix_packet.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- chix_packet.c 25 Jul 2006 12:07:07 -0000 1.16 +++ chix_packet.c 10 Jul 2007 16:46:26 -0000 1.17 @@ -46,31 +46,31 @@ for (pos = 8; str[pos + 2] != 0x03; pos++) { - int key = 0; - int end; - - if (str[pos + 3] == 0x3a) - { - key = __parse(str, pos, 3, 10, &err); - if ((err) || (key > 63) || (key < 0)) return 0; - pkt->keys[pkt->cnt++] = key; - pos += 4; + int key = 0; + int end; - end = __find(str, 0x09, pos); - if (end < 0) return 0; - pkt->data[key] = __substr(str, pos, end - pos); - if (!pkt->data[key]) return 0; - pos = end; - } - else - { - if (!pkt->cnt) return 0; - key = pkt->keys[pkt->cnt - 1]; - end = __find(str, 0x09, pos); - pkt->data[key] = __append(pkt->data[key], str, pos - 1, (end + 1) - pos); - if (!pkt->data[key]) return 0; - pos = end; - } + if (str[pos + 3] == 0x3a) + { + key = __parse(str, pos, 3, 10, &err); + if ((err) || (key > 63) || (key < 0)) return 0; + pkt->keys[pkt->cnt++] = key; + pos += 4; + + end = __find(str, 0x09, pos); + if (end < 0) return 0; + pkt->data[key] = __substr(str, pos, end - pos); + if (!pkt->data[key]) return 0; + pos = end; + } + else + { + if (!pkt->cnt) return 0; + key = pkt->keys[pkt->cnt - 1]; + end = __find(str, 0x09, pos); + pkt->data[key] = __append(pkt->data[key], str, pos - 1, (end + 1) - pos); + if (!pkt->data[key]) return 0; + pos = end; + } } return 1; @@ -86,9 +86,7 @@ len = snprintf(buf, sizeof(buf), "\002%02i:%03i\t", pkt->code, pkt->seqn); for (key = pkt->keys; *key; key++) - len += snprintf(buf + len, sizeof(buf) - len, "%03i:%s\t", - *key, pkt->data[*key]); - + len += snprintf(buf + len, sizeof(buf) - len, "%03i:%s\t", *key, pkt->data[*key]); len += snprintf(buf + len, sizeof(buf) - len, "%02X\003", __checksum(buf, len)); *out_str = strdup(buf); @@ -151,17 +149,17 @@ fprintf(stdout, "\n:: %s ::", str); fprintf(stdout, "\n ============================" - "\n | Code: %02i" - "\n | Sequence: %03i" - "\n ============================\n", - pkt->code, pkt->seqn); + "\n | Code: %02i" + "\n | Sequence: %03i" + "\n ============================\n", + pkt->code, pkt->seqn); for (key = pkt->keys; *key; key++) { - fprintf(stdout, " | Key: %03i\n" - " | Val: %s\n" - " |----------------------------\n", - *key, pkt->data[*key]); + fprintf(stdout, " | Key: %03i\n" + " | Val: %s\n" + " |----------------------------\n", + *key, pkt->data[*key]); } } @@ -192,7 +190,7 @@ return strchr(str + offset, c) - str; } -static inline int +static inline int __parse(const char *str, int offset, int len, int base, int *err) { char *eptr; @@ -201,8 +199,8 @@ if ((eptr - ptr) != len) { - *err = 1; - return 0; + *err = 1; + return 0; } *err = 0; @@ -232,10 +230,10 @@ while ((ptr = strchr(ptr + 1, 0x09))) { - if ((ptr + 4) > (str + len)) - break; - if ((ptr[4] == 0x3a)) - *ptr = ' '; + if ((ptr + 4) > (str + len)) + break; + if ((ptr[4] == 0x3a)) + *ptr = ' '; } } @@ -256,19 +254,19 @@ if ((len < 11) || (str[0] != 0x02) || (str[pos] != 0x09)) { - printf("Packet seems to be smelly.\n"); - printf("%s\n", str); - return 0; + printf("Packet seems to be smelly.\n"); + printf("%s\n", str); + return 0; } if ((__checksum(str, pos + 1) != __parse(str, pos + 1, 2, 16, &err)) || (err)) { - printf("Checksum failed.\n"); - return 0; + printf("Checksum failed.\n"); + return 0; } if ((str[3] != 0x3a) || (str[7] != 0x09)) { - printf("Bad header.\n"); - return 0; + printf("Bad header.\n"); + return 0; } return 1; } |
|
From: xevuz <xe...@us...> - 2007-07-10 16:49:05
|
Update of /cvsroot/chix/chix_gaim/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv32070/src Modified Files: chix_gaim.c Log Message: status setting should work properly now. still confused how purple handles status. i think status types gets overwritten by other protocols. Index: chix_gaim.c =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/chix_gaim.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -d -r1.16 -r1.17 --- chix_gaim.c 5 Jul 2007 15:13:03 -0000 1.16 +++ chix_gaim.c 10 Jul 2007 16:48:45 -0000 1.17 @@ -61,9 +61,18 @@ { char buf[16]; - if (!buddy->online) return; - chix_buddy_away_get(buddy, buf, sizeof(buf)); - purple_prpl_got_user_status(account, buddy->id, buf, NULL); + if (chix_buddy_away_get(buddy, buf, sizeof(buf)) == AWAY_AWAY) + purple_prpl_got_user_status(account, buddy->id, "away", NULL); + else if (chix_buddy_away_get(buddy, buf, sizeof(buf)) == AWAY_BUSY) + purple_prpl_got_user_status(account, buddy->id, "busy", NULL); + else if (CHIX_BUDDY_ON_BOTH(buddy)) + purple_prpl_got_user_status(account, buddy->id, "mobile", NULL); + else if (CHIX_BUDDY_ON_MB(buddy)) + purple_prpl_got_user_status_deactive(account, buddy->id, "mobile"); + else if (CHIX_BUDDY_ON_PC(buddy)) + purple_prpl_got_user_status(account, buddy->id, "available", NULL); + else + purple_prpl_got_user_status(account, buddy->id, "offline", NULL); } static int @@ -347,27 +356,16 @@ return "chix"; } -static void -cp_list_emblems(PurpleBuddy *pb, const char **se, const char **sw, - const char **nw, const char **ne) +static const char * +cp_list_emblem(PurpleBuddy *pb) { ChixBuddy *buddy = pb->proto_data; if (!buddy) - *se = "notauthorized"; - else if (buddy->online) - { - int away = chix_buddy_away_get(buddy, NULL, 0); - - if (away == AWAY_AWAY) - *ne = "away"; - else if (away == AWAY_BUSY) - *ne = "unavailable"; - - if (CHIX_BUDDY_ON_MB(buddy)) - *nw = "wireless"; - } - else *se = "offline"; + return "notauthorized"; + if (CHIX_BUDDY_ON_MB(buddy)) + return "mobile"; + return NULL; } static char * @@ -433,23 +431,18 @@ GList *types = NULL; types = g_list_append(types, purple_status_type_new( - PURPLE_STATUS_AVAILABLE, "Available", _("Available"), TRUE)); + PURPLE_STATUS_AVAILABLE, "available", _("Available"), TRUE)); types = g_list_append(types, purple_status_type_new( - PURPLE_STATUS_AWAY, "Away", _("Away"), TRUE)); + PURPLE_STATUS_AWAY, "away", _("Away"), TRUE)); types = g_list_append(types, purple_status_type_new( - PURPLE_STATUS_UNAVAILABLE, "Busy", _("Busy"), TRUE)); + PURPLE_STATUS_UNAVAILABLE, "busy", _("Busy"), TRUE)); types = g_list_append(types, purple_status_type_new( - PURPLE_STATUS_INVISIBLE, "Offline", _("Appear Idle"), TRUE)); -/* - m = g_list_append(m, _("Not in the mood")); - m = g_list_append(m, _("Happy")); - m = g_list_append(m, _("Sad")); - m = g_list_append(m, _("Secretive")); - m = g_list_append(m, _("Playful")); - m = g_list_append(m, _("Surprised")); - m = g_list_append(m, _("Intimate")); - m = g_list_append(m, _("Angry")); -*/ + PURPLE_STATUS_INVISIBLE, "invisible", _("Appear Idle"), TRUE)); + types = g_list_append(types, purple_status_type_new( + PURPLE_STATUS_OFFLINE, "offline", NULL, FALSE)); + types = g_list_append(types, purple_status_type_new( + PURPLE_STATUS_MOBILE, "mobile", NULL, FALSE)); + return types; } @@ -576,10 +569,14 @@ if (!buddy) return __unlisted(client, who, mesg); - if ((CHIX_BUDDY_ON_PC(buddy)) || (!strcmp(buddy->provider, "Chikka"))) + if ((CHIX_BUDDY_ON_PC(buddy)) || (!strcmp(buddy->provider, "Chikka"))) { + printf("Sending to pc\n"); return chix_send_mesg(client, buddy, mesg, MESG_TO_PC); - else + } + else { + printf("Sending to mb\n"); return chix_send_mesg(client, buddy, mesg, MESG_TO_MOBILE); + } } static void @@ -607,16 +604,23 @@ { case PURPLE_STATUS_AVAILABLE: chix_client_away_set(client, AWAY_AVAILABLE); + printf("available\n"); break; case PURPLE_STATUS_AWAY: chix_client_away_set(client, AWAY_AWAY); + printf("away\n"); break; case PURPLE_STATUS_UNAVAILABLE: chix_client_away_set(client, AWAY_BUSY); + printf("busy\n"); break; - case PURPLE_STATUS_OFFLINE: + case PURPLE_STATUS_INVISIBLE: chix_client_away_set(client, AWAY_OFFLINE); + printf("invisible\n"); break; + default: + printf("DEBUG: Unknown Chix status type\n"); + break; } /* @@ -760,9 +764,9 @@ } static void -__action_info_cb(ChixClient *client, PurpleRequestFields *fields) +__info_update_cb(ChixClient *client, PurpleRequestFields *fields) { -#if 0 +#if 1 ChixInfo info; char buf[4]; @@ -793,7 +797,7 @@ static void cp_action_info(PurplePluginAction *action) { -#if 0 +#if 1 PurpleRequestFields *fields; PurpleRequestFieldGroup *g; PurpleRequestField *f; @@ -816,25 +820,30 @@ g = purple_request_field_group_new(_(" Personal")); purple_request_fields_add_group(fields, g); - f = purple_request_field_string_new("first", _("First Name"), info->first, FALSE); + f = purple_request_field_string_new( + "first", _("First Name"), info->first, FALSE); purple_request_field_set_required(f, TRUE); purple_request_field_group_add_field(g, f); - f = purple_request_field_string_new("last", _("Last Name"), info->last, FALSE); + f = purple_request_field_string_new( + "last", _("Last Name"), info->last, FALSE); purple_request_field_set_required(f, TRUE); purple_request_field_group_add_field(g, f); - f = purple_request_field_string_new("age", _("Age"), info->age, FALSE); + f = purple_request_field_string_new( + "age", _("Age"), info->age, FALSE); purple_request_field_group_add_field(g, f); - f = purple_request_field_choice_new("gender", _("Gender"), atoi(info->gender)); + f = purple_request_field_choice_new( + "gender", _("Gender"), atoi(info->gender)); purple_request_field_choice_add(f, _("Female")); purple_request_field_choice_add(f, _("Male")); purple_request_field_choice_add(f, _("Not Disclosed")); purple_request_field_set_required(f, TRUE); purple_request_field_group_add_field(g, f); - f = purple_request_field_string_new("extra", _("User Message"), info->extra, TRUE); + f = purple_request_field_string_new( + "extra", _("User Message"), info->extra, TRUE); purple_request_field_group_add_field(g, f); @@ -844,14 +853,17 @@ g = purple_request_field_group_new(_(" Contact")); purple_request_fields_add_group(fields, g); - f = purple_request_field_string_new("email", _("Email"), info->email, FALSE); + f = purple_request_field_string_new( + "email", _("Email"), info->email, FALSE); purple_request_field_set_required(f, TRUE); purple_request_field_group_add_field(g, f); - f = purple_request_field_string_new("phone", _("Phone"), info->phone, FALSE); + f = purple_request_field_string_new( + "phone", _("Phone"), info->phone, FALSE); purple_request_field_group_add_field(g, f); - f = purple_request_field_string_new("fax", _("Fax"), info->fax, FALSE); + f = purple_request_field_string_new( + "fax", _("Fax"), info->fax, FALSE); purple_request_field_group_add_field(g, f); @@ -861,16 +873,20 @@ g = purple_request_field_group_new(_(" Location")); purple_request_fields_add_group(fields, g); - f = purple_request_field_string_new("address", _("Address"), info->address, FALSE); + f = purple_request_field_string_new( + "address", _("Address"), info->address, FALSE); purple_request_field_group_add_field(g, f); - f = purple_request_field_string_new("city", _("City"), info->city, FALSE); + f = purple_request_field_string_new( + "city", _("City"), info->city, FALSE); purple_request_field_group_add_field(g, f); - f = purple_request_field_string_new("state", _("State"), info->state, FALSE); + f = purple_request_field_string_new( + "state", _("State"), info->state, FALSE); purple_request_field_group_add_field(g, f); - f = purple_request_field_string_new("country", _("Country"), info->country, FALSE); + f = purple_request_field_string_new( + "country", _("Country"), info->country, FALSE); purple_request_field_group_add_field(g, f); @@ -902,9 +918,9 @@ _("<b> Chix ID:</b>\t\t%s\n<b> Provider:</b>\t%s\n"), info->id, info->provider); - purple_request_fields(NULL, _("Chix Info"), buf, buf2, fields, - _("Update"), G_CALLBACK(__action_info_cb), - _("Cancel"), NULL, pc->proto_data); + purple_request_fields(pc, _("Chix Info"), buf, buf2, fields, + _("Update"), G_CALLBACK(__info_update_cb), + _("Cancel"), NULL, NULL, NULL, NULL, pc->proto_data); #endif } @@ -938,7 +954,7 @@ { .icon_spec = NO_BUDDY_ICONS, .list_icon = cp_list_icon, -// .list_emblems = cp_list_emblems, + .list_emblem = cp_list_emblem, .tooltip_text = cp_tooltip_text, .status_text = cp_status_text, .status_types = cp_status_types, |
|
From: xevuz <xe...@us...> - 2007-07-10 16:49:00
|
Update of /cvsroot/chix/chix/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv31130/src Modified Files: Chix.h Log Message: status setting should work properly now Index: Chix.h =================================================================== RCS file: /cvsroot/chix/chix/src/Chix.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Chix.h 25 Jul 2006 12:07:07 -0000 1.5 +++ Chix.h 10 Jul 2007 16:46:25 -0000 1.6 @@ -79,8 +79,8 @@ enum _Chix_Away_Type { - AWAY_AWAY, AWAY_AVAILABLE, + AWAY_AWAY, AWAY_BUSY, AWAY_OFFLINE, }; |
|
From: xevuz <xe...@us...> - 2007-07-05 15:13:10
|
Update of /cvsroot/chix/chix_gaim/data/32 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28686/data/32 Added Files: chix.png Log Message: fixes and pixmaps --- NEW FILE: chix.png --- (This appears to be a binary file; contents omitted.) |
|
From: xevuz <xe...@us...> - 2007-07-05 15:13:10
|
Update of /cvsroot/chix/chix_gaim/data/48 In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28686/data/48 Added Files: chix.png Log Message: fixes and pixmaps --- NEW FILE: chix.png --- (This appears to be a binary file; contents omitted.) |
|
From: xevuz <xe...@us...> - 2007-07-05 15:13:10
|
Update of /cvsroot/chix/chix_gaim/src In directory sc8-pr-cvs4.sourceforge.net:/tmp/cvs-serv28686/src Modified Files: Makefile.am chix_gaim.c Log Message: fixes and pixmaps Index: Makefile.am =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/Makefile.am,v retrieving revision 1.5 retrieving revision 1.6 diff -u -d -r1.5 -r1.6 --- Makefile.am 4 Jul 2007 17:52:16 -0000 1.5 +++ Makefile.am 5 Jul 2007 15:13:03 -0000 1.6 @@ -8,6 +8,6 @@ plugin_LTLIBRARIES = libchixpurple.la -libchixpurple_la_SOURCES = chix_purple.c +libchixpurple_la_SOURCES = chix_gaim.c libchixpurple_la_LIBADD = @chix_libs@ Index: chix_gaim.c =================================================================== RCS file: /cvsroot/chix/chix_gaim/src/chix_gaim.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- chix_gaim.c 4 Jul 2007 17:52:16 -0000 1.15 +++ chix_gaim.c 5 Jul 2007 15:13:03 -0000 1.16 @@ -267,16 +267,26 @@ { ChixCredit *credit = (ChixCredit *)node; GList *row = NULL; + + row = g_list_append(row, _(credit->provider)); + row = g_list_append(row, _(credit->alloted)); + row = g_list_append(row, _(credit->used)); + row = g_list_append(row, _(credit->left)); - row = g_list_append(row, (gpointer)credit->provider); - row = g_list_append(row, (gpointer)credit->alloted); - row = g_list_append(row, (gpointer)credit->used); - row = g_list_append(row, (gpointer)credit->left); + /* + * purple_notify_searchresults() frees these pointers + * when we close the dialog box. quick fix for now. + */ + credit->provider = NULL; + credit->alloted = NULL; + credit->used = NULL; + credit->left = NULL; purple_notify_searchresults_row_add(results, row); } purple_notify_searchresults(client->user_data, _("Available Credits"), NULL, NULL, results, NULL, NULL); + chix_event_done(event); return 1; } @@ -392,28 +402,29 @@ } static void -cp_tooltip_text(PurpleBuddy *pb, GString *str, gboolean full) +cp_tooltip_text(PurpleBuddy *pb, PurpleNotifyUserInfo *ui, gboolean full) { ChixBuddy *buddy; - char *stat; - char mood[16]; + char *stat; + char mood[16]; if (!pb->proto_data) { - g_string_append_printf(str, _("\n<b>%s:</b> %s"), - _("Status"), - _("Buddy not listed")); - return; + purple_notify_user_info_add_pair(ui, + _("Status"), _("Buddy not listed")); + return; } buddy = pb->proto_data; - chix_buddy_mood_get(buddy, mood, sizeof(mood)); stat = __status_text(buddy); - g_string_append_printf(str, _("\n<b>%s:</b> %s\n<b>%s:</b> %s\n<b>%s:</b> %s"), - _("Mood"), mood, - _("Status"), stat, - _("Provider"), buddy->provider); - g_free(stat); + + if (CHIX_BUDDY_ON_ANY(buddy)) + purple_notify_user_info_add_pair(ui, _("Status"), stat); + chix_buddy_mood_get(buddy, mood, sizeof(mood)); + purple_notify_user_info_add_pair(ui, _("Mood"), mood); + purple_notify_user_info_add_pair(ui, _("Provider"), buddy->provider); + + free(stat); } static GList * @@ -928,7 +939,7 @@ .icon_spec = NO_BUDDY_ICONS, .list_icon = cp_list_icon, // .list_emblems = cp_list_emblems, -// .tooltip_text = cp_tooltip_text, + .tooltip_text = cp_tooltip_text, .status_text = cp_status_text, .status_types = cp_status_types, .blist_node_menu = cp_blist_node_menu, @@ -966,9 +977,6 @@ { PurpleAccountOption *opt; - printf("FFFFFFFFFFFFFFFFFFFFFUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUUCK\n"); - - opt = purple_account_option_bool_new(_("Login as idle"), "idle", FALSE); prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, opt); |