changeset 12252:a72eb0342977

[gaim-migrate @ 14554] Fix auto-away when your auto-away time is greater than 10 minutes. Anyone know why idleness isn't always being correctly reported? It happened in my primary instance of Gaim but I can't reproduce it with my test accounts. committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Tue, 29 Nov 2005 01:21:04 +0000
parents 1ec49f3360d2
children 868220a1a1b2
files src/gtkidle.c src/gtkidle.h
diffstat 2 files changed, 7 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- a/src/gtkidle.c	Mon Nov 28 13:34:20 2005 +0000
+++ b/src/gtkidle.c	Tue Nov 29 01:21:04 2005 +0000
@@ -121,19 +121,23 @@
  * 2. Set or unset your auto-away message.
  * 3. Report your current idle time to the IM server.
  */
-gint
+/*
+ * TODO: Make this loop so it's only called once, and handles all accounts?
+ */
+static gint
 gaim_gtk_idle_check(gpointer data)
 {
 	GaimConnection *gc = (GaimConnection *)data;
 	gboolean report_idle;
 	GaimAccount *account;
 	GaimPresence *presence;
+	GaimStatus *status;
 	time_t t;
 	int idle_time;
 
 	account = gaim_connection_get_account(gc);
-
 	presence = gaim_account_get_presence(account);
+	status = gaim_presence_get_active_status(presence);
 
 	gaim_signal_emit(gaim_blist_get_handle(), "update-idle");
 
@@ -157,7 +161,7 @@
 		(idle_time > (60 * gaim_prefs_get_int("/core/away/mins_before_away")))
 		&& (!gc->is_auto_away))
 	{
-		if (gaim_presence_is_available(presence))
+		if (gaim_status_is_available(status))
 		{
 			GaimSavedStatus *saved_status;
 
@@ -263,7 +267,6 @@
 	gaim_signal_connect(gaim_conversations_get_handle(), "sent-im-msg",
 						gaim_gtk_idle_get_handle(),
 						GAIM_CALLBACK(im_msg_sent_cb), NULL);
-
 	gaim_signal_connect(gaim_connections_get_handle(), "signed-on",
 						gaim_gtk_idle_get_handle(),
 						GAIM_CALLBACK(connection_connected_cb), NULL);
--- a/src/gtkidle.h	Mon Nov 28 13:34:20 2005 +0000
+++ b/src/gtkidle.h	Tue Nov 29 01:21:04 2005 +0000
@@ -41,14 +41,6 @@
  */
 void gaim_gtk_idle_uninit(void);
 
-/**
- * Check the current idle time, reporting to the server or going auto-away as
- * appropriate.
- *
- * @param data A pointer to the GaimConnection* to check
- */
-gint gaim_gtk_idle_check(gpointer data);
-
 /*@}*/
 
 #endif /* _GAIM_GTK_IDLE_H_ */