mirror of
https://github.com/ZoiteChat/zoitechat.git
synced 2026-03-15 10:10:19 +00:00
Fix loading encoding from network list on connect
- Fix setting new encoding when switching networks - Ignore ports when looking for network by hostname - Only set UTF-8 when nothing explicitly set Fixes #1628
This commit is contained in:
@@ -714,8 +714,19 @@ servlist_net_find_from_server (char *server_name)
|
||||
slist = net->servlist;
|
||||
while (slist)
|
||||
{
|
||||
gsize hostname_len;
|
||||
const char *hostname, *p;
|
||||
|
||||
serv = slist->data;
|
||||
if (g_ascii_strcasecmp (serv->hostname, server_name) == 0)
|
||||
hostname = serv->hostname;
|
||||
|
||||
/* Ignore port when comparing */
|
||||
if ((p = strchr (hostname, '/')))
|
||||
hostname_len = p - hostname;
|
||||
else
|
||||
hostname_len = strlen (hostname);
|
||||
|
||||
if (g_ascii_strncasecmp (hostname, server_name, hostname_len) == 0)
|
||||
return net;
|
||||
slist = slist->next;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user