From: <sa...@us...> - 2006-12-12 03:34:53
|
Revision: 17967 http://svn.sourceforge.net/gaim/?rev=17967&view=rev Author: sadrul Date: 2006-12-11 19:30:49 -0800 (Mon, 11 Dec 2006) Log Message: ----------- Fix auto-joining chatrooms. You don't need to keep the buddylist open for autojoins to work. Modified Paths: -------------- trunk/console/gntblist.c Modified: trunk/console/gntblist.c =================================================================== --- trunk/console/gntblist.c 2006-12-12 01:06:42 UTC (rev 17966) +++ trunk/console/gntblist.c 2006-12-12 03:30:49 UTC (rev 17967) @@ -109,6 +109,7 @@ static void savedstatus_changed(GaimSavedStatus *now, GaimSavedStatus *old); static void blist_show(GaimBuddyList *list); static void update_buddy_display(GaimBuddy *buddy, GGBlist *ggblist); +static void account_signed_on_cb(); /* Sort functions */ static int blist_node_compare_text(GaimBlistNode *n1, GaimBlistNode *n2); @@ -515,11 +516,6 @@ node->ui_data = gnt_tree_add_row_after(GNT_TREE(ggblist->tree), chat, gnt_tree_create_row(GNT_TREE(ggblist->tree), get_display_name(node)), group, NULL); - - /* XXX: This causes problem because you can close a chat window, hide the buddylist. - * When you show the buddylist, you automatically join the chat again. */ - if (gaim_blist_node_get_bool((GaimBlistNode*)chat, "gnt-autojoin")) - serv_join_chat(gaim_account_get_connection(chat->account), chat->components); } static void @@ -1587,6 +1583,8 @@ gaim_prefs_connect_callback(gg_blist_get_handle(), PREF_ROOT "/sort_type", redraw_blist, NULL); + gaim_signal_connect(gaim_connections_get_handle(), "signed-on", gaim_blist_get_handle(), + G_CALLBACK(account_signed_on_cb), NULL); return; } @@ -1945,6 +1943,21 @@ } } +static void +account_signed_on_cb() +{ + GaimBlistNode *node; + + for (node = gaim_blist_get_root(); node; + node = gaim_blist_node_next(node, FALSE)) { + if (GAIM_BLIST_NODE_IS_CHAT(node)) { + GaimChat *chat = (GaimChat*)node; + if (gaim_blist_node_get_bool(node, "gnt-autojoin")) + serv_join_chat(gaim_account_get_connection(chat->account), chat->components); + } + } +} + static void show_offline_cb(GntMenuItem *item, gpointer n) { gaim_prefs_set_bool(PREF_ROOT "/showoffline", This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |