comparison src/buddy.c @ 1081:efcacae6acdb

[gaim-migrate @ 1091] libfaim connects non-blocking committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Fri, 10 Nov 2000 22:49:02 +0000
parents 7221054ad2b1
children 12478dd1e9d7
comparison
equal deleted inserted replaced
1080:e6637ff33957 1081:efcacae6acdb
260 static void destroy_buddies(struct gaim_connection *gc) { 260 static void destroy_buddies(struct gaim_connection *gc) {
261 GSList *s = shows; 261 GSList *s = shows;
262 struct group_show *g; 262 struct group_show *g;
263 GSList *m; 263 GSList *m;
264 struct buddy_show *b; 264 struct buddy_show *b;
265 gboolean remove_group;
265 266
266 while (s) { 267 while (s) {
267 gboolean remove_group = FALSE; 268 remove_group = FALSE;
268 g = (struct group_show *)s->data; 269 g = (struct group_show *)s->data;
269 m = g->members; 270 m = g->members;
270 while (m) { 271 while (m) {
271 b = (struct buddy_show *)m->data; 272 b = (struct buddy_show *)m->data;
272 if (g_slist_length(b->connlist) == 1 && b->connlist->data == gc) { 273 if (g_slist_length(b->connlist) == 1 && b->connlist->data == gc) {
285 } else 286 } else
286 m = g->members; 287 m = g->members;
287 g_free(b->name); 288 g_free(b->name);
288 g_free(b->show); 289 g_free(b->show);
289 g_free(b); 290 g_free(b);
290 } else { 291 } else if (g_slist_find(b->connlist, gc)) {
291 b->connlist = g_slist_remove(b->connlist, gc); 292 b->connlist = g_slist_remove(b->connlist, gc);
292 m = g_slist_next(m); 293 m = g_slist_next(m);
293 } 294 } else
295 m = g_slist_next(m);
294 } 296 }
295 if (remove_group) 297 if (remove_group)
296 s = shows; 298 s = shows;
297 else 299 else
298 s = g_slist_next(s); 300 s = g_slist_next(s);
314 316
315 void signoff(struct gaim_connection *gc) 317 void signoff(struct gaim_connection *gc)
316 { 318 {
317 destroy_buddies(gc); 319 destroy_buddies(gc);
318 plugin_event(event_signoff, gc, 0, 0, 0); 320 plugin_event(event_signoff, gc, 0, 0, 0);
321 update_keepalive(gc, FALSE);
319 serv_close(gc); 322 serv_close(gc);
320 323
321 if (connections) return; 324 if (connections) return;
322 325
323 sprintf(debug_buff, "date: %s\n", full_date()); 326 sprintf(debug_buff, "date: %s\n", full_date());
324 debug_print(debug_buff); 327 debug_print(debug_buff);
325 update_keepalive(gc, FALSE);
326 destroy_all_dialogs(); 328 destroy_all_dialogs();
327 destroy_buddy(); 329 destroy_buddy();
328 #ifdef USE_APPLET 330 #ifdef USE_APPLET
329 set_user_state(offline); 331 set_user_state(offline);
330 applet_buddy_show = FALSE; 332 applet_buddy_show = FALSE;