comparison mcabber/src/roster.c @ 81:0bd578421ce9

[/trunk] Changeset 95 by mikael * Switch from buddies.* to roster.* Seems to work fine...
author mikael
date Sat, 16 Apr 2005 22:28:55 +0000
parents 7fb661f19a77
children d39f15683c34
comparison
equal deleted inserted replaced
80:7fb661f19a77 81:0bd578421ce9
245 // Creates the buddylist from the roster entries. 245 // Creates the buddylist from the roster entries.
246 void buddylist_build(void) 246 void buddylist_build(void)
247 { 247 {
248 GSList *sl_roster_elt = groups; 248 GSList *sl_roster_elt = groups;
249 roster *roster_elt; 249 roster *roster_elt;
250 roster *roster_current_buddy = NULL;
250 int pending_group; 251 int pending_group;
252
253 // We need to remember which buddy is selected.
254 if (current_buddy)
255 roster_current_buddy = BUDDATA(current_buddy);
256 current_buddy = NULL;
251 257
252 // Destroy old buddylist 258 // Destroy old buddylist
253 if (buddylist) { 259 if (buddylist) {
254 g_list_free(buddylist); 260 g_list_free(buddylist);
255 buddylist = NULL; 261 buddylist = NULL;
294 sl_roster_usrelt = g_slist_next(sl_roster_usrelt); 300 sl_roster_usrelt = g_slist_next(sl_roster_usrelt);
295 } 301 }
296 sl_roster_elt = g_slist_next(sl_roster_elt); 302 sl_roster_elt = g_slist_next(sl_roster_elt);
297 } 303 }
298 304
305 // Check if we can find our saved current_buddy...
306 if (roster_current_buddy)
307 current_buddy = g_list_find(buddylist, roster_current_buddy);
299 // current_buddy initialization 308 // current_buddy initialization
300 if (!current_buddy || (g_list_position(buddylist, current_buddy) == -1)) 309 if (!current_buddy || (g_list_position(buddylist, current_buddy) == -1))
301 current_buddy = buddylist; 310 current_buddy = g_list_first(buddylist);
302 } 311 }
303 312
304 // buddy_hide_group(roster, hide) 313 // buddy_hide_group(roster, hide)
305 // "hide" values: 1=hide 0=show_all -1=invert 314 // "hide" values: 1=hide 0=show_all -1=invert
306 void buddy_hide_group(gpointer rosterdata, int hide) 315 void buddy_hide_group(gpointer rosterdata, int hide)