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

Compare commits

..

7 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
8 changed files with 67 additions and 38 deletions
+8
View File
@@ -6,6 +6,14 @@ 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
+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 ""
+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.1"
weechat_devel="4.8.1"
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)