libpurple/idle.c

changeset 17741
5075c0d3a19a
parent 17579
4c3e8468d487
child 18178
d461ccafa1fb
equal deleted inserted replaced
17740:e392c3758fb9 17741:5075c0d3a19a
298 static int handle; 298 static int handle;
299 299
300 return &handle; 300 return &handle;
301 } 301 }
302 302
303 static gboolean _do_purple_idle_touch_cb(gpointer data)
304 {
305 purple_idle_touch();
306
307 return FALSE;
308 }
309
310
303 void 311 void
304 purple_idle_init() 312 purple_idle_init()
305 { 313 {
306 /* Add the timer to check if we're idle */ 314 /* Add the timer to check if we're idle */
307 idle_timer = purple_timeout_add(1000 * (IDLEMARK + 1), check_idleness_timer, NULL); 315 idle_timer = purple_timeout_add(1000 * (IDLEMARK + 1), check_idleness_timer, NULL);
317 PURPLE_CALLBACK(signing_off_cb), NULL); 325 PURPLE_CALLBACK(signing_off_cb), NULL);
318 326
319 purple_prefs_connect_callback(purple_idle_get_handle(), "/purple/away/idle_reporting", 327 purple_prefs_connect_callback(purple_idle_get_handle(), "/purple/away/idle_reporting",
320 idle_reporting_cb, NULL); 328 idle_reporting_cb, NULL);
321 329
322 purple_idle_touch(); 330 /* Initialize the idleness asynchronously so it doesn't check idleness,
331 * and potentially try to change the status before the UI is initialized */
332 g_idle_add(_do_purple_idle_touch_cb, NULL);
333
323 } 334 }
324 335
325 void 336 void
326 purple_idle_uninit() 337 purple_idle_uninit()
327 { 338 {

mercurial