mirror of
https://github.com/weechat/weechat.git
synced 2026-06-14 23:24:47 +02:00
Compare commits
16 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f3bc66b255 | |||
| a23d8f2198 | |||
| f4c6caabb3 | |||
| f416688e84 | |||
| 1dc7ae6b68 | |||
| b06e09d00b | |||
| 89090b10e8 | |||
| fad7231f90 | |||
| cf1e073446 | |||
| b4fc345a13 | |||
| b2cd9d002b | |||
| 9312211d49 | |||
| 2ad27b41a5 | |||
| ef68312393 | |||
| 7aa490e360 | |||
| 36ea983d04 |
@@ -10,6 +10,22 @@ This document lists all the changes for each version. +
|
||||
For a list of important changes that require manual actions, please look at release notes.
|
||||
|
||||
|
||||
[[v4.0.3]]
|
||||
== Version 4.0.3 (2023-08-08)
|
||||
|
||||
Bug fixes::
|
||||
|
||||
* core: fix input length and crash after delete of line (issue #1989)
|
||||
* irc: fix display of self CTCP message containing bold attribute (issue #1981)
|
||||
* irc: fix memory leak in IRC message parser
|
||||
* irc: fix switch to channel manually joined when server option autojoin_dynamic is on and option irc.look.buffer_switch_autojoin is off (issue #1982)
|
||||
* irc: fix display of outgoing notice with channel when capability "echo-message" is enabled (issue #1991)
|
||||
* relay: fix display of IRC CTCP messages received from client (issue #1986)
|
||||
|
||||
Build::
|
||||
|
||||
* doc: display a warning if a locale is missing with fallback to English for auto-generated content (issue #1985)
|
||||
|
||||
[[v4.0.2]]
|
||||
== Version 4.0.2 (2023-07-12)
|
||||
|
||||
|
||||
+41
-31
@@ -11,6 +11,16 @@ It is recommended to read it when upgrading to a new stable version. +
|
||||
For a complete list of changes, please look at ChangeLog.
|
||||
|
||||
|
||||
[[v4.0.3]]
|
||||
== Version 4.0.3 (2023-08-08)
|
||||
|
||||
No release notes.
|
||||
|
||||
[[v4.0.2]]
|
||||
== Version 4.0.2 (2023-07-12)
|
||||
|
||||
No release notes.
|
||||
|
||||
[[v4.0.1]]
|
||||
== Version 4.0.1 (2023-06-30)
|
||||
|
||||
@@ -473,7 +483,7 @@ now any return value is ignored (like it has always been in the C API).
|
||||
[[v3.7.1]]
|
||||
== Version 3.7.1 (2022-10-21)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v3.7]]
|
||||
== Version 3.7 (2022-10-09)
|
||||
@@ -595,7 +605,7 @@ and is now a percentage between `0` and `100`:
|
||||
[[v3.4.1]]
|
||||
== Version 3.4.1 (2022-03-13)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v3.4]]
|
||||
== Version 3.4 (2021-12-18)
|
||||
@@ -753,7 +763,7 @@ For example:
|
||||
[[v3.2.1]]
|
||||
== Version 3.2.1 (2021-09-04)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v3.2]]
|
||||
== Version 3.2 (2021-06-13)
|
||||
@@ -983,7 +993,7 @@ must adjust the value of the new option, which defaults to 1:
|
||||
[[v3.0.1]]
|
||||
== Version 3.0.1 (2021-01-31)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v3.0]]
|
||||
== Version 3.0 (2020-11-11)
|
||||
@@ -1291,7 +1301,7 @@ version:
|
||||
[[v2.7.1]]
|
||||
== Version 2.7.1 (2020-02-20)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v2.7]]
|
||||
== Version 2.7 (2019-12-08)
|
||||
@@ -1535,7 +1545,7 @@ Functions removed from C API:
|
||||
[[v2.3]]
|
||||
== Version 2.3 (2018-10-21)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v2.2]]
|
||||
== Version 2.2 (2018-07-14)
|
||||
@@ -1671,7 +1681,7 @@ List of options moved:
|
||||
[[v2.0.1]]
|
||||
== Version 2.0.1 (2017-12-20)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v2.0]]
|
||||
== Version 2.0 (2017-12-03)
|
||||
@@ -1766,12 +1776,12 @@ to integer before using it, for example in Python: `int(fd)`.
|
||||
[[v1.9.1]]
|
||||
== Version 1.9.1 (2017-09-23)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v1.9]]
|
||||
== Version 1.9 (2017-06-25)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v1.8]]
|
||||
== Version 1.8 (2017-05-13)
|
||||
@@ -1823,7 +1833,7 @@ Aspell option with color for suggestion on a misspelled word has been renamed:
|
||||
[[v1.7.1]]
|
||||
== Version 1.7.1 (2017-04-22)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v1.7]]
|
||||
== Version 1.7 (2017-01-15)
|
||||
@@ -2070,7 +2080,7 @@ command:
|
||||
[[v1.1.1]]
|
||||
== Version 1.1.1 (2015-01-25)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v1.1]]
|
||||
== Version 1.1 (2015-01-11)
|
||||
@@ -2190,7 +2200,7 @@ instead of milliseconds:
|
||||
[[v1.0.1]]
|
||||
== Version 1.0.1 (2014-09-28)
|
||||
|
||||
Bug fix and maintenance release.
|
||||
No release notes.
|
||||
|
||||
[[v1.0]]
|
||||
== Version 1.0 (2014-08-15)
|
||||
@@ -3016,17 +3026,17 @@ This version fixes a major bug: crash with some special chars in IRC messages.
|
||||
[[v0.2.6]]
|
||||
== Version 0.2.6 (2007-09-06)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.2.5]]
|
||||
== Version 0.2.5 (2007-06-07)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.2.4]]
|
||||
== Version 0.2.4 (2007-03-29)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.2.3]]
|
||||
== Version 0.2.3 (2007-01-10)
|
||||
@@ -3085,7 +3095,7 @@ Which gives something like:
|
||||
[[v0.2.1]]
|
||||
== Version 0.2.1 (2006-10-01)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.2.0]]
|
||||
== Version 0.2.0 (2006-08-19)
|
||||
@@ -3199,74 +3209,74 @@ at startup.
|
||||
[[v0.1.5]]
|
||||
== Version 0.1.5 (2005-09-24)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.1.4]]
|
||||
== Version 0.1.4 (2005-07-30)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.1.3]]
|
||||
== Version 0.1.3 (2005-07-02)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.1.2]]
|
||||
== Version 0.1.2 (2005-05-21)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.1.1]]
|
||||
== Version 0.1.1 (2005-03-20)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.1.0]]
|
||||
== Version 0.1.0 (2005-02-12)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.9]]
|
||||
== Version 0.0.9 (2005-01-01)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.8]]
|
||||
== Version 0.0.8 (2004-10-30)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.7]]
|
||||
== Version 0.0.7 (2004-08-08)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.6]]
|
||||
== Version 0.0.6 (2004-06-05)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.5]]
|
||||
== Version 0.0.5 (2004-02-07)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.4]]
|
||||
== Version 0.0.4 (2004-01-01)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.3]]
|
||||
== Version 0.0.3 (2003-11-03)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.2]]
|
||||
== Version 0.0.2 (2003-10-05)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
[[v0.0.1]]
|
||||
== Version 0.0.1 (2003-09-27)
|
||||
|
||||
No release note.
|
||||
No release notes.
|
||||
|
||||
+13
-3
@@ -126,7 +126,7 @@ doc_gen_open_file (const char *path, const char *doc, const char *name,
|
||||
if (!file)
|
||||
{
|
||||
string_fprintf (stderr,
|
||||
"doc generator: ERROR: unable to write file \"%s\"",
|
||||
"doc generator: ERROR: unable to write file \"%s\"\n",
|
||||
filename);
|
||||
return NULL;
|
||||
}
|
||||
@@ -1652,7 +1652,7 @@ doc_generate (const char *path)
|
||||
{
|
||||
string_fprintf (
|
||||
stderr,
|
||||
"doc generator: ERROR: failed to create directory \"%s\")",
|
||||
"doc generator: ERROR: failed to create directory \"%s\")\n",
|
||||
path);
|
||||
goto end;
|
||||
}
|
||||
@@ -1669,7 +1669,17 @@ doc_generate (const char *path)
|
||||
for (i = 0; locales[i]; i++)
|
||||
{
|
||||
setenv ("LANGUAGE", locales[i], 1);
|
||||
setlocale (LC_ALL, locales[i]);
|
||||
if (!setlocale (LC_ALL, locales[i]))
|
||||
{
|
||||
/* warning on missing locale */
|
||||
string_fprintf (
|
||||
stderr,
|
||||
"doc generator: WARNING: failed to set locale \"%s\", "
|
||||
"docs will include auto-generated English content\n",
|
||||
locales[i]);
|
||||
/* fallback to English */
|
||||
setlocale (LC_ALL, "C");
|
||||
}
|
||||
memcpy (lang, locales[i], 2);
|
||||
lang[2] = '\0';
|
||||
for (j = 0; doc_gen_functions[j]; j++)
|
||||
|
||||
+1
-1
@@ -1142,7 +1142,7 @@ gui_input_delete_line (struct t_gui_buffer *buffer)
|
||||
end_of_line = (char *)utf8_end_of_line (start);
|
||||
|
||||
size_deleted = end_of_line - beginning_of_line;
|
||||
length_deleted = utf8_strnlen (start, size_deleted);
|
||||
length_deleted = utf8_strnlen (beginning_of_line, size_deleted);
|
||||
|
||||
memmove (beginning_of_line, end_of_line, strlen (end_of_line));
|
||||
|
||||
|
||||
@@ -462,7 +462,7 @@ irc_channel_create_buffer (struct t_irc_server *server,
|
||||
if (noswitch
|
||||
|| (!manual_join && !autojoin_join)
|
||||
|| (manual_join && !weechat_config_boolean (irc_config_look_buffer_switch_join))
|
||||
|| (autojoin_join && !weechat_config_boolean (irc_config_look_buffer_switch_autojoin)))
|
||||
|| (!manual_join && autojoin_join && !weechat_config_boolean (irc_config_look_buffer_switch_autojoin)))
|
||||
{
|
||||
switch_to_channel = 0;
|
||||
}
|
||||
|
||||
@@ -529,6 +529,8 @@ irc_message_parse_to_hashtable (struct t_irc_server *server,
|
||||
free (arguments);
|
||||
if (text)
|
||||
free (text);
|
||||
if (params)
|
||||
weechat_string_free_split (params);
|
||||
|
||||
return hashtable;
|
||||
}
|
||||
|
||||
@@ -2505,8 +2505,11 @@ IRC_PROTOCOL_CALLBACK(notice)
|
||||
is_channel = irc_channel_is_channel (server, pos_target);
|
||||
is_channel_orig = is_channel;
|
||||
if (is_channel)
|
||||
{
|
||||
channel = strdup (pos_target);
|
||||
else if (weechat_config_boolean (irc_config_look_notice_welcome_redirect))
|
||||
}
|
||||
else if (weechat_config_boolean (irc_config_look_notice_welcome_redirect)
|
||||
&& (irc_server_strcasecmp (server, server->nick, pos_target) == 0))
|
||||
{
|
||||
end_char = ' ';
|
||||
switch (pos_args[0])
|
||||
@@ -2995,7 +2998,7 @@ irc_protocol_privmsg_display_ctcp_send (struct t_irc_server *server,
|
||||
if (!arguments || !arguments[0])
|
||||
return;
|
||||
|
||||
pos_end = strchr (arguments + 1, '\01');
|
||||
pos_end = strrchr (arguments + 1, '\01');
|
||||
if (!pos_end)
|
||||
return;
|
||||
|
||||
|
||||
@@ -1581,6 +1581,53 @@ relay_irc_recv_command_capab (struct t_relay_client *client,
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Parses CTCP message and return CTCP type and parameters.
|
||||
* If message is not a valid CTCP format, type and parameters are set to NULL.
|
||||
*
|
||||
* Examples:
|
||||
*
|
||||
* message | type | params
|
||||
* --------------------------|-----------|-----------
|
||||
* "\01ACTION is testing\01" | "ACTION" | "is testing"
|
||||
* "\01VERSION\01" | "VERSION" | NULL
|
||||
* "\01VERSION" | NULL | NULL
|
||||
* "test" | NULL | NULL
|
||||
*/
|
||||
|
||||
void
|
||||
relay_irc_parse_ctcp (const char *message, char **ctcp_type, char **ctcp_params)
|
||||
{
|
||||
const char *pos_space, *pos_end;
|
||||
|
||||
if (!ctcp_type || !ctcp_params)
|
||||
return;
|
||||
|
||||
*ctcp_type = NULL;
|
||||
*ctcp_params = NULL;
|
||||
|
||||
if (!message)
|
||||
return;
|
||||
|
||||
if (message[0] != '\01')
|
||||
return;
|
||||
|
||||
pos_end = strrchr (message + 1, '\01');
|
||||
if (!pos_end)
|
||||
return;
|
||||
|
||||
pos_space = strchr (message, ' ' );
|
||||
if (pos_space && (pos_space < pos_end))
|
||||
{
|
||||
*ctcp_type = weechat_strndup (message + 1, pos_space - message - 1);
|
||||
*ctcp_params = weechat_strndup (pos_space + 1, pos_end - pos_space - 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
*ctcp_type = weechat_strndup (message + 1, pos_end - message - 1);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Reads one message from client.
|
||||
*/
|
||||
@@ -1595,7 +1642,7 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
|
||||
char str_time[128], str_signal[128], str_server_channel[256], *nick;
|
||||
char str_param[128], *str_args, *version, str_command[128], **params;
|
||||
char *pos, *password, *irc_is_channel, *info, *error, *str_cmd_lower;
|
||||
char modifier_data[128], *new_data;
|
||||
char modifier_data[128], *new_data, *ctcp_type, *ctcp_params;
|
||||
long num_params;
|
||||
int i, redirect_msg;
|
||||
|
||||
@@ -1933,26 +1980,61 @@ relay_irc_recv (struct t_relay_client *client, const char *data)
|
||||
{
|
||||
str_args = weechat_string_rebuild_split_string (
|
||||
(const char **)params, " ", 1, -1);
|
||||
relay_irc_parse_ctcp (str_args, &ctcp_type, &ctcp_params);
|
||||
irc_is_channel = weechat_info_get ("irc_is_channel", params[0]);
|
||||
if (irc_is_channel && (strcmp (irc_is_channel, "1") == 0))
|
||||
{
|
||||
relay_irc_input_send (client, params[0],
|
||||
"priority_high,user_message",
|
||||
"%s",
|
||||
(str_args) ? str_args : "");
|
||||
if (ctcp_type)
|
||||
{
|
||||
relay_irc_input_send (client, NULL,
|
||||
"priority_high",
|
||||
"/ctcp %s %s%s%s",
|
||||
params[0],
|
||||
ctcp_type,
|
||||
(ctcp_params) ? " " : "",
|
||||
(ctcp_params) ? ctcp_params : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
relay_irc_input_send (client, params[0],
|
||||
"priority_high,user_message",
|
||||
"%s",
|
||||
(str_args) ? str_args : "");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
relay_irc_input_send (client, NULL,
|
||||
"priority_high",
|
||||
"/query %s %s",
|
||||
params[0],
|
||||
(str_args) ? str_args : "");
|
||||
if (ctcp_type)
|
||||
{
|
||||
relay_irc_input_send (client, NULL,
|
||||
"priority_high",
|
||||
"/query %s",
|
||||
params[0]);
|
||||
relay_irc_input_send (client, NULL,
|
||||
"priority_high",
|
||||
"/ctcp %s %s%s%s",
|
||||
params[0],
|
||||
ctcp_type,
|
||||
(ctcp_params) ? " " : "",
|
||||
(ctcp_params) ? ctcp_params : "");
|
||||
}
|
||||
else
|
||||
{
|
||||
relay_irc_input_send (client, NULL,
|
||||
"priority_high",
|
||||
"/query %s %s",
|
||||
params[0],
|
||||
(str_args) ? str_args : "");
|
||||
}
|
||||
}
|
||||
if (str_args)
|
||||
free (str_args);
|
||||
if (irc_is_channel)
|
||||
free (irc_is_channel);
|
||||
if (ctcp_type)
|
||||
free (ctcp_type);
|
||||
if (ctcp_params)
|
||||
free (ctcp_params);
|
||||
}
|
||||
}
|
||||
else if (!relay_irc_command_ignored (irc_command))
|
||||
|
||||
@@ -2423,7 +2423,7 @@ TEST(IrcProtocolWithServer, notice)
|
||||
|
||||
/*
|
||||
* notice to channel/user from self nick
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host NOTICE #test :a notice ");
|
||||
CHECK_CHAN("--", "Notice(alice) -> #test: a notice ",
|
||||
@@ -2440,7 +2440,7 @@ TEST(IrcProtocolWithServer, notice)
|
||||
|
||||
/*
|
||||
* notice to ops of channel from self nick
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host NOTICE @#test :a notice ");
|
||||
CHECK_CHAN("--", "Notice(alice) -> @#test: a notice ",
|
||||
@@ -2449,7 +2449,7 @@ TEST(IrcProtocolWithServer, notice)
|
||||
|
||||
/*
|
||||
* notice from self nick
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host NOTICE alice :a notice ");
|
||||
CHECK_SRV("--", "Notice -> alice: a notice ",
|
||||
@@ -2481,6 +2481,14 @@ TEST(IrcProtocolWithServer, notice)
|
||||
CHECK_CHAN("--", "PvNotice(bob): a notice ",
|
||||
"irc_notice,nick_bob,host_user@host,log1");
|
||||
|
||||
/*
|
||||
* notice to another nick with channel name at beginning
|
||||
* (case of a notice sent if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host NOTICE bob :[#test] a notice ");
|
||||
CHECK_SRV("--", "Notice -> bob: [#test] a notice ",
|
||||
"irc_notice,notify_private,nick_alice,host_user@host,log1");
|
||||
|
||||
/* broken CTCP to channel */
|
||||
RECV(":bob!user@host NOTICE #test :\01");
|
||||
CHECK_SRV("--", "CTCP reply from bob: ",
|
||||
@@ -2743,7 +2751,7 @@ TEST(IrcProtocolWithServer, privmsg)
|
||||
|
||||
/*
|
||||
* message to channel/user from self nick
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host PRIVMSG #test :this is the message ");
|
||||
CHECK_CHAN("alice", "this is the message ",
|
||||
@@ -2757,7 +2765,7 @@ TEST(IrcProtocolWithServer, privmsg)
|
||||
|
||||
/*
|
||||
* message to ops of channel from self nick
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host PRIVMSG @#test :this is the message ");
|
||||
CHECK_CHAN("--", "Msg(alice) -> @#test: this is the message ",
|
||||
@@ -2766,7 +2774,7 @@ TEST(IrcProtocolWithServer, privmsg)
|
||||
|
||||
/*
|
||||
* message from self nick in private
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host PRIVMSG alice :this is the message ");
|
||||
CHECK_PV("alice", "alice", "this is the message ",
|
||||
@@ -2775,7 +2783,7 @@ TEST(IrcProtocolWithServer, privmsg)
|
||||
|
||||
/*
|
||||
* message from self nick in private, with password hidden (nickserv)
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host PRIVMSG nickserv :identify secret");
|
||||
CHECK_PV("nickserv", "alice", "identify ******",
|
||||
@@ -2865,8 +2873,8 @@ TEST(IrcProtocolWithServer, privmsg)
|
||||
CHECK_CHAN(" *", "bob",
|
||||
"irc_privmsg,irc_action,notify_message,nick_bob,"
|
||||
"host_user@host,log1");
|
||||
RECV(":bob!user@host PRIVMSG #test :\01ACTION is testing\01");
|
||||
CHECK_CHAN(" *", "bob is testing",
|
||||
RECV(":bob!user@host PRIVMSG #test :\01ACTION is testing with \02bold\02\01");
|
||||
CHECK_CHAN(" *", "bob is testing with bold",
|
||||
"irc_privmsg,irc_action,notify_message,nick_bob,"
|
||||
"host_user@host,log1");
|
||||
RECV(":bob!user@host PRIVMSG #test :\01VERSION\01");
|
||||
@@ -2884,7 +2892,7 @@ TEST(IrcProtocolWithServer, privmsg)
|
||||
|
||||
/*
|
||||
* valid CTCP to channel from self nick
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host PRIVMSG #test :\01VERSION\01");
|
||||
CHECK_CHAN("--", "CTCP query to #test: VERSION",
|
||||
@@ -2894,14 +2902,14 @@ TEST(IrcProtocolWithServer, privmsg)
|
||||
CHECK_CHAN(" *", "alice",
|
||||
"irc_privmsg,irc_action,self_msg,notify_none,no_highlight,"
|
||||
"nick_alice,host_user@host,log1");
|
||||
RECV(":alice!user@host PRIVMSG #test :\01ACTION is testing\01");
|
||||
CHECK_CHAN(" *", "alice is testing",
|
||||
RECV(":alice!user@host PRIVMSG #test :\01ACTION is testing with \02bold\02\01");
|
||||
CHECK_CHAN(" *", "alice is testing with bold",
|
||||
"irc_privmsg,irc_action,self_msg,notify_none,no_highlight,"
|
||||
"nick_alice,host_user@host,log1");
|
||||
|
||||
/*
|
||||
* valid CTCP to ops of channel from self nick
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host PRIVMSG @#test :\01ACTION\01");
|
||||
CHECK_CHAN("--", "Action -> @#test: alice",
|
||||
@@ -2948,7 +2956,7 @@ TEST(IrcProtocolWithServer, privmsg)
|
||||
|
||||
/*
|
||||
* valid CTCP to channel from self nick
|
||||
* (case of bouncer of if echo-message capability is enabled)
|
||||
* (case of bouncer or if echo-message capability is enabled)
|
||||
*/
|
||||
RECV(":alice!user@host PRIVMSG alice :\01CLIENTINFO\01");
|
||||
if (i == 0)
|
||||
|
||||
@@ -49,6 +49,8 @@ extern void relay_irc_sendf (struct t_relay_client *client,
|
||||
const char *format, ...);
|
||||
extern void relay_irc_parse_cap_message (struct t_relay_client *client,
|
||||
struct t_hashtable *parsed_msg);
|
||||
extern void relay_irc_parse_ctcp (const char *message,
|
||||
char **ctcp_type, char **ctcp_params);
|
||||
extern int relay_irc_tag_relay_client_id (const char *tags);
|
||||
extern void relay_irc_input_send (struct t_relay_client *client,
|
||||
const char *irc_channel,
|
||||
@@ -812,6 +814,72 @@ TEST(RelayIrcWithClient, RelayIrcRecvCommandCapab)
|
||||
LONGS_EQUAL(1, RELAY_IRC_DATA(ptr_relay_client, cap_end_received));
|
||||
}
|
||||
|
||||
/*
|
||||
* Tests functions:
|
||||
* relay_irc_parse_ctcp
|
||||
*/
|
||||
|
||||
TEST(RelayIrcWithClient, RelayIrcParseCtcp)
|
||||
{
|
||||
char *ctcp_type, *ctcp_params;
|
||||
|
||||
relay_irc_parse_ctcp (NULL, NULL, NULL);
|
||||
relay_irc_parse_ctcp ("test", NULL, NULL);
|
||||
|
||||
ctcp_type = (char *)0x01;
|
||||
ctcp_params = (char *)0x01;
|
||||
relay_irc_parse_ctcp (NULL, &ctcp_type, &ctcp_params);
|
||||
POINTERS_EQUAL(NULL, ctcp_type);
|
||||
POINTERS_EQUAL(NULL, ctcp_params);
|
||||
|
||||
ctcp_type = (char *)0x01;
|
||||
ctcp_params = (char *)0x01;
|
||||
relay_irc_parse_ctcp ("\01ACTION is testing\01", &ctcp_type, &ctcp_params);
|
||||
STRCMP_EQUAL("ACTION", ctcp_type);
|
||||
STRCMP_EQUAL("is testing", ctcp_params);
|
||||
free (ctcp_type);
|
||||
free (ctcp_params);
|
||||
|
||||
ctcp_type = (char *)0x01;
|
||||
ctcp_params = (char *)0x01;
|
||||
relay_irc_parse_ctcp ("\01ACTION is testing \01 extra", &ctcp_type, &ctcp_params);
|
||||
STRCMP_EQUAL("ACTION", ctcp_type);
|
||||
STRCMP_EQUAL(" is testing ", ctcp_params);
|
||||
free (ctcp_type);
|
||||
free (ctcp_params);
|
||||
|
||||
ctcp_type = (char *)0x01;
|
||||
ctcp_params = (char *)0x01;
|
||||
relay_irc_parse_ctcp ("\01VERSION\01", &ctcp_type, &ctcp_params);
|
||||
STRCMP_EQUAL("VERSION", ctcp_type);
|
||||
POINTERS_EQUAL(NULL, ctcp_params);
|
||||
free (ctcp_type);
|
||||
|
||||
ctcp_type = (char *)0x01;
|
||||
ctcp_params = (char *)0x01;
|
||||
relay_irc_parse_ctcp ("\01ACTION is testing", &ctcp_type, &ctcp_params);
|
||||
POINTERS_EQUAL(NULL, ctcp_type);
|
||||
POINTERS_EQUAL(NULL, ctcp_params);
|
||||
|
||||
ctcp_type = (char *)0x01;
|
||||
ctcp_params = (char *)0x01;
|
||||
relay_irc_parse_ctcp ("\01VERSION", &ctcp_type, &ctcp_params);
|
||||
POINTERS_EQUAL(NULL, ctcp_type);
|
||||
POINTERS_EQUAL(NULL, ctcp_params);
|
||||
|
||||
ctcp_type = (char *)0x01;
|
||||
ctcp_params = (char *)0x01;
|
||||
relay_irc_parse_ctcp ("test", &ctcp_type, &ctcp_params);
|
||||
POINTERS_EQUAL(NULL, ctcp_type);
|
||||
POINTERS_EQUAL(NULL, ctcp_params);
|
||||
|
||||
ctcp_type = (char *)0x01;
|
||||
ctcp_params = (char *)0x01;
|
||||
relay_irc_parse_ctcp ("", &ctcp_type, &ctcp_params);
|
||||
POINTERS_EQUAL(NULL, ctcp_type);
|
||||
POINTERS_EQUAL(NULL, ctcp_params);
|
||||
}
|
||||
|
||||
/*
|
||||
* Tests functions:
|
||||
* relay_irc_recv
|
||||
|
||||
+2
-2
@@ -39,8 +39,8 @@
|
||||
# devel-number the devel version as hex number ("0x04010000" for "4.1.0-dev")
|
||||
#
|
||||
|
||||
WEECHAT_STABLE="4.0.2"
|
||||
WEECHAT_DEVEL="4.0.2"
|
||||
WEECHAT_STABLE="4.0.3"
|
||||
WEECHAT_DEVEL="4.0.3"
|
||||
|
||||
STABLE_MAJOR=$(echo "${WEECHAT_STABLE}" | cut -d"." -f1)
|
||||
STABLE_MINOR=$(echo "${WEECHAT_STABLE}" | cut -d"." -f2)
|
||||
|
||||
Reference in New Issue
Block a user