summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-config.c3
-rw-r--r--src/plugins/irc/irc-server.c10
2 files changed, 11 insertions, 2 deletions
diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c
index ccc7147ca..85539eb96 100644
--- a/src/plugins/irc/irc-config.c
+++ b/src/plugins/irc/irc-config.c
@@ -1875,7 +1875,8 @@ irc_config_server_new_option (struct t_config_file *config_file,
new_option = weechat_config_new_option (
config_file, section,
option_name, "string",
- N_("nicknames to use on server (separated by comma)"),
+ N_("nicknames to use on server (separated by comma) "
+ "(note: content is evaluated, see /help eval)"),
NULL, 0, 0,
default_value, value,
null_value_allowed,
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c
index 93d5e877f..ad2e8e38f 100644
--- a/src/plugins/irc/irc-server.c
+++ b/src/plugins/irc/irc-server.c
@@ -494,6 +494,8 @@ irc_server_set_index_current_address (struct t_irc_server *server, int index)
void
irc_server_set_nicks (struct t_irc_server *server, const char *nicks)
{
+ char *nicks2;
+
/* free data */
server->nicks_count = 0;
if (server->nicks_array)
@@ -502,10 +504,16 @@ irc_server_set_nicks (struct t_irc_server *server, const char *nicks)
server->nicks_array = NULL;
}
+ /* evaluate value */
+ nicks2 = weechat_string_eval_expression (nicks, NULL, NULL, NULL);
+
/* set new nicks */
server->nicks_array = weechat_string_split (
- (nicks) ? nicks : IRC_SERVER_DEFAULT_NICKS,
+ (nicks2) ? nicks2 : IRC_SERVER_DEFAULT_NICKS,
",", 0, 0, &server->nicks_count);
+
+ if (nicks2)
+ free (nicks2);
}
/*