1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-12 22:24:47 +02:00

Compare commits

...

15 Commits

Author SHA1 Message Date
Sébastien Helleu b452be6417 Version 4.8.2 2026-03-06 23:15:44 +01:00
Sébastien Helleu 0fbb99763d core: remove trailing backslash in German translation of /help buflist.look.add_newline 2026-02-16 20:15:23 +01:00
Sébastien Helleu 65ef552251 core: replace real tab by \t in German translation of /help filter
This was causing a display issue because the tab char is used to separate
prefix from message.
2026-02-16 20:13:59 +01:00
Sébastien Helleu 05f9129e65 relay/api: fix memory leak in receive of message from remote WeeChat 2026-02-16 20:11:51 +01:00
Sébastien Helleu 113f72f70e relay/api: fix memory leaks in resources "ping" and "sync" 2026-02-16 20:11:36 +01:00
Sébastien Helleu 0987e12e83 irc: ignore self join if the channel is already joined (issue #2291)
There is an issue with some IRC servers that may send a JOIN with self nick
once already on the channel, this results in a clear of the nicklist on the
second JOIN received.

This fix silently ignores the second self JOIN if the channel is already
joined (with at least one nick).
2025-12-14 15:22:30 +01:00
Sébastien Helleu 097862e0f0 Version 4.8.2-dev 2025-12-01 19:45:34 +01:00
Sébastien Helleu 6b3398fcb5 Version 4.8.1 2025-12-01 19:43:41 +01:00
Sébastien Helleu 52c53d6985 core: add IRC SASL EXTERNAL in upgrade guidelines for version 4.8.0 2025-12-01 18:02:35 +01:00
Sébastien Helleu 608038374e irc: fix creation of irc.msgbuffer option without a server name
The regression was introduced by commit
1b669cd13c, which allowed a server name with
upper case but rejected a name or alias with upper case.

This commit fixed the creation of the option when the server name is not given,
so this command works again:

  /set irc.msgbuffer.whois current
2025-12-01 07:49:36 +01:00
Sébastien Helleu 7f3ad1c054 ci: add build with type "Release" and gcc hardened options in matrix 2025-11-30 14:19:25 +01:00
Sébastien Helleu 5d4546eb85 core: update ChangeLog (issue #2289) 2025-11-30 13:35:19 +01:00
Sébastien Helleu 00b7a656a7 Version 4.8.1-dev 2025-11-30 13:35:19 +01:00
Sébastien Helleu 3520c9af0f core: fix order of sections in ChangeLog 2025-11-30 11:34:44 +01:00
Sébastien Helleu a76bfb1f26 core: fix compiler warning on possible buffer overflow in function util_parse_time (issue #2289) 2025-11-30 11:32:27 +01:00
12 changed files with 134 additions and 81 deletions
+4
View File
@@ -116,6 +116,10 @@ jobs:
cc: "gcc"
cxx: "g++"
buildargs: "-G Ninja -DENABLE_MAN=ON -DENABLE_DOC=ON -DENABLE_TESTS=ON"
- name: "gcc_release_hardened"
cc: "gcc"
cxx: "g++"
buildargs: "-DENABLE_TESTS=ON -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_FLAGS=\"-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3\" -DCMAKE_CXX_FLAGS=\"-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3\""
- name: "gcc_no_nls"
cc: "gcc"
cxx: "g++"
+22 -7
View File
@@ -6,17 +6,25 @@ SPDX-License-Identifier: GPL-3.0-or-later
# WeeChat ChangeLog
## Version 4.8.2 (2026-03-06)
### Fixed
- irc: ignore self join if the channel is already joined ([#2291](https://github.com/weechat/weechat/issues/2291))
- relay/api: fix memory leaks in resources "ping" and "sync"
- relay/api: fix memory leak in receive of message from remote WeeChat
## Version 4.8.1 (2025-12-01)
### Fixed
- core: fix buffer size in function util_parse_time, causing buffer overflow error in unit tests
- irc: fix creation of irc.msgbuffer option without a server name
## Version 4.8.0 (2025-11-30)
_If you are upgrading: please see [UPGRADING.md](UPGRADING.md)._
### Added
- core: add option weechat.completion.cycle
- core: add hdata for hooks
- api: add functions util_parse_int, util_parse_long and util_parse_longlong
- buflist: add variable `${index_displayed}`
### Removed
- irc: remove temporary servers and option irc.look.temporary_servers
@@ -39,6 +47,13 @@ _If you are upgrading: please see [UPGRADING.md](UPGRADING.md)._
- build: require Enchant v2 ([#2268](https://github.com/weechat/weechat/issues/2268))
- build: require Lua ≥ 5.3 ([#2268](https://github.com/weechat/weechat/issues/2268))
### Added
- core: add option weechat.completion.cycle
- core: add hdata for hooks
- api: add functions util_parse_int, util_parse_long and util_parse_longlong
- buflist: add variable `${index_displayed}`
### Fixed
- core: display an error message in case of invalid parameters in commands `/bar`, `/buffer`, `/cursor`, `/print` and `/window`
+13
View File
@@ -24,6 +24,19 @@ converted to a standard server, and thus is saved in configuration file `irc.con
Servers can easily be removed with `/server del <name>`.
### IRC SASL EXTERNAL
When server option `sasl_mechanism` is set to `external`, WeeChat now sends the
username defined in option `sasl_username` to the IRC server
(see issue [#2270](https://github.com/weechat/weechat/issues/2270)).
If you use the EXTERNAL mechanism and the username is set, you could either:
- reset `sasl_username` to an empty string, if the username is **not** needed on this server:
`/reset irc.server.xxx.sasl_username`
- set `sasl_username` to your actual username, if the username **is** required on this server:
`/set irc.server.xxx.sasl_username "user"`
### New time format in log files
The time format used in log files now uses UTC and precision of microsecond
+4 -4
View File
@@ -28,8 +28,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2025-11-28 18:41+0100\n"
"PO-Revision-Date: 2025-11-09 11:00+0100\n"
"POT-Creation-Date: 2026-01-30 13:45+0100\n"
"PO-Revision-Date: 2026-02-04 23:06+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
"Language: de_DE\n"
@@ -2257,7 +2257,7 @@ msgid ""
"> - use \"\\t\" to separate prefix from message, special chars like \"|\" "
"must be escaped: \"\\|\""
msgstr ""
"> - das Präfix (z.B. Nick) wird mittels '\t' von der Nachricht getrennt. "
"> - das Präfix (z.B. Nick) wird mittels '\\t' von der Nachricht getrennt. "
"Sonderzeichen wie '|' mĂĽssen mit einer Escapesequenz : '\\|' eingebunden "
"werden"
@@ -7986,7 +7986,7 @@ msgid ""
msgstr ""
"fĂĽgt einen Zeilenumbruch zwischen die einzelnen Buffer hinzu um pro Zeile "
"einen Buffer anzuzeigen (empfohlen); falls deaktiviert muss ein "
"Zeilenumbruch manuell hinzugefĂĽgt werden, \"${\\\\n}\", des Weiteren ist die "
"Zeilenumbruch manuell hinzugefĂĽgt werden, \"${\\n}\", des Weiteren ist die "
"MausunterstĂĽtzung nicht mehr gegeben"
msgid ""
+9 -7
View File
@@ -417,7 +417,7 @@ int
util_parse_time (const char *datetime, struct timeval *tv)
{
char *string, *pos, *pos2, *pos_colon, *pos_hyphen, *pos_dot;
char str_usec[16], *error, str_date[128], str_date2[256];
char str_usec[16], *error, str_date[128];
struct tm tm_date, tm_date_gm, tm_date_local, *local_time;
time_t time_now, time_gm, time_local;
long long value;
@@ -441,21 +441,23 @@ util_parse_time (const char *datetime, struct timeval *tv)
if (pos_colon && !pos_hyphen)
{
/* add current date: "19:04:55" -> "2025-08-30T19:04:55" */
string = malloc (strlen (datetime) + 16 + 1);
if (!string)
return 0;
time_now = time (NULL);
local_time = localtime (&time_now);
strftime (str_date, sizeof (str_date), "%Y-%m-%dT", local_time);
snprintf (string, sizeof (str_date2), "%s%s", str_date, datetime);
length = strlen (str_date) + strlen (datetime) + 1;
string = malloc (length);
if (!string)
return 0;
snprintf (string, length, "%s%s", str_date, datetime);
}
else if (!pos_colon && pos_hyphen && (!pos_dot || (pos_hyphen < pos_dot)))
{
/* add time (midnight): "2025-08-30" -> "2025-08-30T00:00:00" */
string = malloc (strlen (datetime) + 16 + 1);
length = strlen (datetime) + 9 + 1;
string = malloc (length);
if (!string)
return 0;
snprintf (string, sizeof (str_date2), "%sT00:00:00", datetime);
snprintf (string, length, "%sT00:00:00", datetime);
}
else
{
+27 -29
View File
@@ -1577,7 +1577,8 @@ irc_config_msgbuffer_create_option_cb (const void *pointer, void *data,
const char *option_name, const char *value)
{
struct t_config_option *ptr_option;
char *pos, *name_lower;
const char *pos;
char *name_lower;
int rc;
/* make C compiler happy */
@@ -1605,36 +1606,33 @@ irc_config_msgbuffer_create_option_cb (const void *pointer, void *data,
if (value)
{
pos = strrchr (option_name, '.');
if (pos)
pos = (pos) ? pos + 1 : option_name;
name_lower = weechat_string_tolower (pos);
if (name_lower && (strcmp (pos, name_lower) == 0))
{
pos++;
name_lower = weechat_string_tolower (pos);
if (name_lower && (strcmp (pos, name_lower) == 0))
{
ptr_option = weechat_config_new_option (
config_file, section,
option_name, "enum",
_("buffer used to display message received from IRC "
"server"),
"weechat|server|current|private", 0, 0, value, value, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE :
WEECHAT_CONFIG_OPTION_SET_ERROR;
}
else
{
weechat_printf (
NULL,
_("%s%s: error: invalid option \"%s.%s\", the command "
"name or alias \"%s\" must be lower case"),
weechat_prefix ("error"), IRC_PLUGIN_NAME,
"irc.msgbuffer", option_name, pos);
free (name_lower);
return rc;
}
free (name_lower);
ptr_option = weechat_config_new_option (
config_file, section,
option_name, "enum",
_("buffer used to display message received from IRC "
"server"),
"weechat|server|current|private", 0, 0, value, value, 0,
NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL);
rc = (ptr_option) ?
WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE :
WEECHAT_CONFIG_OPTION_SET_ERROR;
}
else
{
weechat_printf (
NULL,
_("%s%s: error: invalid option \"%s.%s\", the command "
"name or alias \"%s\" must be lower case"),
weechat_prefix ("error"), IRC_PLUGIN_NAME,
"irc.msgbuffer", option_name, pos);
free (name_lower);
return rc;
}
free (name_lower);
}
else
rc = WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE;
+3
View File
@@ -1753,6 +1753,9 @@ IRC_PROTOCOL_CALLBACK(join)
ptr_channel = irc_channel_search (ctxt->server, ctxt->params[0]);
if (ptr_channel)
{
/* ignore self join if the channel is already joined */
if (ctxt->nick_is_me && ptr_channel->nicks)
return WEECHAT_RC_OK;
ptr_channel->part = 0;
}
else
+6 -1
View File
@@ -1056,13 +1056,15 @@ RELAY_API_PROTOCOL_CALLBACK(ping)
cJSON_CreateString ((ptr_data) ? ptr_data : ""));
relay_api_msg_send_json (client, RELAY_HTTP_200_OK, NULL, "ping", json);
cJSON_Delete (json);
cJSON_Delete (json_body);
}
else
{
relay_api_msg_send_json (client, RELAY_HTTP_204_NO_CONTENT, NULL, NULL, NULL);
}
if (json_body)
cJSON_Delete (json_body);
return RELAY_API_PROTOCOL_RC_OK;
}
@@ -1121,6 +1123,9 @@ RELAY_API_PROTOCOL_CALLBACK(sync)
relay_api_msg_send_json (client, RELAY_HTTP_204_NO_CONTENT, NULL, NULL, NULL);
if (json_body)
cJSON_Delete (json_body);
return RELAY_API_PROTOCOL_RC_OK;
}
@@ -1283,7 +1283,15 @@ relay_remote_event_recv (struct t_relay_remote *remote, const char *data)
json = cJSON_Parse (data);
if (!json)
goto error_data;
{
weechat_printf (
NULL,
_("%sremote[%s]: invalid data received from remote relay: \"%s\""),
weechat_prefix ("error"),
remote->name,
data);
return;
}
event.remote = remote;
event.name = NULL;
@@ -1296,7 +1304,7 @@ relay_remote_event_recv (struct t_relay_remote *remote, const char *data)
json_body = cJSON_GetObjectItem (json, "body");
if (!body_type && ((code == 200) || (code == 204)))
return;
goto end;
JSON_GET_STR(json, event_name);
event.name = event_name;
@@ -1352,7 +1360,15 @@ relay_remote_event_recv (struct t_relay_remote *remote, const char *data)
rc = (callback) (&event);
}
if (rc == WEECHAT_RC_ERROR)
goto error_cb;
{
weechat_printf (
NULL,
_("%sremote[%s]: callback failed for body type \"%s\""),
weechat_prefix ("error"),
remote->name,
body_type);
goto end;
}
}
if (!remote->synced && initial_sync)
@@ -1361,23 +1377,6 @@ relay_remote_event_recv (struct t_relay_remote *remote, const char *data)
weechat_bar_item_update ("input_prompt");
}
return;
error_data:
weechat_printf (
NULL,
_("%sremote[%s]: invalid data received from remote relay: \"%s\""),
weechat_prefix ("error"),
remote->name,
data);
return;
error_cb:
weechat_printf (
NULL,
_("%sremote[%s]: callback failed for body type \"%s\""),
weechat_prefix ("error"),
remote->name,
body_type);
return;
end:
cJSON_Delete (json);
}
@@ -156,6 +156,7 @@ relay_remote_network_check_auth (struct t_relay_remote *remote,
int accept_ok, hash_size;
http_resp = NULL;
json_body = NULL;
msg_error = NULL;
msg_resp_error = NULL;
accept_ok = 0;
@@ -225,6 +226,9 @@ relay_remote_network_check_auth (struct t_relay_remote *remote,
relay_http_response_free (http_resp);
if (json_body)
cJSON_Delete (json_body);
return 1;
error:
@@ -238,6 +242,8 @@ error:
(msg_resp_error) ? msg_resp_error : "",
(msg_resp_error) ? ")" : "");
relay_http_response_free (http_resp);
if (json_body)
cJSON_Delete (json_body);
return 0;
}
@@ -1200,6 +1206,8 @@ relay_remote_network_url_handshake_cb (const void *pointer,
remote->hook_url_handshake = NULL;
json_body = NULL;
ptr_resp_code = weechat_hashtable_get (output, "response_code");
if (ptr_resp_code && ptr_resp_code[0] && (strcmp (ptr_resp_code, "200") != 0))
{
@@ -1211,7 +1219,7 @@ relay_remote_network_url_handshake_cb (const void *pointer,
weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]),
ptr_resp_code);
relay_remote_network_disconnect (remote);
return WEECHAT_RC_OK;
goto end;
}
ptr_error = weechat_hashtable_get (output, "error");
@@ -1225,7 +1233,7 @@ relay_remote_network_url_handshake_cb (const void *pointer,
weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]),
ptr_error);
relay_remote_network_disconnect (remote);
return WEECHAT_RC_OK;
goto end;
}
ptr_output = weechat_hashtable_get (output, "output");
@@ -1262,7 +1270,7 @@ relay_remote_network_url_handshake_cb (const void *pointer,
weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]),
_("hash algorithm not found"));
relay_remote_network_disconnect (remote);
return WEECHAT_RC_OK;
goto end;
}
if (remote->password_hash_iterations < 0)
@@ -1275,7 +1283,7 @@ relay_remote_network_url_handshake_cb (const void *pointer,
weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]),
_("unknown number of hash iterations"));
relay_remote_network_disconnect (remote);
return WEECHAT_RC_OK;
goto end;
}
if (remote->totp < 0)
@@ -1288,7 +1296,7 @@ relay_remote_network_url_handshake_cb (const void *pointer,
weechat_config_string (remote->options[RELAY_REMOTE_OPTION_URL]),
_("unknown TOTP status"));
relay_remote_network_disconnect (remote);
return WEECHAT_RC_OK;
goto end;
}
if (weechat_relay_plugin->debug >= 1)
@@ -1325,7 +1333,7 @@ relay_remote_network_url_handshake_cb (const void *pointer,
weechat_prefix ("error"),
remote->name);
relay_remote_network_disconnect (remote);
return WEECHAT_RC_OK;
goto end;
}
snprintf (option_name, length, "weechat.proxy.%s.type", proxy);
proxy_type = weechat_config_get (option_name);
@@ -1343,7 +1351,7 @@ relay_remote_network_url_handshake_cb (const void *pointer,
_("%sremote[%s]: proxy \"%s\" not found, cannot connect"),
weechat_prefix ("error"), remote->name, proxy);
relay_remote_network_disconnect (remote);
return WEECHAT_RC_OK;
goto end;
}
str_proxy_type = weechat_config_string (proxy_type);
str_proxy_address = weechat_config_string (proxy_address);
@@ -1356,7 +1364,7 @@ relay_remote_network_url_handshake_cb (const void *pointer,
"proxy \"%s\""),
weechat_prefix ("error"), remote->name, proxy);
relay_remote_network_disconnect (remote);
return WEECHAT_RC_OK;
goto end;
}
}
@@ -1375,6 +1383,9 @@ relay_remote_network_url_handshake_cb (const void *pointer,
remote,
NULL);
end:
if (json_body)
cJSON_Delete (json_body);
return WEECHAT_RC_OK;
}
+4 -1
View File
@@ -2070,7 +2070,6 @@ TEST(IrcProtocolWithServer, join)
LONGS_EQUAL(0, ptr_channel->has_quit_server);
LONGS_EQUAL(0, ptr_channel->cycle);
LONGS_EQUAL(0, ptr_channel->part);
LONGS_EQUAL(0, ptr_channel->part);
STRCMP_EQUAL(NULL, ptr_channel->pv_remote_nick_color);
POINTERS_EQUAL(NULL, ptr_channel->hook_autorejoin);
@@ -2090,6 +2089,10 @@ TEST(IrcProtocolWithServer, join)
CHECK(ptr_channel->buffer);
/* second self JOIN should be ignored if already joined */
RECV(":alice!user@host JOIN #test ");
CHECK_NO_MSG;
RECV(":bob!user@host JOIN #test * : ");
CHECK_CHAN("-->", "bob ( ) (user@host) has joined #test",
"irc_join,irc_smart_filter,nick_bob,host_user@host,log4");
+2 -2
View File
@@ -41,8 +41,8 @@
# devel-number the devel version as hex number ("0x04010000" for "4.1.0-dev")
#
weechat_stable="4.8.0"
weechat_devel="4.8.0"
weechat_stable="4.8.2"
weechat_devel="4.8.2"
stable_major=$(echo "${weechat_stable}" | cut -d"." -f1)
stable_minor=$(echo "${weechat_stable}" | cut -d"." -f2)