mirror of
https://github.com/weechat/weechat.git
synced 2026-06-26 12:56:37 +02:00
Prefix '/' disabled in commands (patch #5769)
This commit is contained in:
@@ -5,6 +5,7 @@ ChangeLog - 2007-03-01
|
||||
|
||||
|
||||
Version 0.2.4 (under dev!):
|
||||
* prefix '/' disabled in commands (patch #5769)
|
||||
* fixed completion of redefined commands removed by plugins (bug #19176)
|
||||
* fixed memory leaks in perl and python plugins (bug #19163)
|
||||
* added "call" option to /key command, added new key function "insert" to
|
||||
|
||||
+17
-1
@@ -782,6 +782,22 @@ user_message (t_irc_server *server, t_gui_buffer *buffer, char *text)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* is_command: return 1 if line is a command, 0 otherwise
|
||||
*/
|
||||
|
||||
int
|
||||
is_command (char *line)
|
||||
{
|
||||
char *pos_slash, *pos_space;
|
||||
|
||||
pos_slash = strchr (line + 1, '/');
|
||||
pos_space = strchr (line + 1, ' ');
|
||||
|
||||
return (line[0] == '/')
|
||||
&& (!pos_slash || (pos_space && pos_slash > pos_space));
|
||||
}
|
||||
|
||||
/*
|
||||
* user_command: interprets user command (if beginning with '/')
|
||||
* any other text is sent to the server, if connected
|
||||
@@ -826,7 +842,7 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o
|
||||
|
||||
irc_find_context (server, channel, NULL, &buffer);
|
||||
|
||||
if ((ptr_cmd[0] == '/') && (ptr_cmd[1] != '/'))
|
||||
if (is_command (ptr_cmd))
|
||||
{
|
||||
/* WeeChat internal command (or IRC command) */
|
||||
(void) exec_weechat_command (server, channel, ptr_cmd, only_builtin);
|
||||
|
||||
@@ -5,6 +5,7 @@ ChangeLog - 2007-03-01
|
||||
|
||||
|
||||
Version 0.2.4 (under dev!):
|
||||
* prefix '/' disabled in commands (patch #5769)
|
||||
* fixed completion of redefined commands removed by plugins (bug #19176)
|
||||
* fixed memory leaks in perl and python plugins (bug #19163)
|
||||
* added "call" option to /key command, added new key function "insert" to
|
||||
|
||||
@@ -782,6 +782,22 @@ user_message (t_irc_server *server, t_gui_buffer *buffer, char *text)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* is_command: return 1 if line is a command, 0 otherwise
|
||||
*/
|
||||
|
||||
int
|
||||
is_command (char *line)
|
||||
{
|
||||
char *pos_slash, *pos_space;
|
||||
|
||||
pos_slash = strchr (line + 1, '/');
|
||||
pos_space = strchr (line + 1, ' ');
|
||||
|
||||
return (line[0] == '/')
|
||||
&& (!pos_slash || (pos_space && pos_slash > pos_space));
|
||||
}
|
||||
|
||||
/*
|
||||
* user_command: interprets user command (if beginning with '/')
|
||||
* any other text is sent to the server, if connected
|
||||
@@ -826,7 +842,7 @@ user_command (t_irc_server *server, t_irc_channel *channel, char *command, int o
|
||||
|
||||
irc_find_context (server, channel, NULL, &buffer);
|
||||
|
||||
if ((ptr_cmd[0] == '/') && (ptr_cmd[1] != '/'))
|
||||
if (is_command (ptr_cmd))
|
||||
{
|
||||
/* WeeChat internal command (or IRC command) */
|
||||
(void) exec_weechat_command (server, channel, ptr_cmd, only_builtin);
|
||||
|
||||
Reference in New Issue
Block a user