summaryrefslogtreecommitdiff
path: root/src/core/session.c
diff options
context:
space:
mode:
authorTimo Sirainen <cras@irssi.org>2002-05-16 00:34:37 +0000
committercras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564>2002-05-16 00:34:37 +0000
commitd346fbe1a9c6615c88dfacc420f0256b5a751440 (patch)
tree2afa5956d03f670310bb45e019c2259b2ba46a10 /src/core/session.c
parentee80e7601a0e664525cfc1f47bf90f30c93512d4 (diff)
downloadirssi-d346fbe1a9c6615c88dfacc420f0256b5a751440.zip
Better !channel support - window items now have "visual_name" and channels
and queries also have "name". Normally they're identical but with !channels the visible_name contains the short !channel name, while name contains full !ABCDEchannel name. The visible_name should be used whenever displaying the channel name, or as printtext()'s target. So, this breaks a few scripts in !channels, they need to be modified to use $channel->{visible_name} instead. Also /LAYOUT SAVE should finally work properly with !channels. git-svn-id: http://svn.irssi.org/repos/irssi/trunk@2797 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src/core/session.c')
-rw-r--r--src/core/session.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/core/session.c b/src/core/session.c
index b5419134..4e7a832c 100644
--- a/src/core/session.c
+++ b/src/core/session.c
@@ -146,6 +146,7 @@ static void session_save_channel(CHANNEL_REC *channel, CONFIG_REC *config,
node = config_node_section(node, NULL, NODE_TYPE_BLOCK);
config_node_set_str(config, node, "name", channel->name);
+ config_node_set_str(config, node, "visible_name", channel->visible_name);
config_node_set_str(config, node, "topic", channel->topic);
config_node_set_str(config, node, "topic_by", channel->topic_by);
config_node_set_int(config, node, "topic_time", channel->topic_time);
@@ -215,13 +216,14 @@ static void session_restore_channel_nicks(CHANNEL_REC *channel,
static void session_restore_channel(SERVER_REC *server, CONFIG_NODE *node)
{
CHANNEL_REC *channel;
- const char *name;
+ const char *name, *visible_name;
name = config_node_get_str(node, "name", NULL);
if (name == NULL)
return;
- channel = CHAT_PROTOCOL(server)->channel_create(server, name, TRUE);
+ visible_name = config_node_get_str(node, "visible_name", NULL);
+ channel = CHAT_PROTOCOL(server)->channel_create(server, name, visible_name, TRUE);
channel->topic = g_strdup(config_node_get_str(node, "topic", NULL));
channel->topic_by = g_strdup(config_node_get_str(node, "topic_by", NULL));
channel->topic_time = config_node_get_int(node, "topic_time", 0);