summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/irc/irc-protocol.c21
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);
}