1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-27 21:36:37 +02:00

relay: set the last IRC client disconnection time only after a successful connection (issue #2103)

This commit is contained in:
Sébastien Helleu
2024-03-26 08:04:49 +01:00
parent ea87d42b49
commit 0e074aa4bb
2 changed files with 14 additions and 3 deletions
+1
View File
@@ -21,6 +21,7 @@ Bug fixes::
* exec: add missing exec tags in lines of buffers with free content (issue #2086)
* irc: add missing tags on self action messages when capability echo-message is enabled (issue #2074)
* python: fix truncation of unsigned long long integer returned by function string_parse_size
* relay: set the last IRC client disconnection time only after a successful connection (issue #2103)
* script: always display list of scripts when searching scripts with `/script search` (issue #2077)
* script: fix default mouse keys (issue #2076)
* scripts: fix crash on script unload when a hook is created in a buffer close callback (issue #2067)
+13 -3
View File
@@ -1634,6 +1634,9 @@ relay_client_set_status (struct t_relay_client *client,
enum t_relay_status status)
{
struct t_relay_server *ptr_server;
int old_status;
old_status = client->status;
/*
* IMPORTANT: if changes are made in this function or sub-functions called,
@@ -1658,9 +1661,16 @@ relay_client_set_status (struct t_relay_client *client,
{
client->end_time = time (NULL);
ptr_server = relay_server_search (client->protocol_string);
if (ptr_server)
ptr_server->last_client_disconnect = client->end_time;
if (old_status == RELAY_STATUS_CONNECTED)
{
/*
* set the last client disconnect time
* (only if the client was connected)
*/
ptr_server = relay_server_search (client->protocol_string);
if (ptr_server)
ptr_server->last_client_disconnect = client->end_time;
}
relay_client_outqueue_free_all (client);