summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2008-10-14 11:06:15 +0200
committerSebastien Helleu <flashcode@flashtux.org>2008-10-14 11:06:15 +0200
commit2a7d572ff19dce2af2cf7c787a38210b519d5ac4 (patch)
tree8f236c0179f3be447113cfe6afff819fa4c5268e
parent1bb38a732ae88e22b0547c85f5ffd1590e628aab (diff)
downloadweechat-2a7d572ff19dce2af2cf7c787a38210b519d5ac4.zip
Fix restore of WeeChat main buffer after /upgrade
-rw-r--r--src/core/wee-upgrade.c15
1 files 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 */