# HG changeset patch # User Moos Heintzen # Date 1199550760 0 # Node ID 1494e0a0f2b9e363ff8b5bad12a9cc5a872cd0a2 # Parent 5c472f6aa03902a28cc60d80c6e6afb3ab65a4db Save the conversation "Enable Logging" option per-contact. committer: Richard Laager diff -r 5c472f6aa039 -r 1494e0a0f2b9 COPYRIGHT --- a/COPYRIGHT Thu Jan 03 20:28:16 2008 +0000 +++ b/COPYRIGHT Sat Jan 05 16:32:40 2008 +0000 @@ -167,6 +167,7 @@ Nick Hebner Mike Heffner Justin Heiner +Moos Heintzen Benjamin Herrenschmidt Fernando Herrera hjheins diff -r 5c472f6aa039 -r 1494e0a0f2b9 ChangeLog --- a/ChangeLog Thu Jan 03 20:28:16 2008 +0000 +++ b/ChangeLog Sat Jan 05 16:32:40 2008 +0000 @@ -12,8 +12,10 @@ * Added the ability to theme conversation name colors (red and blue) through your GTK+ theme, and exposed those theme settings to the Pidgin GTK+ Theme Control plugin (Dustin Howett) - * Fixed having multiple alias edit areas in the infopane (Elliott Sales de - Andrade) + * Fixed having multiple alias edit areas in the infopane (Elliott Sales + de Andrade) + * Save the conversation "Enable Logging" option per-contact (Moos + Heintzen) Finch: * Color is used in the buddylist to indicate status, and the conversation diff -r 5c472f6aa039 -r 1494e0a0f2b9 pidgin/gtkconv.c --- a/pidgin/gtkconv.c Thu Jan 03 20:28:16 2008 +0000 +++ b/pidgin/gtkconv.c Sat Jan 05 16:32:40 2008 +0000 @@ -1350,6 +1350,7 @@ PidginWindow *win = data; PurpleConversation *conv; gboolean logging; + PurpleBlistNode *node; conv = pidgin_conv_window_get_active_conversation(win); @@ -1360,6 +1361,8 @@ if (logging == purple_conversation_is_logging(conv)) return; + + node = get_conversation_blist_node(conv); if (logging) { @@ -1383,6 +1386,27 @@ /* Disable the logging second, so that the above message can be logged. */ purple_conversation_set_logging(conv, FALSE); } + + /* Save the setting IFF it's different than the pref. */ + switch (conv->type) + { + case PURPLE_CONV_TYPE_IM: + if (logging == purple_prefs_get_bool("/purple/logging/log_ims")) + purple_blist_node_remove_setting(node, "enable-logging"); + else + purple_blist_node_set_bool(node, "enable-logging", logging); + break; + + case PURPLE_CONV_TYPE_CHAT: + if (logging == purple_prefs_get_bool("/purple/logging/log_chats")) + purple_blist_node_remove_setting(node, "enable-logging"); + else + purple_blist_node_set_bool(node, "enable-logging", logging); + break; + + default: + break; + } } static void @@ -4907,6 +4931,7 @@ GtkWidget *pane = NULL; GtkWidget *tab_cont; PurpleBlistNode *convnode; + PurpleValue *value; if (conv_type == PURPLE_CONV_TYPE_IM && (gtkconv = pidgin_conv_find_gtkconv(conv))) { conv->ui_data = gtkconv; @@ -4994,6 +5019,13 @@ if (convnode == NULL || !purple_blist_node_get_bool(convnode, "gtk-mute-sound")) gtkconv->make_sound = TRUE; + if (convnode != NULL && + (value = g_hash_table_lookup(convnode->settings, "enable-logging")) && + purple_value_get_type(value) == PURPLE_TYPE_BOOLEAN) + { + purple_conversation_set_logging(conv, purple_value_get_boolean(value)); + } + if (purple_prefs_get_bool(PIDGIN_PREFS_ROOT "/conversations/show_formatting_toolbar")) gtk_widget_show(gtkconv->toolbar); else