Mercurial > pidgin.yaz
comparison libpurple/idle.c @ 18066:5c4efa98e8dd
propagate from branch 'im.pidgin.pidgin' (head 4d9e228029b9b7850d000c2edadc108c40f9e59a)
to branch 'im.pidgin.pidgin.2.1.0' (head 6a22d95caf705430ccb49e98a7000ad83484b5fe)
author | Luke Schierer <lschiere@pidgin.im> |
---|---|
date | Thu, 07 Jun 2007 02:39:48 +0000 |
parents | 2f9eabdc6011 |
children | 4ca97b26a8fb |
comparison
equal
deleted
inserted
replaced
17765:89adae2f1a6e | 18066:5c4efa98e8dd |
---|---|
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, |
301 } | 305 } |
302 | 306 |
303 void | 307 void |
304 purple_idle_init() | 308 purple_idle_init() |
305 { | 309 { |
306 /* Add the timer to check if we're idle */ | 310 /* Add the timer to check if we're idle. |
307 idle_timer = purple_timeout_add(1000 * (IDLEMARK + 1), check_idleness_timer, NULL); | 311 * IDLEMARK + 1 as the boundary, |
312 * +1 more for g_timeout_add_seconds rounding. */ | |
313 idle_timer = purple_timeout_add_seconds((IDLEMARK + 2), check_idleness_timer, NULL); | |
308 | 314 |
309 purple_signal_connect(purple_conversations_get_handle(), "sent-im-msg", | 315 purple_signal_connect(purple_conversations_get_handle(), "sent-im-msg", |
310 purple_idle_get_handle(), | 316 purple_idle_get_handle(), |
311 PURPLE_CALLBACK(im_msg_sent_cb), NULL); | 317 PURPLE_CALLBACK(im_msg_sent_cb), NULL); |
312 purple_signal_connect(purple_connections_get_handle(), "signing-on", | 318 purple_signal_connect(purple_connections_get_handle(), "signing-on", |