summaryrefslogtreecommitdiff
path: root/src/plugins/irc/irc-input.c
diff options
context:
space:
mode:
authorSebastien Helleu <flashcode@flashtux.org>2010-10-19 21:19:42 +0200
committerSebastien Helleu <flashcode@flashtux.org>2010-10-19 21:19:42 +0200
commit073dff330d1a735b0d39d6b22a4469e5c1efa773 (patch)
tree44d8dd9d519bf9f2213d9354fc70aaec788e45f0 /src/plugins/irc/irc-input.c
parent775a2befd9a458a6f3641e054f430605318de018 (diff)
downloadweechat-073dff330d1a735b0d39d6b22a4469e5c1efa773.zip
Fix use of flags for irc_server_sendf in signal irc_input_send
Diffstat (limited to 'src/plugins/irc/irc-input.c')
-rw-r--r--src/plugins/irc/irc-input.c40
1 files changed, 24 insertions, 16 deletions
diff --git a/src/plugins/irc/irc-input.c b/src/plugins/irc/irc-input.c
index e6206ad28..f88b69786 100644
--- a/src/plugins/irc/irc-input.c
+++ b/src/plugins/irc/irc-input.c
@@ -75,7 +75,7 @@ irc_input_user_message_display (struct t_gui_buffer *buffer, const char *text)
}
/*
- * irc_input_send_user_message: send a PRIVMSG message, and split it it message
+ * irc_input_send_user_message: send a PRIVMSG message, and split it if message
* size is > 512 bytes
* Warning: this function makes temporarirly
* changes in "message"
@@ -143,21 +143,17 @@ irc_input_send_user_message (struct t_gui_buffer *buffer, int flags,
}
/*
- * irc_input_data_cb: callback for input data in a buffer
+ * irc_input_data: input data in a buffer
*/
int
-irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
- const char *input_data)
+irc_input_data (struct t_gui_buffer *buffer, const char *input_data, int flags)
{
const char *ptr_data;
char *data_with_colors, *msg;
IRC_BUFFER_GET_SERVER_CHANNEL(buffer);
- /* make C compiler happy */
- (void) data;
-
if (buffer == irc_raw_buffer)
{
if (weechat_strcasecmp (input_data, "q") == 0)
@@ -173,9 +169,10 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
&& !weechat_string_input_for_buffer (input_data))
{
if (ptr_server)
- irc_server_sendf (ptr_server,
- IRC_SERVER_SEND_OUTQ_PRIO_HIGH, NULL,
+ {
+ irc_server_sendf (ptr_server, flags, NULL,
weechat_utf8_next_char (input_data));
+ }
return WEECHAT_RC_OK;
}
@@ -190,10 +187,7 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
msg = strdup ((data_with_colors) ? data_with_colors : ptr_data);
if (msg)
{
- irc_input_send_user_message (buffer,
- IRC_SERVER_SEND_OUTQ_PRIO_HIGH,
- NULL,
- msg);
+ irc_input_send_user_message (buffer, flags, NULL, msg);
free (msg);
}
@@ -212,6 +206,20 @@ irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
}
/*
+ * irc_input_data_cb: callback for input data in a buffer
+ */
+
+int
+irc_input_data_cb (void *data, struct t_gui_buffer *buffer,
+ const char *input_data)
+{
+ /* make C compiler happy */
+ (void) data;
+
+ return irc_input_data (buffer, input_data, IRC_SERVER_SEND_OUTQ_PRIO_HIGH);
+}
+
+/*
* irc_input_send_cb: callback for "irc_input_send" signal
* This signal can be used by other plugins/scripts, it
* simulates input or command from user on an IRC buffer
@@ -290,13 +298,13 @@ irc_input_send_cb (void *data, const char *signal,
}
}
- flags_value = 0;
+ flags_value = IRC_SERVER_SEND_OUTQ_PRIO_HIGH;
if (flags)
{
error = NULL;
flags_value = strtol (flags, &error, 10);
if (flags_value < 0)
- flags_value = 0;
+ flags_value = IRC_SERVER_SEND_OUTQ_PRIO_HIGH;
}
if (server && ptr_message)
@@ -319,7 +327,7 @@ irc_input_send_cb (void *data, const char *signal,
if (weechat_string_input_for_buffer (ptr_message))
{
/* text as input */
- irc_input_data_cb (NULL, ptr_buffer, ptr_message);
+ irc_input_data (ptr_buffer, ptr_message, flags_value);
}
else
{