comparison src/dialogs.c @ 6640:314111e7b601

[gaim-migrate @ 7165] Changed several calls from gaim_find_conversation() to gaim_find_conversation_with_account(). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Thu, 28 Aug 2003 01:18:50 +0000
parents 156e6643f9db
children b89d98f0bf79
comparison
equal deleted inserted replaced
6639:1b91cb6be4c3 6640:314111e7b601
323 { 323 {
324 char *labeltext; 324 char *labeltext;
325 GtkWidget *hbox, *vbox; 325 GtkWidget *hbox, *vbox;
326 GtkWidget *label; 326 GtkWidget *label;
327 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG); 327 GtkWidget *img = gtk_image_new_from_stock(GAIM_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_DIALOG);
328 GaimConversation *c = gaim_find_conversation(who); 328 GaimConversation *c = gaim_find_conversation_with_account(who, gc->account);
329 329
330 struct warning *w = g_new0(struct warning, 1); 330 struct warning *w = g_new0(struct warning, 1);
331 w->who = who; 331 w->who = who;
332 w->gc = gc; 332 w->gc = gc;
333 333
390 do_remove_buddy(struct buddy *b) 390 do_remove_buddy(struct buddy *b)
391 { 391 {
392 struct group *g; 392 struct group *g;
393 GaimConversation *c; 393 GaimConversation *c;
394 gchar *name; 394 gchar *name;
395 GaimAccount *account;
395 396
396 if (!b) 397 if (!b)
397 return; 398 return;
398 399
399 g = gaim_find_buddys_group(b); 400 g = gaim_find_buddys_group(b);
400 name = g_strdup(b->name); /* b->name is null after remove_buddy */ 401 name = g_strdup(b->name); /* b->name is a crasher after remove_buddy */
402 account = b->account;
401 403
402 gaim_debug(GAIM_DEBUG_INFO, "blist", 404 gaim_debug(GAIM_DEBUG_INFO, "blist",
403 "Removing '%s' from buddy list.\n", b->name); 405 "Removing '%s' from buddy list.\n", b->name);
404 serv_remove_buddy(b->account->gc, name, g->name); 406 serv_remove_buddy(b->account->gc, name, g->name);
405 gaim_blist_remove_buddy(b); 407 gaim_blist_remove_buddy(b);
406 gaim_blist_save(); 408 gaim_blist_save();
407 409
408 c = gaim_find_conversation(name); 410 c = gaim_find_conversation_with_account(name, account);
409 411
410 if (c != NULL) 412 if (c != NULL)
411 gaim_conversation_update(c, GAIM_CONV_UPDATE_REMOVE); 413 gaim_conversation_update(c, GAIM_CONV_UPDATE_REMOVE);
412 414
413 g_free(name); 415 g_free(name);
417 { 419 {
418 GaimBlistNode *b = ((GaimBlistNode*)g)->child; 420 GaimBlistNode *b = ((GaimBlistNode*)g)->child;
419 while (b) { 421 while (b) {
420 if(GAIM_BLIST_NODE_IS_BUDDY(b)) { 422 if(GAIM_BLIST_NODE_IS_BUDDY(b)) {
421 struct buddy *bd = (struct buddy *)b; 423 struct buddy *bd = (struct buddy *)b;
422 GaimConversation *c = gaim_find_conversation(bd->name); 424 GaimConversation *c = gaim_find_conversation_with_account(bd->name, bd->account);
423 if (gaim_account_is_connected(bd->account)) { 425 if (gaim_account_is_connected(bd->account)) {
424 serv_remove_buddy(bd->account->gc, bd->name, g->name); 426 serv_remove_buddy(bd->account->gc, bd->name, g->name);
425 gaim_blist_remove_buddy(bd); 427 gaim_blist_remove_buddy(bd);
426 428
427 if (c != NULL) 429 if (c != NULL)
496 return; 498 return;
497 } 499 }
498 500
499 account = (info->gc ? info->gc->account : NULL); 501 account = (info->gc ? info->gc->account : NULL);
500 502
501 conv = gaim_find_conversation(who); 503 conv = gaim_find_conversation_with_account(who, account);
502 504
503 if (conv == NULL) 505 if (conv == NULL)
504 conv = gaim_conversation_new(GAIM_CONV_IM, account, who); 506 conv = gaim_conversation_new(GAIM_CONV_IM, account, who);
505 else { 507 else {
506 gaim_window_raise(gaim_conversation_get_window(conv)); 508 gaim_window_raise(gaim_conversation_get_window(conv));
507
508 if (account)
509 gaim_conversation_set_account(conv, account);
510 } 509 }
511 } 510 }
512 511
513 destroy_dialog(NULL, imdialog); 512 destroy_dialog(NULL, imdialog);
514 imdialog = NULL; 513 imdialog = NULL;
789 788
790 who = gtk_entry_get_text(GTK_ENTRY(a->entry)); 789 who = gtk_entry_get_text(GTK_ENTRY(a->entry));
791 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry)); 790 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry));
792 whoalias = gtk_entry_get_text(GTK_ENTRY(a->entry_for_alias)); 791 whoalias = gtk_entry_get_text(GTK_ENTRY(a->entry_for_alias));
793 792
794 c = gaim_find_conversation(who); 793 c = gaim_find_conversation_with_account(who, a->gc->account);
795 if (!(g = gaim_find_group(grp))) { 794 if (!(g = gaim_find_group(grp))) {
796 g = gaim_group_new(grp); 795 g = gaim_group_new(grp);
797 gaim_blist_add_group(g, NULL); 796 gaim_blist_add_group(g, NULL);
798 } 797 }
799 b = gaim_buddy_new(a->gc->account, who, whoalias); 798 b = gaim_buddy_new(a->gc->account, who, whoalias);