changeset 25861:7f552614ec8a

applied changes from a336cc1fd3a1ce815f97303b8d5ae8988f8cbd5b through fe4f5d91d1605cf93c53470e59d4bf8da6c5c840 ChangeLog for the above.
author Ethan Blanton <elb@pidgin.im>
date Tue, 28 Apr 2009 20:57:59 +0000
parents d51b8647d43c
children 51167c69228e
files ChangeLog libpurple/conversation.c libpurple/plugins/filectl.c libpurple/plugins/joinpart.c libpurple/protocols/irc/msgs.c libpurple/protocols/jabber/buddy.c libpurple/protocols/msnp9/httpconn.c libpurple/protocols/msnp9/slp.c libpurple/protocols/msnp9/slpcall.c libpurple/protocols/msnp9/slpcall.h libpurple/protocols/msnp9/transaction.c libpurple/protocols/myspace/myspace.c libpurple/protocols/myspace/myspace.h libpurple/protocols/oscar/oscar.c libpurple/protocols/oscar/peer.c libpurple/protocols/sametime/sametime.c libpurple/protocols/zephyr/zephyr.c
diffstat 17 files changed, 26 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Apr 28 20:55:35 2009 +0000
+++ b/ChangeLog	Tue Apr 28 20:57:59 2009 +0000
@@ -2,6 +2,8 @@
 
 version 2.5.6 (??/??/2009):
 	libpurple:
+	* Improve sleep behavior by aggregation longer timeouts on second
+	  boundaries to allow better power saving.  (Arunan Balasubramaniam)
 	* Fix various crashes on exit.
 
 	IRC:
--- a/libpurple/conversation.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/conversation.c	Tue Apr 28 20:57:59 2009 +0000
@@ -33,7 +33,7 @@
 #include "signals.h"
 #include "util.h"
 
-#define SEND_TYPED_TIMEOUT 5000
+#define SEND_TYPED_TIMEOUT_SECONDS 5
 
 static GList *conversations = NULL;
 static GList *ims = NULL;
@@ -1122,8 +1122,9 @@
 {
 	g_return_if_fail(im != NULL);
 
-	im->send_typed_timeout = purple_timeout_add(SEND_TYPED_TIMEOUT, send_typed_cb,
-											  purple_conv_im_get_conversation(im));
+	im->send_typed_timeout = purple_timeout_add_seconds(SEND_TYPED_TIMEOUT_SECONDS,
+	                                                    send_typed_cb,
+	                                                    purple_conv_im_get_conversation(im));
 }
 
 void
--- a/libpurple/plugins/filectl.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/plugins/filectl.c	Tue Apr 28 20:57:59 2009 +0000
@@ -220,7 +220,7 @@
 plugin_load(PurplePlugin *plugin)
 {
 	init_file();
-	check = purple_timeout_add(5000, (GSourceFunc)check_file, NULL);
+	check = purple_timeout_add_seconds(5, (GSourceFunc)check_file, NULL);
 
 	return TRUE;
 }
--- a/libpurple/plugins/joinpart.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/plugins/joinpart.c	Tue Apr 28 20:57:59 2009 +0000
@@ -194,7 +194,7 @@
 	                    PURPLE_CALLBACK(received_chat_msg_cb), users);
 
 	/* Cleanup every 5 minutes */
-	id = purple_timeout_add(1000 * 60 * 5, (GSourceFunc)clean_users_hash, users);
+	id = purple_timeout_add_seconds(60 * 5, (GSourceFunc)clean_users_hash, users);
 
 	data = g_new(gpointer, 2);
 	data[0] = users;
--- a/libpurple/protocols/irc/msgs.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/irc/msgs.c	Tue Apr 28 20:57:59 2009 +0000
@@ -117,7 +117,7 @@
 
 	irc_blist_timeout(irc);
 	if (!irc->timer)
-		irc->timer = purple_timeout_add(45000, (GSourceFunc)irc_blist_timeout, (gpointer)irc);
+		irc->timer = purple_timeout_add_seconds(45, (GSourceFunc)irc_blist_timeout, (gpointer)irc);
 }
 
 void irc_msg_default(struct irc_conn *irc, const char *name, const char *from, char **args)
