Mercurial > pidgin
comparison src/blist.c @ 10205:35eae887271a
[gaim-migrate @ 11326]
I removed the did_something thingy. My comment in the code might explain
why. Basically, if someone changes their available message then the
change will show up immediately instead of whenever something else happens
to trigger a blist update for that person.
Rockin' in the Wheary Land.
committer: Tailor Script <tailor@pidgin.im>
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Fri, 19 Nov 2004 03:21:52 +0000 |
parents | 72c9e9bb2c19 |
children | a66cf83552dc |
comparison
equal
deleted
inserted
replaced
10204:393f85d9f8dd | 10205:35eae887271a |
---|---|
277 gaim_blist_update_buddy_status(GaimBuddy *buddy, GaimStatus *old_status) | 277 gaim_blist_update_buddy_status(GaimBuddy *buddy, GaimStatus *old_status) |
278 { | 278 { |
279 GaimBlistUiOps *ops = gaimbuddylist->ui_ops; | 279 GaimBlistUiOps *ops = gaimbuddylist->ui_ops; |
280 GaimPresence *presence; | 280 GaimPresence *presence; |
281 GaimStatus *status; | 281 GaimStatus *status; |
282 gboolean did_something = FALSE; | |
283 | 282 |
284 g_return_if_fail(buddy != NULL); | 283 g_return_if_fail(buddy != NULL); |
285 | 284 |
286 presence = gaim_buddy_get_presence(buddy); | 285 presence = gaim_buddy_get_presence(buddy); |
287 status = gaim_presence_get_active_status(presence); | 286 status = gaim_presence_get_active_status(presence); |
299 ((GaimGroup *)((GaimBlistNode *)buddy)->parent->parent)->online++; | 298 ((GaimGroup *)((GaimBlistNode *)buddy)->parent->parent)->online++; |
300 } | 299 } |
301 if (buddy->timer > 0) | 300 if (buddy->timer > 0) |
302 gaim_timeout_remove(buddy->timer); | 301 gaim_timeout_remove(buddy->timer); |
303 buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy); | 302 buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy); |
304 did_something = TRUE; | |
305 | 303 |
306 } else if (!gaim_status_is_online(status) && | 304 } else if (!gaim_status_is_online(status) && |
307 gaim_status_is_online(old_status)) { | 305 gaim_status_is_online(old_status)) { |
308 buddy->present = GAIM_BUDDY_SIGNING_OFF; | 306 buddy->present = GAIM_BUDDY_SIGNING_OFF; |
309 gaim_signal_emit(gaim_blist_get_handle(), "buddy-signed-off", buddy); | 307 gaim_signal_emit(gaim_blist_get_handle(), "buddy-signed-off", buddy); |
310 if (buddy->timer > 0) | 308 if (buddy->timer > 0) |
311 gaim_timeout_remove(buddy->timer); | 309 gaim_timeout_remove(buddy->timer); |
312 buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy); | 310 buddy->timer = gaim_timeout_add(10000, (GSourceFunc)presence_update_timeout_cb, buddy); |
313 did_something = TRUE; | |
314 | 311 |
315 } else if (gaim_status_is_available(status) && | 312 } else if (gaim_status_is_available(status) && |
316 !gaim_status_is_available(old_status)) { | 313 !gaim_status_is_available(old_status)) { |
317 gaim_signal_emit(gaim_blist_get_handle(), "buddy-back", buddy); | 314 gaim_signal_emit(gaim_blist_get_handle(), "buddy-back", buddy); |
318 did_something = TRUE; | |
319 | 315 |
320 } else if (!gaim_status_is_available(status) && | 316 } else if (!gaim_status_is_available(status) && |
321 gaim_status_is_available(old_status)) { | 317 gaim_status_is_available(old_status)) { |
322 gaim_signal_emit(gaim_blist_get_handle(), "buddy-away", buddy); | 318 gaim_signal_emit(gaim_blist_get_handle(), "buddy-away", buddy); |
323 did_something = TRUE; | 319 |
324 | 320 } |
325 } | 321 |
326 | 322 /* |
327 if (did_something) { | 323 * This function used to only call the following two functions if one of |
328 gaim_contact_compute_priority_buddy(gaim_buddy_get_contact(buddy)); | 324 * the above signals had been triggered, but that's not good, because |
329 if (ops && ops->update) | 325 * if someone's away message changes and they don't go from away to back |
330 ops->update(gaimbuddylist, (GaimBlistNode *)buddy); | 326 * to away then no signal is triggered. |
331 } | 327 * |
328 * It's a safe assumption that SOMETHING called this function. PROBABLY | |
329 * because something, somewhere changed. Calling the stuff below | |
330 * certainly won't hurt anything. Unless you're on a K6-2 300. | |
331 */ | |
332 gaim_contact_compute_priority_buddy(gaim_buddy_get_contact(buddy)); | |
333 if (ops && ops->update) | |
334 ops->update(gaimbuddylist, (GaimBlistNode *)buddy); | |
332 } | 335 } |
333 | 336 |
334 void gaim_blist_update_buddy_signon(GaimBuddy *buddy, time_t signon) | 337 void gaim_blist_update_buddy_signon(GaimBuddy *buddy, time_t signon) |
335 { | 338 { |
336 GaimBlistUiOps *ops = gaimbuddylist->ui_ops; | 339 GaimBlistUiOps *ops = gaimbuddylist->ui_ops; |