cpw.malu.xmpp.idle: 8a78a27a: Patch from Paul Aurich to fix reporting ...

malu at pidgin.im malu at pidgin.im
Sun Feb 1 13:10:28 EST 2009


-----------------------------------------------------------------
Revision: 8a78a27a5123f05441fd5df8c423b57929973128
Ancestor: 244094a7e3119698662ac93e055e40035e08612c
Author: malu at pidgin.im
Date: 2009-02-01T18:00:05
Branch: im.pidgin.cpw.malu.xmpp.idle
URL: http://d.pidgin.im/viewmtn/revision/info/8a78a27a5123f05441fd5df8c423b57929973128

Modified files:
        libpurple/protocols/jabber/jabber.c

ChangeLog: 

Patch from Paul Aurich to fix reporting idle when reconnecting only when we're
really idle...

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/jabber.c	6642bc9909fab071fa9ca3981057b5a878e9544b
+++ libpurple/protocols/jabber/jabber.c	04ccb02370081bef6aad48cad7df6d7a100dedd1
@@ -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 @@ jabber_login(PurpleAccount *account)
 	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 @@ jabber_login(PurpleAccount *account)
 	/* 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,


More information about the Commits mailing list