|
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); |