comparison libpurple/idle.c @ 18106:40d51793f2d7

propagate from branch 'im.pidgin.pidgin.2.1.0' (head d8c7c08339ae468cb4298f6850eb7d3b760ad7b5) to branch 'im.pidgin.pidgin' (head 7f1ffdbda951c2effec7bfbfa8148e9ce98e7669)
author Sean Egan <seanegan@gmail.com>
date Fri, 15 Jun 2007 19:34:24 +0000
parents 81d42bfe31fa 4ca97b26a8fb
children 59aec2d6ec43 69febfa6d307
comparison
equal deleted inserted replaced
17938:9564b55f3c18 18106:40d51793f2d7
197 } 197 }
198 198
199 /* Idle reporting stuff */ 199 /* Idle reporting stuff */
200 if (report_idle && (time_idle >= IDLEMARK)) 200 if (report_idle && (time_idle >= IDLEMARK))
201 { 201 {
202 GList *l; 202 const GList *l;
203 for (l = purple_connections_get_all(); l != NULL; l = l->next) 203 for (l = purple_connections_get_all(); l != NULL; l = l->next)
204 { 204 {
205 PurpleConnection *gc = l->data; 205 PurpleConnection *gc = l->data;
206 set_account_idle(purple_connection_get_account(gc), time_idle); 206 set_account_idle(purple_connection_get_account(gc), time_idle);
207 } 207 }
222 { 222 {
223 check_idleness(); 223 check_idleness();
224 if (time_until_next_idle_event == 0) 224 if (time_until_next_idle_event == 0)
225 idle_timer = 0; 225 idle_timer = 0;
226 else 226 else
227 idle_timer = purple_timeout_add(1000 * (time_until_next_idle_event + 1), check_idleness_timer, NULL); 227 {
228 /* +1 for the boundary,
229 * +1 more for g_timeout_add_seconds rounding. */
230 idle_timer = purple_timeout_add_seconds(time_until_next_idle_event + 2, check_idleness_timer, NULL);
231 }
228 return FALSE; 232 return FALSE;
229 } 233 }
230 234
231 static void 235 static void
232 im_msg_sent_cb(PurpleAccount *account, const char *receiver, 236 im_msg_sent_cb(PurpleAccount *account, const char *receiver,
309 313
310 314
311 void 315 void
312 purple_idle_init() 316 purple_idle_init()
313 { 317 {
314 /* Add the timer to check if we're idle */ 318 /* Add the timer to check if we're idle.
315 idle_timer = purple_timeout_add(1000 * (IDLEMARK + 1), check_idleness_timer, NULL); 319 * IDLEMARK + 1 as the boundary,
320 * +1 more for g_timeout_add_seconds rounding. */
321 idle_timer = purple_timeout_add_seconds((IDLEMARK + 2), check_idleness_timer, NULL);
316 322
317 purple_signal_connect(purple_conversations_get_handle(), "sent-im-msg", 323 purple_signal_connect(purple_conversations_get_handle(), "sent-im-msg",
318 purple_idle_get_handle(), 324 purple_idle_get_handle(),
319 PURPLE_CALLBACK(im_msg_sent_cb), NULL); 325 PURPLE_CALLBACK(im_msg_sent_cb), NULL);
320 purple_signal_connect(purple_connections_get_handle(), "signing-on", 326 purple_signal_connect(purple_connections_get_handle(), "signing-on",