diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2019-06-15 20:47:14 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2019-06-15 20:47:14 +0200 |
commit | 917815635415b523eaf58ed4c65757247d5cca99 (patch) | |
tree | abac3f1894ed07cbf2caed70cc285bde87b3263c /src/plugins/relay | |
parent | 866a29c7e63bbda24e04fc36b34bbd798a8c98db (diff) | |
download | weechat-917815635415b523eaf58ed4c65757247d5cca99.zip |
api: add argument "strip_items" in function string_split
Diffstat (limited to 'src/plugins/relay')
-rw-r--r-- | src/plugins/relay/irc/relay-irc.c | 6 | ||||
-rw-r--r-- | src/plugins/relay/relay-client.c | 2 | ||||
-rw-r--r-- | src/plugins/relay/relay-config.c | 3 | ||||
-rw-r--r-- | src/plugins/relay/relay-info.c | 2 | ||||
-rw-r--r-- | src/plugins/relay/weechat/relay-weechat-msg.c | 5 | ||||
-rw-r--r-- | src/plugins/relay/weechat/relay-weechat-protocol.c | 22 |
6 files changed, 25 insertions, 15 deletions
diff --git a/src/plugins/relay/irc/relay-irc.c b/src/plugins/relay/irc/relay-irc.c index e54e52403..632fbabb6 100644 --- a/src/plugins/relay/irc/relay-irc.c +++ b/src/plugins/relay/irc/relay-irc.c @@ -337,7 +337,7 @@ relay_irc_tag_relay_client_id (const char *tags) if (tags && tags[0]) { - argv = weechat_string_split (tags, ",", + argv = weechat_string_split (tags, ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, @@ -565,7 +565,7 @@ relay_irc_hsignal_irc_redir_cb (const void *pointer, void *data, if (!output) return WEECHAT_RC_OK; - messages = weechat_string_split (output, "\n", + messages = weechat_string_split (output, "\n", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, @@ -1359,6 +1359,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data) irc_argv = weechat_string_split ( irc_args, " ", + NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, @@ -1367,6 +1368,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data) irc_argv_eol = weechat_string_split ( irc_args, " ", + NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS diff --git a/src/plugins/relay/relay-client.c b/src/plugins/relay/relay-client.c index 8ecc8777e..2d8272a8b 100644 --- a/src/plugins/relay/relay-client.c +++ b/src/plugins/relay/relay-client.c @@ -339,7 +339,7 @@ relay_client_recv_text (struct t_relay_client *client, const char *data) pos[0] = '\0'; - lines = weechat_string_split (client->partial_message, "\n", + lines = weechat_string_split (client->partial_message, "\n", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, diff --git a/src/plugins/relay/relay-config.c b/src/plugins/relay/relay-config.c index 7aeabd136..6cd92344e 100644 --- a/src/plugins/relay/relay-config.c +++ b/src/plugins/relay/relay-config.c @@ -411,7 +411,7 @@ relay_config_check_irc_backlog_tags (const void *pointer, void *data, return rc; /* split tags and check them */ - tags = weechat_string_split (value, ",", + tags = weechat_string_split (value, ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, @@ -462,6 +462,7 @@ relay_config_change_irc_backlog_tags (const void *pointer, void *data, items = weechat_string_split ( weechat_config_string (relay_config_irc_backlog_tags), ",", + NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, diff --git a/src/plugins/relay/relay-info.c b/src/plugins/relay/relay-info.c index 3b33d88c1..b2227e131 100644 --- a/src/plugins/relay/relay-info.c +++ b/src/plugins/relay/relay-info.c @@ -53,7 +53,7 @@ relay_info_info_relay_client_count_cb (const void *pointer, void *data, protocol = -1; status = -1; - items = weechat_string_split (arguments, ",", + items = weechat_string_split (arguments, ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, diff --git a/src/plugins/relay/weechat/relay-weechat-msg.c b/src/plugins/relay/weechat/relay-weechat-msg.c index 42ce0a561..10e6e0fa8 100644 --- a/src/plugins/relay/weechat/relay-weechat-msg.c +++ b/src/plugins/relay/weechat/relay-weechat-msg.c @@ -583,7 +583,7 @@ relay_weechat_msg_add_hdata (struct t_relay_weechat_msg *msg, goto end; /* split path */ - list_path = weechat_string_split (pos + 1, "/", + list_path = weechat_string_split (pos + 1, "/", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, @@ -653,7 +653,7 @@ relay_weechat_msg_add_hdata (struct t_relay_weechat_msg *msg, /* split keys */ if (!keys) keys = weechat_hdata_get_string (ptr_hdata, "var_keys"); - list_keys = weechat_string_split (keys, ",", + list_keys = weechat_string_split (keys, ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, @@ -793,6 +793,7 @@ relay_weechat_msg_add_infolist (struct t_relay_weechat_msg *msg, list_fields = weechat_string_split ( fields, ",", + NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, diff --git a/src/plugins/relay/weechat/relay-weechat-protocol.c b/src/plugins/relay/weechat/relay-weechat-protocol.c index d007d6396..8d50c5d17 100644 --- a/src/plugins/relay/weechat/relay-weechat-protocol.c +++ b/src/plugins/relay/weechat/relay-weechat-protocol.c @@ -1030,18 +1030,21 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(sync) RELAY_WEECHAT_PROTOCOL_MIN_ARGS(0); - buffers = weechat_string_split ((argc > 0) ? argv[0] : "*", ",", + buffers = weechat_string_split ((argc > 0) ? argv[0] : "*", + ",", + NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, - 0, &num_buffers); + 0, + &num_buffers); if (buffers) { add_flags = RELAY_WEECHAT_PROTOCOL_SYNC_ALL; if (argc > 1) { add_flags = 0; - flags = weechat_string_split (argv[1], ",", + flags = weechat_string_split (argv[1], ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, @@ -1116,18 +1119,21 @@ RELAY_WEECHAT_PROTOCOL_CALLBACK(desync) RELAY_WEECHAT_PROTOCOL_MIN_ARGS(0); - buffers = weechat_string_split ((argc > 0) ? argv[0] : "*", ",", + buffers = weechat_string_split ((argc > 0) ? argv[0] : "*", + ",", + NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, - 0, &num_buffers); + 0, + &num_buffers); if (buffers) { sub_flags = RELAY_WEECHAT_PROTOCOL_SYNC_ALL; if (argc > 1) { sub_flags = 0; - flags = weechat_string_split (argv[1], ",", + flags = weechat_string_split (argv[1], ",", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, @@ -1402,12 +1408,12 @@ relay_weechat_protocol_recv (struct t_relay_client *client, const char *data) { pos++; } - argv = weechat_string_split (pos, " ", + argv = weechat_string_split (pos, " ", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_STRIP_RIGHT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS, 0, &argc); - argv_eol = weechat_string_split (pos, " ", + argv_eol = weechat_string_split (pos, " ", NULL, WEECHAT_STRING_SPLIT_STRIP_LEFT | WEECHAT_STRING_SPLIT_COLLAPSE_SEPS | WEECHAT_STRING_SPLIT_KEEP_EOL, |