mirror of
https://github.com/idanoo/autobrr
synced 2025-07-23 08:49:13 +00:00
fix(irc): revert lazy announcer check (#1707)
This commit is contained in:
parent
0cd29b95ea
commit
80426e4773
1 changed files with 2 additions and 17 deletions
|
@ -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
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue