comparison src/blist.c @ 9927:fb08a0973b3e

[gaim-migrate @ 10819] " Currently, the "loggedin" parameter of serv_got_update() is of type int and used as a boolean. I updated it and all references to be gboolean. I also noticed that "presence" in gaim_blist_update_buddy_presence() is also a really boolean. of whether or not the buddy is currently online. There seemed to be some confusion, particularly in the silc plugin which tried to use a GaimBuddyPresenceState (coincidentally (or perhaps not) GAIM_BUDDY_OFFLINE and GAIM_BUDDY_ONLINE work as FALSE and TRUE respectively). The value passed to gaim_blist_update_buddy_presence() doesn't directly become the buddy presence state and this patch helps avoid confusion in this respect." --Daniel Atallah committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Wed, 01 Sep 2004 01:07:42 +0000
parents b23e70bd1215
children 5d8d73c2eebe
comparison
equal deleted inserted replaced
9926:b23e70bd1215 9927:fb08a0973b3e
288 } 288 }
289 289
290 return FALSE; 290 return FALSE;
291 } 291 }
292 292
293 void gaim_blist_update_buddy_presence(GaimBuddy *buddy, int presence) 293 void gaim_blist_update_buddy_presence(GaimBuddy *buddy, gboolean online)
294 { 294 {
295 GaimBlistUiOps *ops = gaimbuddylist->ui_ops; 295 GaimBlistUiOps *ops = gaimbuddylist->ui_ops;
296 gboolean did_something = FALSE; 296 gboolean did_something = FALSE;
297 297
298 g_return_if_fail(buddy != NULL); 298 g_return_if_fail(buddy != NULL);
299 299
300 if (!GAIM_BUDDY_IS_ONLINE(buddy) && presence) { 300 if (!GAIM_BUDDY_IS_ONLINE(buddy) && online) {
301 int old_present = buddy->present; 301 int old_present = buddy->present;
302 buddy->present = GAIM_BUDDY_SIGNING_ON; 302 buddy->present = GAIM_BUDDY_SIGNING_ON;
303 gaim_signal_emit(gaim_blist_get_handle(), "buddy-signed-on", buddy); 303 gaim_signal_emit(gaim_blist_get_handle(), "buddy-signed-on", buddy);
304 did_something = TRUE; 304 did_something = TRUE;
305 305
306 if (old_present != GAIM_BUDDY_SIGNING_OFF) { 306 if (old_present != GAIM_BUDDY_SIGNING_OFF) {
307 ((GaimContact*)((GaimBlistNode*)buddy)->parent)->online++; 307 ((GaimContact*)((GaimBlistNode*)buddy)->parent)->online++;
308 if (((GaimContact*)((GaimBlistNode*)buddy)->parent)->online == 1) 308 if (((GaimContact*)((GaimBlistNode*)buddy)->parent)->online == 1)
309 ((GaimGroup *)((GaimBlistNode *)buddy)->parent->parent)->online++; 309 ((GaimGroup *)((GaimBlistNode *)buddy)->parent->parent)->online++;
310 } 310 }
311 } else if (GAIM_BUDDY_IS_ONLINE(buddy) && !presence) { 311 } else if (GAIM_BUDDY_IS_ONLINE(buddy) && !online) {
312 buddy->present = GAIM_BUDDY_SIGNING_OFF; 312 buddy->present = GAIM_BUDDY_SIGNING_OFF;
313 gaim_signal_emit(gaim_blist_get_handle(), "buddy-signed-off", buddy); 313 gaim_signal_emit(gaim_blist_get_handle(), "buddy-signed-off", buddy);
314 did_something = TRUE; 314 did_something = TRUE;
315 } 315 }
316 316