Mercurial > pidgin.yaz
comparison src/idle.c @ 5211:0241d6b6702d
[gaim-migrate @ 5581]
Wrote a new debugging API, and of course core/ui split it. Debug statements
can now have debug levels and categories, for future filtering of stuff,
and color highlighting. It's nifty, m'kay?
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Sat, 26 Apr 2003 06:46:08 +0000 |
parents | fefad67de2c7 |
children | 80e4ba770f97 |
comparison
equal
deleted
inserted
replaced
5210:39bb2a35f8d9 | 5211:0241d6b6702d |
---|---|
78 #endif /* USE_SCREENSAVER */ | 78 #endif /* USE_SCREENSAVER */ |
79 idle_time = t - gc->lastsent; | 79 idle_time = t - gc->lastsent; |
80 | 80 |
81 if ((away_options & OPT_AWAY_AUTO) && (idle_time > (60 * auto_away)) && (!gc->is_auto_away)) { | 81 if ((away_options & OPT_AWAY_AUTO) && (idle_time > (60 * auto_away)) && (!gc->is_auto_away)) { |
82 if (!gc->away) { | 82 if (!gc->away) { |
83 debug_printf("making %s away automatically\n", gc->username); | 83 gaim_debug(GAIM_DEBUG_INFO, "idle", |
84 "Making %s away automatically\n", gc->username); | |
84 if (g_slist_length(connections) == 1) | 85 if (g_slist_length(connections) == 1) |
85 do_away_message(NULL, default_away); | 86 do_away_message(NULL, default_away); |
86 else if (default_away) | 87 else if (default_away) |
87 serv_set_away(gc, GAIM_AWAY_CUSTOM, default_away->message); | 88 serv_set_away(gc, GAIM_AWAY_CUSTOM, default_away->message); |
88 gc->is_auto_away = 1; | 89 gc->is_auto_away = 1; |
94 gc->is_auto_away = 0; | 95 gc->is_auto_away = 0; |
95 return TRUE; | 96 return TRUE; |
96 } | 97 } |
97 gc->is_auto_away = 0; | 98 gc->is_auto_away = 0; |
98 if (awaymessage == NULL) { | 99 if (awaymessage == NULL) { |
99 debug_printf("removing auto-away message for %s\n", gc->username); | 100 gaim_debug(GAIM_DEBUG_INFO, "idle", |
101 "Removing auto-away message for %s\n", gc->username); | |
100 serv_set_away(gc, GAIM_AWAY_CUSTOM, NULL); | 102 serv_set_away(gc, GAIM_AWAY_CUSTOM, NULL); |
101 } else { | 103 } else { |
102 if (g_slist_length(connections) == 1) | 104 if (g_slist_length(connections) == 1) |
103 do_im_back(0, 0); | 105 do_im_back(0, 0); |
104 else { | 106 else { |
105 debug_printf("replacing auto-away with global for %s\n", gc->username); | 107 gaim_debug(GAIM_DEBUG_INFO, "idle", |
108 "Replacing auto-away with global for %s\n", | |
109 gc->username); | |
106 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message); | 110 serv_set_away(gc, GAIM_AWAY_CUSTOM, awaymessage->message); |
107 } | 111 } |
108 } | 112 } |
109 } | 113 } |
110 | 114 |
115 if (report_idle == IDLE_NONE) { | 119 if (report_idle == IDLE_NONE) { |
116 return TRUE; | 120 return TRUE; |
117 } | 121 } |
118 | 122 |
119 if (idle_time >= IDLEMARK && !gc->is_idle) { | 123 if (idle_time >= IDLEMARK && !gc->is_idle) { |
120 debug_printf("setting %s idle %d seconds\n", gc->username, idle_time); | 124 gaim_debug(GAIM_DEBUG_INFO, "idle", "Setting %s idle %d seconds\n", |
125 gc->username, idle_time); | |
121 serv_set_idle(gc, idle_time); | 126 serv_set_idle(gc, idle_time); |
122 gc->is_idle = 1; | 127 gc->is_idle = 1; |
123 system_log(log_idle, gc, NULL, OPT_LOG_BUDDY_IDLE | OPT_LOG_MY_SIGNON); | 128 system_log(log_idle, gc, NULL, OPT_LOG_BUDDY_IDLE | OPT_LOG_MY_SIGNON); |
124 } else if (idle_time < IDLEMARK && gc->is_idle) { | 129 } else if (idle_time < IDLEMARK && gc->is_idle) { |
125 debug_printf("setting %s unidle\n", gc->username); | 130 gaim_debug(GAIM_DEBUG_INFO, "idle", "Setting %s unidle\n", |
131 gc->username); | |
126 serv_touch_idle(gc); | 132 serv_touch_idle(gc); |
127 system_log(log_unidle, gc, NULL, OPT_LOG_BUDDY_IDLE | OPT_LOG_MY_SIGNON); | 133 system_log(log_unidle, gc, NULL, OPT_LOG_BUDDY_IDLE | OPT_LOG_MY_SIGNON); |
128 } | 134 } |
129 | 135 |
130 return TRUE; | 136 return TRUE; |