--- a/libpurple/protocols/jabber/buddy.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/jabber/buddy.c	Tue Apr 28 20:57:59 2009 +0000
@@ -1775,7 +1775,7 @@
 	}
 
 	js->pending_buddy_info_requests = g_slist_prepend(js->pending_buddy_info_requests, jbi);
-	jbi->timeout_handle = purple_timeout_add(30000, jabber_buddy_get_info_timeout, jbi);
+	jbi->timeout_handle = purple_timeout_add_seconds(30, jabber_buddy_get_info_timeout, jbi);
 }
 
 void jabber_buddy_get_info(PurpleConnection *gc, const char *who)
--- a/libpurple/protocols/msnp9/httpconn.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/msnp9/httpconn.c	Tue Apr 28 20:57:59 2009 +0000
@@ -703,7 +703,7 @@
 		httpconn->inpa = purple_input_add(httpconn->fd, PURPLE_INPUT_READ,
 			read_cb, data);
 
-		httpconn->timer = purple_timeout_add(2000, msn_httpconn_poll, httpconn);
+		httpconn->timer = purple_timeout_add_seconds(3, msn_httpconn_poll, httpconn);
 
 		msn_httpconn_process_queue(httpconn);
 	}
--- a/libpurple/protocols/msnp9/slp.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/msnp9/slp.c	Tue Apr 28 20:57:59 2009 +0000
@@ -33,8 +33,8 @@
 
 #include "smiley.h"
 
-/* ms to delay between sending buddy icon requests to the server. */
-#define BUDDY_ICON_DELAY 20000
+/* Seconds to delay between sending buddy icon requests to the server. */
+#define BUDDY_ICON_DELAY 20
 
 static void send_ok(MsnSlpCall *slpcall, const char *branch,
 					const char *type, const char *content);
@@ -1058,8 +1058,8 @@
 		purple_timeout_remove(userlist->buddy_icon_request_timer);
 	}
 
-	/* Wait BUDDY_ICON_DELAY ms before freeing our window slot and requesting the next icon. */
-	userlist->buddy_icon_request_timer = purple_timeout_add(BUDDY_ICON_DELAY, 
+	/* Wait BUDDY_ICON_DELAY_S seconds before freeing our window slot and requesting the next icon. */
+	userlist->buddy_icon_request_timer = purple_timeout_add_seconds(BUDDY_ICON_DELAY, 
 														  msn_release_buddy_icon_request_timeout, userlist);
 }
 
--- a/libpurple/protocols/msnp9/slpcall.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/msnp9/slpcall.c	Tue Apr 28 20:57:59 2009 +0000
@@ -68,7 +68,7 @@
 
 	msn_slplink_add_slpcall(slplink, slpcall);
 
-	slpcall->timer = purple_timeout_add(MSN_SLPCALL_TIMEOUT, msn_slp_call_timeout, slpcall);
+	slpcall->timer = purple_timeout_add_seconds(MSN_SLPCALL_TIMEOUT, msn_slp_call_timeout, slpcall);
 
 	return slpcall;
 }
--- a/libpurple/protocols/msnp9/slpcall.h	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/msnp9/slpcall.h	Tue Apr 28 20:57:59 2009 +0000
@@ -33,7 +33,7 @@
 #include "slpsession.h"
 
 /* The official client seems to timeout slp calls after 5 minutes */
-#define MSN_SLPCALL_TIMEOUT 300000
+#define MSN_SLPCALL_TIMEOUT 300
 
 typedef enum
 {
--- a/libpurple/protocols/msnp9/transaction.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/msnp9/transaction.c	Tue Apr 28 20:57:59 2009 +0000
@@ -211,7 +211,7 @@
 		purple_timeout_remove(trans->timer);
 	}
 	trans->timeout_cb = cb;
-	trans->timer = purple_timeout_add(60000, transaction_timeout, trans);
+	trans->timer = purple_timeout_add_seconds(60, transaction_timeout, trans);
 }
 
 void
