Bot fix class refactor#88
Merged
oliynykmax merged 2 commits intomainfrom Sep 23, 2025
Merged
Conversation
…dded, now bot tracks filter in each channel separate, instead of global list
jotuel
reviewed
Sep 23, 2025
Collaborator
jotuel
left a comment
There was a problem hiding this comment.
Changes look great. It seems though that it sends commands twice now. Have not yet found out why. Valgrind does not complain or show any leaks.
Owner
Author
Can't see the command being sent twice from bot logging side or from irssi, is there example of situation when it happens? |
jotuel
approved these changes
Sep 23, 2025
Collaborator
There was a problem hiding this comment.
I made one small change and recompiled and no more duplicate messages so first run was like this:
>> KICK #kanava aa :filtered word
>> KICK #kanava aa :filtered word
<< :ircbot!ircbot@0 KICK #kanava aa :filtered word
<< 441 ircbot #kanava :They aren't on that channel
But after recompilation:
>> KICK #kanava aa :filtered word norm
<< :ircbot!ircbot@0 KICK #kanava aa :filtered word norm
So all good.
| std::string token; auto flush_token = [&]() { | ||
| if (token.empty()) return false; | ||
| if (filter.find(token) != filter.end()) { | ||
| send_line("KICK " + target + " " + sender_nick + " :filtered word"); |
Collaborator
There was a problem hiding this comment.
In here I would change the message to include the token. " filtered word: " + token);
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
So, I did a refactor that I believed made everything more understandable and maintainable, fixed the spotted issue with bot no tracking the operator status, now on /quit and /part users are removed from operators list. Now also filter is working in each channel separately+there is some commands to check it or remove something from it. Before it used to kick users for words banned in other channels. Please review and check the valgrind, as it is broken on my linux distribution, and I am not totally sure if everything is clean.