# HG changeset patch # User Mark Doliner # Date 1133227264 0 # Node ID a72eb03429779827d29a4f60468fa61b5ef8dde6 # Parent 1ec49f3360d2942232a59fbc89b165c0c073189b [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 diff -r 1ec49f3360d2 -r a72eb0342977 src/gtkidle.c --- 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); diff -r 1ec49f3360d2 -r a72eb0342977 src/gtkidle.h --- 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_ */