Index: src/snpp.c =================================================================== RCS file: /cvsroot/gaim-snpp/gaim-snpp/src/snpp.c,v retrieving revision 1.28 diff -u -p -r1.28 snpp.c --- src/snpp.c 18 Sep 2004 15:43:44 -0000 1.28 +++ src/snpp.c 23 Dec 2005 12:34:00 -0000 @@ -249,7 +249,7 @@ static void snpp_callback(gpointer data, gaim_debug_info("snpp", "snpp_callback: State is SEND, return code was %s\n", retcode); if (!g_ascii_strcasecmp(retcode,"250")) { /* Print status message (buf) to window */ - if ((conv = gaim_find_conversation_with_account(sd->current_page->pager, sd->account))) { + if ((conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_IM, sd->current_page->pager, sd->account))) { gaim_conversation_write(conv, NULL, buf, GAIM_MESSAGE_SYSTEM, time(NULL)); } snpp_cmd_quit(sd); @@ -343,7 +343,7 @@ static int snpp_process(GaimConnection * static int snpp_send_im(GaimConnection *gc, const char *who, const char *what, - GaimConvImFlags imflags) + GaimMessageFlags flags) { struct snpp_data *sd; struct snpp_page *sp; @@ -368,6 +368,24 @@ static const char *snpp_icon(GaimAccount return "snpp"; } +static void fake_buddy_signons(GaimAccount *account) +{ + GaimBlistNode *node = gaim_get_blist()->root; + + while (node != NULL) + { + if (GAIM_BLIST_NODE_IS_BUDDY(node)) + { + GaimBuddy *buddy = (GaimBuddy *)node; + if (buddy->account == account) + gaim_prpl_got_user_status(account, buddy->name, "available", NULL); + } + + node = gaim_blist_node_next(node, FALSE); + } + +} + static void snpp_login(GaimAccount *account) { GaimConnection *gc; @@ -380,7 +398,8 @@ static void snpp_login(GaimAccount *acco sd->account = account; gaim_connection_set_state(gc, GAIM_CONNECTED); - serv_finish_login(gc); + + fake_buddy_signons(account); }; @@ -401,7 +420,7 @@ static void snpp_close(GaimConnection *g static void snpp_add_buddy(GaimConnection *gc, GaimBuddy *b, GaimGroup *group) { gaim_debug_info("snpp", "snpp_add_buddy\n"); - serv_got_update(gc, b->name, TRUE, 0, 0, 0, 0); + gaim_prpl_got_user_status(gaim_connection_get_account(gc), b->name, "available", NULL); }; static void snpp_remove_buddy(GaimConnection *gc, GaimBuddy *b, GaimGroup *group) @@ -409,6 +428,22 @@ static void snpp_remove_buddy(GaimConnec gaim_debug_info("snpp", "snpp_remove_buddy\n"); }; +static GList *snpp_status_types(GaimAccount *account) +{ + GaimStatusType *status; + GList *types = NULL; + + status = gaim_status_type_new_full(GAIM_STATUS_OFFLINE, + NULL, NULL, FALSE, TRUE, FALSE); + types = g_list_append(types, status); + + status = gaim_status_type_new_full(GAIM_STATUS_AVAILABLE, + NULL, NULL, FALSE, TRUE, FALSE); + types = g_list_append(types, status); + + return types; +} + static GaimPluginProtocolInfo prpl_info = { OPT_PROTO_PASSWORD_OPTIONAL, /* options */ @@ -419,7 +454,7 @@ static GaimPluginProtocolInfo prpl_info NULL, /* list_emblems */ NULL, /* status_text */ NULL, /* tooltip_text */ - NULL, /* away_states */ + snpp_status_types, /* status_types */ NULL, /* blist_node_menu */ NULL, /* chat_info */ NULL, /* chat_info_defaults */