diff options
author | Simmo Saan <simmo.saan@gmail.com> | 2015-11-18 19:49:10 +0200 |
---|---|---|
committer | Simmo Saan <simmo.saan@gmail.com> | 2017-06-17 18:38:37 +0300 |
commit | d12e29620b8ec2e6cfda047ec7f67762e1e07c67 (patch) | |
tree | 90e451d1a2aac928f5c48916d5f116ea92d82503 /src | |
parent | 48a3baedd5119798cbc0030eb4ea0ff661f58cbb (diff) | |
download | weechat-d12e29620b8ec2e6cfda047ec7f67762e1e07c67.zip |
irc: make command characters optional in server's command option
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/irc/irc-protocol.c | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/src/plugins/irc/irc-protocol.c b/src/plugins/irc/irc-protocol.c index 67b0109cd..72bfb1776 100644 --- a/src/plugins/irc/irc-protocol.c +++ b/src/plugins/irc/irc-protocol.c @@ -2455,7 +2455,7 @@ IRC_PROTOCOL_CALLBACK(wallops) IRC_PROTOCOL_CALLBACK(001) { char *server_command, **commands, **ptr_command, *vars_replaced, *away_msg; - char *usermode; + char *usermode, *slash_command; IRC_PROTOCOL_MIN_ARGS(3); @@ -2523,8 +2523,23 @@ IRC_PROTOCOL_CALLBACK(001) { vars_replaced = irc_message_replace_vars (server, NULL, *ptr_command); - weechat_command (server->buffer, - (vars_replaced) ? vars_replaced : *ptr_command); + if (weechat_string_is_command_char (*ptr_command)) + { + weechat_command (server->buffer, + (vars_replaced) ? vars_replaced : *ptr_command); + } + else + { + slash_command = malloc (1 + strlen((vars_replaced) ? vars_replaced : *ptr_command) + 1); + if (slash_command) + { + strcpy (slash_command, "/"); + strcat (slash_command, (vars_replaced) ? vars_replaced : *ptr_command); + weechat_command (server->buffer, slash_command); + free (slash_command); + } + } + if (vars_replaced) free (vars_replaced); } |