--- a/libpurple/protocols/myspace/myspace.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/myspace/myspace.c	Tue Apr 28 20:57:59 2009 +0000
@@ -1238,7 +1238,7 @@
 
 	/* Disable due to problems with timeouts. TODO: fix. */
 #ifdef MSIM_USE_KEEPALIVE
-	purple_timeout_add(MSIM_KEEPALIVE_INTERVAL_CHECK,
+	purple_timeout_add_seconds(MSIM_KEEPALIVE_INTERVAL_CHECK,
 			(GSourceFunc)msim_check_alive, session);
 #endif
 
--- a/libpurple/protocols/myspace/myspace.h	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/myspace/myspace.h	Tue Apr 28 20:57:59 2009 +0000
@@ -114,8 +114,8 @@
 #define MSIM_KEEPALIVE_INTERVAL     (3 * 60)
 /*#define MSIM_USE_KEEPALIVE*/
 
-/* Time to check if alive (milliseconds) */
-#define MSIM_KEEPALIVE_INTERVAL_CHECK   (30 * 1000)
+/* Time to check if alive (seconds) */
+#define MSIM_KEEPALIVE_INTERVAL_CHECK   30
 
 /* Time to check for new mail (milliseconds) */
 #define MSIM_MAIL_INTERVAL_CHECK    (60 * 1000)
--- a/libpurple/protocols/oscar/oscar.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.c	Tue Apr 28 20:57:59 2009 +0000
@@ -1266,7 +1266,7 @@
 	aim_ssi_reqdata(od);
 	if (od->getblisttimer > 0)
 		purple_timeout_remove(od->getblisttimer);
-	od->getblisttimer = purple_timeout_add(30000, purple_ssi_rerequestdata, od);
+	od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od);
 
 	aim_locate_reqrights(od);
 	aim_buddylist_reqrights(od, conn);
@@ -5031,7 +5031,7 @@
 						  _("The AIM servers were temporarily unable to send your buddy list.  Your buddy list is not lost, and will probably become available in a few minutes."));
 		if (od->getblisttimer > 0)
 			purple_timeout_remove(od->getblisttimer);
-		od->getblisttimer = purple_timeout_add(30000, purple_ssi_rerequestdata, od);
+		od->getblisttimer = purple_timeout_add_seconds(30, purple_ssi_rerequestdata, od);
 		return 1;
 	}
 
--- a/libpurple/protocols/oscar/peer.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/oscar/peer.c	Tue Apr 28 20:57:59 2009 +0000
@@ -812,7 +812,7 @@
 			(conn->client_connect_data != NULL))
 		{
 			/* Connecting... */
-			conn->connect_timeout_timer = purple_timeout_add(5000,
+			conn->connect_timeout_timer = purple_timeout_add_seconds(5,
 					peer_connection_tooktoolong, conn);
 			return;
 		}
--- a/libpurple/protocols/sametime/sametime.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Tue Apr 28 20:57:59 2009 +0000
@@ -809,7 +809,7 @@
 static void blist_schedule(struct mwPurplePluginData *pd) {
   if(pd->save_event) return;
 
-  pd->save_event = purple_timeout_add(BLIST_SAVE_SECONDS * 1000,
+  pd->save_event = purple_timeout_add_seconds(BLIST_SAVE_SECONDS,
 				    blist_save_cb, pd);
 }
 
--- a/libpurple/protocols/zephyr/zephyr.c	Tue Apr 28 20:55:35 2009 +0000
+++ b/libpurple/protocols/zephyr/zephyr.c	Tue Apr 28 20:57:59 2009 +0000
@@ -1857,7 +1857,7 @@
 	} else if (use_tzc(zephyr)) {
 		zephyr->nottimer = purple_timeout_add(100, check_notify_tzc, gc);
 	} 
-	zephyr->loctimer = purple_timeout_add(20000, check_loc, gc); 
+	zephyr->loctimer = purple_timeout_add_seconds(20, check_loc, gc); 
 
 }