# HG changeset patch # User Marcus Lundblad # Date 1233511205 0 # Node ID feea711ac242327745014c3353b813e06009e4b8 # Parent a92df60855f3e03a4fca334fb6844ad15bc9f5db Patch from Paul Aurich to fix reporting idle when reconnecting only when we're really idle... diff -r a92df60855f3 -r feea711ac242 libpurple/protocols/jabber/jabber.c --- a/libpurple/protocols/jabber/jabber.c Thu Jan 29 19:54:26 2009 +0000 +++ b/libpurple/protocols/jabber/jabber.c Sun Feb 01 18:00:05 2009 +0000 @@ -28,7 +28,6 @@ #include "conversation.h" #include "debug.h" #include "dnssrv.h" -#include "idle.h" #include "message.h" #include "notify.h" #include "pluginpref.h" @@ -37,6 +36,7 @@ #include "prpl.h" #include "request.h" #include "server.h" +#include "status.h" #include "util.h" #include "version.h" #include "xmlnode.h" @@ -702,9 +702,9 @@ const char *connect_server = purple_account_get_string(account, "connect_server", ""); JabberStream *js; + PurplePresence *presence; JabberBuddy *my_jb = NULL; - PurpleIdleUiOps *idle_ops = NULL; - + gc->flags |= PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_ALLOW_CUSTOM_SMILEY; js = gc->proto_data = g_new0(JabberStream, 1); @@ -728,11 +728,10 @@ /* if we are idle, set idle-ness on the stream (this could happen if we get disconnected and the reconnects while being idle. I don't think it makes sense to do this when registering a new account... */ - idle_ops = purple_idle_get_ui_ops(); - if (idle_ops && idle_ops->get_time_idle) { - js->idle = (idle_ops->get_time_idle)(); - } - + presence = purple_account_get_presence(account); + if (purple_presence_is_idle(presence)) + js->idle = purple_presence_get_idle_time(presence); + if(!js->user) { purple_connection_error_reason (gc, PURPLE_CONNECTION_ERROR_INVALID_SETTINGS,