fix(irc): revert lazy announcer check (#1707)

This commit is contained in:
ze0s 2024-09-05 19:36:40 +02:00 committed by GitHub
parent 0cd29b95ea
commit 80426e4773
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1019,24 +1019,9 @@ func (h *Handler) isValidAnnouncer(nick string) bool {
h.m.RLock() h.m.RLock()
defer h.m.RUnlock() defer h.m.RUnlock()
nick = strings.ToLower(nick) _, ok := h.validAnnouncers[strings.ToLower(nick)]
for announcer := range h.validAnnouncers { return ok
if nick == announcer {
return true
}
// Confirm if the nickname starts with the announcer and comprises one additional character
if strings.HasPrefix(nick, announcer) && len(nick) == len(announcer)+1 {
return true
}
// Verify if the nickname concludes with an asterisk and holds the correct prefix
if strings.HasSuffix(announcer, "*") && strings.HasPrefix(nick, announcer) {
return true
}
}
return false
} }
// check if channel is one from the list in the definition // check if channel is one from the list in the definition