Mercurial > pidgin
comparison src/status.c @ 11935:cb73483c9f63
[gaim-migrate @ 14226]
Here are buddy-status-changed and buddy-idle-changed signals, to replace
buddy-away, buddy-back, buddy-idle, and buddy-unidle. It it now possible to
detect when a buddy goes from one away-state to another away-state without
coming back in between.
I'm not really sure I like how buddy-idle-changed works here, but it felt
better to keep it consistent. It currently only fires on idle and unidle and
not on just-more-idle, though that's easy to change if we decide plugins might
want to know as idle time increases.
I think I got all the doxygen and ChangeLog.API stuff, someone yell if I
missed something.
committer: Tailor Script <tailor@pidgin.im>
author | Etan Reisner <pidgin@unreliablesource.net> |
---|---|
date | Mon, 31 Oct 2005 22:02:30 +0000 |
parents | 58b8251c3d60 |
children | 0fab529c01fc |
comparison
equal
deleted
inserted
replaced
11934:525cf7ecd919 | 11935:cb73483c9f63 |
---|---|
1261 { | 1261 { |
1262 GaimBlistUiOps *ops = gaim_get_blist()->ui_ops; | 1262 GaimBlistUiOps *ops = gaim_get_blist()->ui_ops; |
1263 | 1263 |
1264 if (!old_idle && idle) | 1264 if (!old_idle && idle) |
1265 { | 1265 { |
1266 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle", buddy); | |
1267 | |
1268 if (gaim_prefs_get_bool("/core/logging/log_system")) | 1266 if (gaim_prefs_get_bool("/core/logging/log_system")) |
1269 { | 1267 { |
1270 GaimLog *log = gaim_account_get_log(buddy->account); | 1268 GaimLog *log = gaim_account_get_log(buddy->account); |
1271 char *tmp = g_strdup_printf(_("%s became idle"), | 1269 char *tmp = g_strdup_printf(_("%s became idle"), |
1272 gaim_buddy_get_alias(buddy)); | 1270 gaim_buddy_get_alias(buddy)); |
1276 g_free(tmp); | 1274 g_free(tmp); |
1277 } | 1275 } |
1278 } | 1276 } |
1279 else if (old_idle && !idle) | 1277 else if (old_idle && !idle) |
1280 { | 1278 { |
1281 gaim_signal_emit(gaim_blist_get_handle(), "buddy-unidle", buddy); | |
1282 | |
1283 if (gaim_prefs_get_bool("/core/logging/log_system")) | 1279 if (gaim_prefs_get_bool("/core/logging/log_system")) |
1284 { | 1280 { |
1285 GaimLog *log = gaim_account_get_log(buddy->account); | 1281 GaimLog *log = gaim_account_get_log(buddy->account); |
1286 char *tmp = g_strdup_printf(_("%s became unidle"), | 1282 char *tmp = g_strdup_printf(_("%s became unidle"), |
1287 gaim_buddy_get_alias(buddy)); | 1283 gaim_buddy_get_alias(buddy)); |
1289 gaim_log_write(log, GAIM_MESSAGE_SYSTEM, | 1285 gaim_log_write(log, GAIM_MESSAGE_SYSTEM, |
1290 gaim_buddy_get_alias(buddy), current_time, tmp); | 1286 gaim_buddy_get_alias(buddy), current_time, tmp); |
1291 g_free(tmp); | 1287 g_free(tmp); |
1292 } | 1288 } |
1293 } | 1289 } |
1290 | |
1291 if (old_idle != idle) | |
1292 gaim_signal_emit(gaim_blist_get_handle(), "buddy-idle-changed", buddy, | |
1293 old_idle, idle); | |
1294 | 1294 |
1295 gaim_contact_invalidate_priority_buddy(gaim_buddy_get_contact(buddy)); | 1295 gaim_contact_invalidate_priority_buddy(gaim_buddy_get_contact(buddy)); |
1296 | 1296 |
1297 if (ops != NULL && ops->update != NULL) | 1297 if (ops != NULL && ops->update != NULL) |
1298 ops->update(gaim_get_blist(), (GaimBlistNode *)buddy); | 1298 ops->update(gaim_get_blist(), (GaimBlistNode *)buddy); |