# HG changeset patch # User Richard Laager # Date 1135071356 0 # Node ID 1246935dd047b4992b0f64b918e004e66fed8e32 # Parent 9b0187ba0ec00761d2c35d651d555ed363f2386f [gaim-migrate @ 14898] Attempting to join a chat you're already in should present the chat. committer: Tailor Script diff -r 9b0187ba0ec0 -r 1246935dd047 src/gtkblist.c --- a/src/gtkblist.c Tue Dec 20 07:07:53 2005 +0000 +++ b/src/gtkblist.c Tue Dec 20 09:35:56 2005 +0000 @@ -270,9 +270,23 @@ gtk_check_menu_item_get_active(GTK_CHECK_MENU_ITEM(w))); } +static void gtk_blist_join_chat(GaimChat *chat) +{ + GaimConversation *conv; + + conv = gaim_find_conversation_with_account(GAIM_CONV_TYPE_CHAT, + gaim_chat_get_name(chat), + chat->account); + + if (conv != NULL) + gaim_gtkconv_present_conversation(conv); + else + serv_join_chat(chat->account->gc, chat->components); +} + static void gtk_blist_menu_join_cb(GtkWidget *w, GaimChat *chat) { - serv_join_chat(chat->account->gc, chat->components); + gtk_blist_join_chat(chat); } static void gtk_blist_renderer_edited_cb(GtkCellRendererText *text_rend, char *arg1, @@ -434,6 +448,7 @@ GHashTable *components = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, g_free); GList *tmp; + GaimChat *chat; for (tmp = data->entries; tmp != NULL; tmp = tmp->next) { @@ -452,9 +467,9 @@ } } - serv_join_chat(gaim_account_get_connection(data->account), components); - - g_hash_table_destroy(components); + chat = gaim_chat_new(data->account, NULL, components); + gtk_blist_join_chat(chat); + gaim_blist_remove_chat(chat); } } @@ -768,7 +783,7 @@ gaim_gtkdialogs_im_with_user(buddy->account, buddy->name); } else if (GAIM_BLIST_NODE_IS_CHAT(node)) { - serv_join_chat(((GaimChat *)node)->account->gc, ((GaimChat *)node)->components); + gtk_blist_join_chat((GaimChat *)node); } else if (GAIM_BLIST_NODE_IS_GROUP(node)) { if (gtk_tree_view_row_expanded(tv, path)) gtk_tree_view_collapse_row(tv, path);