From cbbc41f1abf95309f6388e11132c963ac252d644 Mon Sep 17 00:00:00 2001 From: Baytuch Date: Mon, 17 Jun 2024 08:11:12 +0300 Subject: [PATCH] Fix generate tag from address (servers.c) The tag will be created from the domain name when the domain name begins with 'irc.'. In this case, part of the address will be used to the point or the remaining part as a tag. For example, irc.it-hobby.km.ua to will be make tag 'it-hobby'. [08:22] [Lastick(+i)] [4:it-hobby/#samp(+Pnt)] --- src/core/servers.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/core/servers.c b/src/core/servers.c index 30fc6844..df316eb5 100644 --- a/src/core/servers.c +++ b/src/core/servers.c @@ -78,6 +78,10 @@ static char *server_create_address_tag(const char *address) /* try to generate a reasonable server tag */ if (strchr(address, '.') == NULL) { start = end = NULL; + } else if (g_ascii_strncasecmp(address, "irc.", 4) == 0) { + /* irc.it-hobby.km.ua -> it-hobby, irc.karbo-labs.pp.ua -> karbo-labs */ + end = strchr(address + 3 + 1, '.'); + start = address + 3; } else if (g_ascii_strncasecmp(address, "irc", 3) == 0 || g_ascii_strncasecmp(address, "chat", 4) == 0) { /* irc-2.cs.hut.fi -> hut, chat.bt.net -> bt */