diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2010-04-03 16:52:37 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2010-04-03 16:52:37 +0200 |
commit | 915d4801f65c470dc1deb4dc1f96a3c749f18c42 (patch) | |
tree | 65ad1ee0301aac6a684b661bf32fbce43e66a17d /src | |
parent | df0d408ce973f6a14c41044b044ff6a8845ca901 (diff) | |
download | weechat-915d4801f65c470dc1deb4dc1f96a3c749f18c42.zip |
Change buffer properties only when buffer is created by IRC plugin (channels and raw buffer), do not change them after /upgrade
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-channel.c | 40 | ||||
-rw-r--r-- | src/plugins/irc/irc-raw.c | 31 |
2 files changed, 38 insertions, 33 deletions
diff --git a/src/plugins/irc/irc-channel.c b/src/plugins/irc/irc-channel.c index 77272952b..3cf20f143 100644 --- a/src/plugins/irc/irc-channel.c +++ b/src/plugins/irc/irc-channel.c @@ -185,26 +185,33 @@ irc_channel_new (struct t_irc_server *server, int channel_type, buffer_created = 1; } - weechat_buffer_set (new_buffer, "short_name", channel_name); - weechat_buffer_set (new_buffer, "localvar_set_type", - (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? "channel" : "private"); - weechat_buffer_set (new_buffer, "localvar_set_nick", server->nick); - weechat_buffer_set (new_buffer, "localvar_set_server", server->name); - weechat_buffer_set (new_buffer, "localvar_set_channel", channel_name); - if (buffer_created) { + weechat_buffer_set (new_buffer, "short_name", channel_name); + weechat_buffer_set (new_buffer, "localvar_set_type", + (channel_type == IRC_CHANNEL_TYPE_CHANNEL) ? "channel" : "private"); + weechat_buffer_set (new_buffer, "localvar_set_nick", server->nick); + weechat_buffer_set (new_buffer, "localvar_set_server", server->name); + weechat_buffer_set (new_buffer, "localvar_set_channel", channel_name); weechat_hook_signal_send ("logger_backlog", WEECHAT_HOOK_SIGNAL_POINTER, new_buffer); + if (weechat_config_boolean (irc_config_network_send_unknown_commands)) + weechat_buffer_set (new_buffer, "input_get_unknown_commands", "1"); + weechat_buffer_set (new_buffer, "nicklist", "1"); + weechat_buffer_set (new_buffer, "nicklist_display_groups", "0"); + + /* set highlights settings on channel buffer */ + weechat_buffer_set (new_buffer, "highlight_words", server->nick); + if (weechat_config_string (irc_config_look_highlight_tags) + && weechat_config_string (irc_config_look_highlight_tags)[0]) + { + weechat_buffer_set (new_buffer, "highlight_tags", + weechat_config_string (irc_config_look_highlight_tags)); + } } - if (weechat_config_boolean (irc_config_network_send_unknown_commands)) - weechat_buffer_set (new_buffer, "input_get_unknown_commands", "1"); - if (channel_type == IRC_CHANNEL_TYPE_CHANNEL) { - weechat_buffer_set (new_buffer, "nicklist", "1"); - weechat_buffer_set (new_buffer, "nicklist_display_groups", "0"); weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_CHANOWNER, "weechat.color.nicklist_group", 1); weechat_nicklist_add_group (new_buffer, NULL, IRC_NICK_GROUP_CHANADMIN, @@ -223,15 +230,6 @@ irc_channel_new (struct t_irc_server *server, int channel_type, "weechat.color.nicklist_group", 1); } - /* set highlights settings on channel buffer */ - weechat_buffer_set (new_buffer, "highlight_words", server->nick); - if (weechat_config_string (irc_config_look_highlight_tags) - && weechat_config_string (irc_config_look_highlight_tags)[0]) - { - weechat_buffer_set (new_buffer, "highlight_tags", - weechat_config_string (irc_config_look_highlight_tags)); - } - /* initialize new channel */ new_channel->type = channel_type; new_channel->name = strdup (channel_name); diff --git a/src/plugins/irc/irc-raw.c b/src/plugins/irc/irc-raw.c index 48c90bd2f..e5c0cac51 100644 --- a/src/plugins/irc/irc-raw.c +++ b/src/plugins/irc/irc-raw.c @@ -65,6 +65,9 @@ void irc_raw_open (int switch_to_buffer) { struct t_irc_raw_message *ptr_raw_message; + int buffer_created; + + buffer_created = 0; if (!irc_raw_buffer) { @@ -75,22 +78,26 @@ irc_raw_open (int switch_to_buffer) irc_raw_buffer = weechat_buffer_new (IRC_RAW_BUFFER_NAME, &irc_input_data_cb, NULL, &irc_buffer_close_cb, NULL); + buffer_created = 1; /* failed to create buffer ? then return */ if (!irc_raw_buffer) return; - - weechat_buffer_set (irc_raw_buffer, - "title", _("IRC raw messages")); - - weechat_buffer_set (irc_raw_buffer, "short_name", IRC_RAW_BUFFER_NAME); - weechat_buffer_set (irc_raw_buffer, "localvar_set_type", "debug"); - weechat_buffer_set (irc_raw_buffer, "localvar_set_server", IRC_RAW_BUFFER_NAME); - weechat_buffer_set (irc_raw_buffer, "localvar_set_channel", IRC_RAW_BUFFER_NAME); - weechat_buffer_set (irc_raw_buffer, "localvar_set_no_log", "1"); - - /* disable all highlights on this debug buffer */ - weechat_buffer_set (irc_raw_buffer, "highlight_words", "-"); + + if (buffer_created) + { + weechat_buffer_set (irc_raw_buffer, + "title", _("IRC raw messages")); + + weechat_buffer_set (irc_raw_buffer, "short_name", IRC_RAW_BUFFER_NAME); + weechat_buffer_set (irc_raw_buffer, "localvar_set_type", "debug"); + weechat_buffer_set (irc_raw_buffer, "localvar_set_server", IRC_RAW_BUFFER_NAME); + weechat_buffer_set (irc_raw_buffer, "localvar_set_channel", IRC_RAW_BUFFER_NAME); + weechat_buffer_set (irc_raw_buffer, "localvar_set_no_log", "1"); + + /* disable all highlights on this debug buffer */ + weechat_buffer_set (irc_raw_buffer, "highlight_words", "-"); + } if (switch_to_buffer) weechat_buffer_set (irc_raw_buffer, "display", "1"); |