-
-
Notifications
You must be signed in to change notification settings - Fork 123
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(irc): allow lazy announcer nicks #1322
base: develop
Are you sure you want to change the base?
Conversation
this reverts the previous commits
Considering the variability in bot nickname postfixes, it might be impractical to assume that a digit will be appended for the IRC nick. From my observation a // Verify if the nickname concludes with an asterisk and holds the correct prefix
if strings.HasSuffix(announcer, "*") && strings.HasPrefix(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
} Since IRC nicknames typically do not permit asterisks, this adjustment accommodates cases where an announcer ends with an asterisk in its definition. Additionally, I have omitted the requirement for the last character to be a digit, which was the original issue I anticipated. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we want to allow this I think we should go over all definitions and hardcode the URLs so that the worst thing that can happen is someone just announcing old ids on the same domain. Currently most of our definitions just do a loose addr match and tries to find things like id=(.+)
on the end.
Given how some indexers are “lazy” in the lack of a better word with NickServ identifying their announcers, this seems like a good addition.
d27ef46 simplifies this by making it support a suffixed digit all the time. This commit reverts all the previous commits.
Outdated
![CleanShot 2023-12-29 at 22 53 11@2x](https://github.com/autobrr/autobrr/assets/18177310/d7277ffc-f398-4647-a607-2f943800ef26)