Mercurial > pidgin
comparison src/buddy.c @ 1083:12478dd1e9d7
[gaim-migrate @ 1093]
yeah
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sat, 11 Nov 2000 06:57:57 +0000 |
parents | efcacae6acdb |
children | 8da0bf36fb99 |
comparison
equal
deleted
inserted
replaced
1082:13df4e342cff | 1083:12478dd1e9d7 |
---|---|
268 remove_group = FALSE; | 268 remove_group = FALSE; |
269 g = (struct group_show *)s->data; | 269 g = (struct group_show *)s->data; |
270 m = g->members; | 270 m = g->members; |
271 while (m) { | 271 while (m) { |
272 b = (struct buddy_show *)m->data; | 272 b = (struct buddy_show *)m->data; |
273 if (g_slist_length(b->connlist) == 1 && b->connlist->data == gc) { | 273 if ((g_slist_length(b->connlist) == 1) && (b->connlist->data == gc)) { |
274 if (b->log_timer > 0) | 274 if (b->log_timer > 0) |
275 gtk_timeout_remove(b->log_timer); | 275 gtk_timeout_remove(b->log_timer); |
276 b->connlist = g_slist_remove(b->connlist, gc); | 276 b->connlist = g_slist_remove(b->connlist, gc); |
277 gtk_container_remove(GTK_CONTAINER(g->tree), b->item); | 277 gtk_container_remove(GTK_CONTAINER(g->tree), b->item); |
278 g->members = g_slist_remove(g->members, b); | 278 m = g->members = g_slist_remove(g->members, b); |
279 if (g->members == NULL) { | 279 if ((g->members == NULL) && (display_options & OPT_DISP_NO_MT_GRP)) { |
280 shows = g_slist_remove(shows, g); | 280 shows = g_slist_remove(shows, g); |
281 gtk_container_remove(GTK_CONTAINER(buddies), g->item); | 281 gtk_container_remove(GTK_CONTAINER(buddies), g->item); |
282 g_free(g->name); | 282 g_free(g->name); |
283 g_free(g); | 283 g_free(g); |
284 m = NULL; | 284 m = NULL; |
285 remove_group = TRUE; | 285 remove_group = TRUE; |
286 } else | 286 } else |
287 m = g->members; | 287 update_num_group(g); |
288 g_free(b->name); | 288 g_free(b->name); |
289 g_free(b->show); | 289 g_free(b->show); |
290 g_free(b); | 290 g_free(b); |
291 } else if (g_slist_find(b->connlist, gc)) { | 291 } else if (g_slist_find(b->connlist, gc)) { |
292 b->connlist = g_slist_remove(b->connlist, gc); | 292 if (g_slist_find(b->connlist, gc)) |
293 b->connlist = g_slist_remove(b->connlist, gc); | |
293 m = g_slist_next(m); | 294 m = g_slist_next(m); |
294 } else | 295 } else |
295 m = g_slist_next(m); | 296 m = g_slist_next(m); |
296 } | 297 } |
297 if (remove_group) | 298 if (remove_group) |
489 if (gs) { | 490 if (gs) { |
490 bs = find_buddy_show(gs, rem_b->name); | 491 bs = find_buddy_show(gs, rem_b->name); |
491 if (bs) { | 492 if (bs) { |
492 if (g_slist_find(bs->connlist, gc)) { | 493 if (g_slist_find(bs->connlist, gc)) { |
493 bs->connlist = g_slist_remove(bs->connlist, gc); | 494 bs->connlist = g_slist_remove(bs->connlist, gc); |
494 update_num_group(gs); | |
495 if (!g_slist_length(bs->connlist)) { | 495 if (!g_slist_length(bs->connlist)) { |
496 gs->members = g_slist_remove(gs->members, bs); | 496 gs->members = g_slist_remove(gs->members, bs); |
497 if (bs->log_timer > 0) | 497 if (bs->log_timer > 0) |
498 gtk_timeout_remove(bs->log_timer); | 498 gtk_timeout_remove(bs->log_timer); |
499 gtk_container_remove(GTK_CONTAINER(gs->tree), bs->item); | 499 gtk_container_remove(GTK_CONTAINER(gs->tree), bs->item); |
500 g_free(bs->show); | 500 g_free(bs->show); |
501 g_free(bs->name); | 501 g_free(bs->name); |
502 g_free(bs); | 502 g_free(bs); |
503 if (!g_slist_length(gs->members)) { | 503 if (!g_slist_length(gs->members) && |
504 (display_options & OPT_DISP_NO_MT_GRP)) { | |
504 shows = g_slist_remove(shows, gs); | 505 shows = g_slist_remove(shows, gs); |
505 gtk_container_remove(GTK_CONTAINER(buddies), gs->item); | 506 gtk_container_remove(GTK_CONTAINER(buddies), gs->item); |
506 g_free(gs->name); | 507 g_free(gs->name); |
507 g_free(gs); | 508 g_free(gs); |
508 } | 509 } else |
509 } | 510 update_num_group(gs); |
511 } else | |
512 update_num_group(gs); | |
510 } | 513 } |
511 } | 514 } |
512 } | 515 } |
513 | 516 |
514 grp = g_slist_find(gc->groups, rem_g); | 517 grp = g_slist_find(gc->groups, rem_g); |
547 delg = (struct group *)grp->data; | 550 delg = (struct group *)grp->data; |
548 mem = delg->members; | 551 mem = delg->members; |
549 | 552 |
550 while(delg->members) { | 553 while(delg->members) { |
551 delb = (struct buddy *)delg->members->data; | 554 delb = (struct buddy *)delg->members->data; |
552 remove_buddy(gc, delg, delb); | 555 remove_buddy(gc, delg, delb); /* this should take care of removing |
556 the group_show if necessary */ | |
553 serv_remove_buddy(gc, delb->name); | 557 serv_remove_buddy(gc, delb->name); |
554 } | 558 } |
555 | 559 |
556 gc->groups = g_slist_remove(gc->groups, delg); | 560 gc->groups = g_slist_remove(gc->groups, delg); |
557 g_free(delg); | 561 g_free(delg); |
1527 static int log_timeout(struct buddy_show *b) { | 1531 static int log_timeout(struct buddy_show *b) { |
1528 if (!b->connlist) { | 1532 if (!b->connlist) { |
1529 struct group_show *g = find_gs_by_bs(b); | 1533 struct group_show *g = find_gs_by_bs(b); |
1530 g->members = g_slist_remove(g->members, b); | 1534 g->members = g_slist_remove(g->members, b); |
1531 gtk_container_remove(GTK_CONTAINER(g->tree), b->item); | 1535 gtk_container_remove(GTK_CONTAINER(g->tree), b->item); |
1532 if (g->members == NULL && (display_options & OPT_DISP_NO_MT_GRP)) { | 1536 if ((g->members == NULL) && (display_options & OPT_DISP_NO_MT_GRP)) { |
1533 shows = g_slist_remove(shows, g); | 1537 shows = g_slist_remove(shows, g); |
1534 gtk_container_remove(GTK_CONTAINER(buddies), g->item); | 1538 gtk_container_remove(GTK_CONTAINER(buddies), g->item); |
1535 g_free(g->name); | 1539 g_free(g->name); |
1536 g_free(g); | 1540 g_free(g); |
1537 } | 1541 } else |
1542 update_num_group(g); | |
1538 g_free(b->name); | 1543 g_free(b->name); |
1539 g_free(b->show); | 1544 g_free(b->show); |
1540 g_free(b); | 1545 g_free(b); |
1541 } else { | 1546 } else { |
1542 /* um.... what do we have to do here? just update the pixmap? */ | 1547 /* um.... what do we have to do here? just update the pixmap? */ |