Mercurial > pidgin
comparison src/dialogs.c @ 6742:d93c6a1fadf2
[gaim-migrate @ 7274]
this should let you delete contacts, and should make ChipX86 happy by telling
the prpls when we move buddies around
committer: Tailor Script <tailor@pidgin.im>
author | Nathan Walp <nwalp@pidgin.im> |
---|---|
date | Thu, 04 Sep 2003 18:40:40 +0000 |
parents | 0c5637b5462e |
children | 57a24492434b |
comparison
equal
deleted
inserted
replaced
6741:b3a0b79131dd | 6742:d93c6a1fadf2 |
---|---|
410 | 410 |
411 if (c != NULL) | 411 if (c != NULL) |
412 gaim_conversation_update(c, GAIM_CONV_UPDATE_REMOVE); | 412 gaim_conversation_update(c, GAIM_CONV_UPDATE_REMOVE); |
413 | 413 |
414 g_free(name); | 414 g_free(name); |
415 } | |
416 | |
417 static void do_remove_contact(GaimContact *c) | |
418 { | |
419 GaimBlistNode *bnode, *cnode; | |
420 GaimGroup *g; | |
421 | |
422 if(!c) | |
423 return; | |
424 | |
425 cnode = (GaimBlistNode *)c; | |
426 g = (GaimGroup*)cnode->parent; | |
427 for(bnode = cnode->child; bnode; bnode = bnode->next) { | |
428 GaimBuddy *b = (GaimBuddy*)bnode; | |
429 if(b->account->gc) | |
430 serv_remove_buddy(b->account->gc, b->name, g->name); | |
431 } | |
432 gaim_blist_remove_contact(c); | |
415 } | 433 } |
416 | 434 |
417 void do_remove_group(GaimGroup *g) | 435 void do_remove_group(GaimGroup *g) |
418 { | 436 { |
419 GaimBlistNode *cnode, *bnode; | 437 GaimBlistNode *cnode, *bnode; |
490 _("Cancel"), NULL); | 508 _("Cancel"), NULL); |
491 | 509 |
492 g_free(text); | 510 g_free(text); |
493 } | 511 } |
494 | 512 |
513 void show_confirm_del_contact(GaimContact *c) | |
514 { | |
515 GaimBuddy *b = gaim_contact_get_priority_buddy(c); | |
516 | |
517 if(!b) | |
518 return; | |
519 | |
520 if(((GaimBlistNode*)c)->child == (GaimBlistNode*)b && | |
521 !((GaimBlistNode*)b)->next) { | |
522 show_confirm_del(b); | |
523 } else { | |
524 char *text = g_strdup_printf(_("You are about to remove the contact containing %s and %d other buddies from your buddy list. Do you want to continue?"), | |
525 b->name, c->totalsize - 1); | |
526 | |
527 gaim_request_action(NULL, NULL, _("Remove Contact"), text, -1, c, 2, | |
528 _("Remove Contact"), G_CALLBACK(do_remove_contact), | |
529 _("Cancel"), NULL); | |
530 | |
531 g_free(text); | |
532 } | |
533 } | |
534 | |
495 /*------------------------------------------------------------------------*/ | 535 /*------------------------------------------------------------------------*/ |
496 /* The dialog for getting an error */ | 536 /* The dialog for getting an error */ |
497 /*------------------------------------------------------------------------*/ | 537 /*------------------------------------------------------------------------*/ |
498 static void do_im(GtkWidget *widget, int resp, struct getuserinfo *info) | 538 static void do_im(GtkWidget *widget, int resp, struct getuserinfo *info) |
499 { | 539 { |