comparison plugins/idle.c @ 11972:73777ad45562

[gaim-migrate @ 14265] Get rid of gc->is_idle, and get rid of some duplicate Yahoo! code committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Fri, 04 Nov 2005 17:33:32 +0000
parents 55052a685da6
children 2ff2965895f3
comparison
equal deleted inserted replaced
11971:cc7146eee26f 11972:73777ad45562
47 } 47 }
48 48
49 static void 49 static void
50 set_idle_time(GaimAccount *acct, int mins_idle) 50 set_idle_time(GaimAccount *acct, int mins_idle)
51 { 51 {
52 time_t t = time(NULL); /* grab the current time */ 52 time_t t;
53 GaimConnection *gc = gaim_account_get_connection(acct); 53 GaimConnection *gc = gaim_account_get_connection(acct);
54 GaimPresence *presence = gaim_account_get_presence(acct); 54 GaimPresence *presence = gaim_account_get_presence(acct);
55 55
56 if (!gc) 56 if (!gc)
57 return; 57 return;
58 58
59 gaim_debug_info("idle", 59 gaim_debug_info("idle",
60 "setting idle time for %s to %d\n", 60 "setting idle time for %s to %d\n",
61 gaim_account_get_username(acct), mins_idle); 61 gaim_account_get_username(acct), mins_idle);
62 62
63 t -= 60 * mins_idle; /* subtract seconds idle from current time */ 63 t -= time(NULL) - (60 * mins_idle); /* subtract seconds idle from current time */
64 gc->last_sent_time = t; 64 gc->last_sent_time = t;
65 gc->is_idle = 0;
66 65
67 gaim_presence_set_idle(presence, mins_idle ? TRUE : FALSE, t); 66 gaim_presence_set_idle(presence, mins_idle ? TRUE : FALSE, t);
68 } 67 }
69 68
70 static void 69 static void