diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-05-14 09:01:44 +0200 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-05-14 15:32:39 +0200 |
commit | 1116474c45ebb00011ec8c1694dda230251f17b3 (patch) | |
tree | 73085e14abfcd2192496a803243d6d0389b8620d /src/plugins | |
parent | 176a10677137e887ed5e8299669bacbc4148d65a (diff) | |
download | weechat-1116474c45ebb00011ec8c1694dda230251f17b3.zip |
irc: reset all internal servers variables when disconnecting
Diffstat (limited to 'src/plugins')
-rw-r--r-- | src/plugins/irc/irc-server.c | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/src/plugins/irc/irc-server.c b/src/plugins/irc/irc-server.c index b99831f6e..8d334e8dc 100644 --- a/src/plugins/irc/irc-server.c +++ b/src/plugins/irc/irc-server.c @@ -5651,6 +5651,48 @@ irc_server_disconnect (struct t_irc_server *server, int switch_address, weechat_hashtable_remove_all (server->cap_list); server->multiline_max_bytes = IRC_SERVER_MULTILINE_DEFAULT_MAX_BYTES; server->multiline_max_lines = IRC_SERVER_MULTILINE_DEFAULT_MAX_LINES; + if (server->isupport) + { + free (server->isupport); + server->isupport = NULL; + } + if (server->prefix_modes) + { + free (server->prefix_modes); + server->prefix_modes = NULL; + } + if (server->prefix_chars) + { + free (server->prefix_chars); + server->prefix_chars = NULL; + } + server->nick_max_length = 0; + server->user_max_length = 0; + server->host_max_length = 0; + server->casemapping = IRC_SERVER_CASEMAPPING_RFC1459; + server->utf8mapping = IRC_SERVER_UTF8MAPPING_NONE; + if (server->chantypes) + { + free (server->chantypes); + server->chantypes = NULL; + } + if (server->chanmodes) + { + free (server->chanmodes); + server->chanmodes = NULL; + } + if (server->clienttagdeny) + { + free (server->clienttagdeny); + server->clienttagdeny = NULL; + } + if (server->clienttagdeny_array) + { + weechat_string_free_split (server->clienttagdeny_array); + server->clienttagdeny_array = NULL; + } + server->clienttagdeny_count = 0; + server->typing_allowed = 1; server->is_away = 0; server->away_time = 0; server->lag = 0; |