From 2a7d572ff19dce2af2cf7c787a38210b519d5ac4 Mon Sep 17 00:00:00 2001 From: Sebastien Helleu Date: Tue, 14 Oct 2008 11:06:15 +0200 Subject: Fix restore of WeeChat main buffer after /upgrade --- src/core/wee-upgrade.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/core/wee-upgrade.c b/src/core/wee-upgrade.c index 3d32cdd2d..d093bec26 100644 --- a/src/core/wee-upgrade.c +++ b/src/core/wee-upgrade.c @@ -304,10 +304,17 @@ upgrade_weechat_read_cb (int object_id, } break; case UPGRADE_WEECHAT_TYPE_BUFFER: - /* create buffer if it was created by a plugin (ie not weechat - main buffer) */ - if (infolist_string (infolist, "plugin_name")) + if (!infolist_string (infolist, "plugin_name") + || (strcmp (infolist_string (infolist, "plugin_name"), + plugin_get_name (NULL)) == 0)) { + /* use WeeChat main buffer (plugin is "core") */ + upgrade_current_buffer = gui_buffers; + } + else + { + /* create buffer if it was created by a plugin (ie not + WeeChat main buffer) */ upgrade_current_buffer = gui_buffer_new ( NULL, infolist_string (infolist, "name"), @@ -351,8 +358,6 @@ upgrade_weechat_read_cb (int object_id, } } } - else - upgrade_current_buffer = gui_buffers; break; case UPGRADE_WEECHAT_TYPE_BUFFER_LINE: /* add line to current buffer */ -- cgit v1.2.3