summaryrefslogtreecommitdiff
path: root/src/plugins/irc
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-03-02 17:34:49 +0100
committerSebastien Helleu <flashcode@flashtux.org>2010-03-02 17:34:49 +0100
commit0543b0ccc7253bd38d5f473c3e1092e2b065b6ec (patch)
tree0ae2d27cddbf087212fdaf8853133c33999172b2 /src/plugins/irc
parent282f786c1a75978ea0ad4399b7740abd6ff6486a (diff)
downloadweechat-0543b0ccc7253bd38d5f473c3e1092e2b065b6ec.zip
Add new option weechat.look.command_chars, add functions string_is_command_char and string_input_for_buffer in plugin and script API
Diffstat (limited to 'src/plugins/irc')
-rw-r--r--src/plugins/irc/irc-command.c4
-rw-r--r--src/plugins/irc/irc-input.c9
2 files changed, 7 insertions, 6 deletions
diff --git a/src/plugins/irc/irc-command.c b/src/plugins/irc/irc-command.c
index 5f907ced2..9500f7beb 100644
--- a/src/plugins/irc/irc-command.c
+++ b/src/plugins/irc/irc-command.c
@@ -121,7 +121,7 @@ irc_command_exec_all_channels (struct t_irc_server *server,
if (!command || !command[0])
return;
- if (command[0] != '/')
+ if (!weechat_string_is_command_char (command))
{
length = 1 + strlen (command) + 1;
str_command = malloc (length);
@@ -240,7 +240,7 @@ irc_command_exec_all_servers (const char *exclude_servers, const char *command)
if (!command || !command[0])
return;
- if (command[0] != '/')
+ if (!weechat_string_is_command_char (command))
{
length = 1 + strlen (command) + 1;
str_command = malloc (length);
diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c
index ba3ce319e..caa1767dd 100644
--- a/src/plugins/irc/irc-input.c
+++ b/src/plugins/irc/irc-input.c
@@ -162,18 +162,19 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
/* if send unknown commands is enabled and that input data is a command,
then send this command to IRC server */
if (weechat_config_boolean (irc_config_network_send_unknown_commands)
- && (input_data[0] == '/') && (input_data[1] != '/'))
+ && !weechat_string_input_for_buffer (input_data))
{
if (ptr_server)
irc_server_sendf (ptr_server, IRC_SERVER_OUTQUEUE_PRIO_HIGH,
- input_data + 1);
+ weechat_utf8_next_char (input_data));
return WEECHAT_RC_OK;
}
if (ptr_channel)
{
- ptr_data = ((input_data[0] == '/') && (input_data[1] == '/')) ?
- input_data + 1 : input_data;
+ ptr_data = weechat_string_input_for_buffer (input_data);
+ if (!ptr_data)
+ ptr_data = input_data;
data_with_colors = irc_color_encode (ptr_data,
weechat_config_boolean (irc_config_network_colors_send));