Skip to content

Commit

Permalink
Correctly serialize the window names.
Browse files Browse the repository at this point in the history
Use the visible_name instead of name when available.
Fixes the broken serialization of safe channels (irssi#183).
  • Loading branch information
LemonBoy committed Jan 12, 2016
1 parent 62cab9d commit 165b259
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/fe-common/core/windows-layout.c
Expand Up @@ -194,6 +194,7 @@ static void window_save_items(WINDOW_REC *window, CONFIG_NODE *node)
static void window_save(WINDOW_REC *window, CONFIG_NODE *node)
{
char refnum[MAX_INT_STRLEN];
char *visible_name;

ltoa(refnum, window->refnum);
node = iconfig_node_section(node, refnum, NODE_TYPE_BLOCK);
Expand All @@ -204,8 +205,11 @@ static void window_save(WINDOW_REC *window, CONFIG_NODE *node)
if (window->immortal)
iconfig_node_set_bool(node, "immortal", TRUE);

if (window->name != NULL)
iconfig_node_set_str(node, "name", window->name);
/* Save the visible name so that safe channels (as defined in RFC2811)
* are correctly serialized. */
visible_name = window_get_active_name(window);
if (visible_name != NULL)
iconfig_node_set_str(node, "name", visible_name);

if (window->history_name != NULL)
iconfig_node_set_str(node, "history_name", window->history_name);
Expand Down

0 comments on commit 165b259

Please sign in to comment.