Skip to content

Bot fix class refactor#88

Merged
oliynykmax merged 2 commits intomainfrom
bot_fix_class_refactor
Sep 23, 2025
Merged

Bot fix class refactor#88
oliynykmax merged 2 commits intomainfrom
bot_fix_class_refactor

Conversation

@oliynykmax
Copy link
Copy Markdown
Owner

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.

@oliynykmax oliynykmax requested a review from v-kuu September 23, 2025 17:00
@oliynykmax oliynykmax linked an issue Sep 23, 2025 that may be closed by this pull request
Copy link
Copy Markdown
Collaborator

@jotuel jotuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@oliynykmax
Copy link
Copy Markdown
Owner Author

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.

Can't see the command being sent twice from bot logging side or from irssi, is there example of situation when it happens?

Copy link
Copy Markdown
Collaborator

@jotuel jotuel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread bot/Bot.cpp
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");
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In here I would change the message to include the token. " filtered word: " + token);

@oliynykmax oliynykmax merged commit 4fb71d9 into main Sep 23, 2025
2 checks passed
@jotuel jotuel deleted the bot_fix_class_refactor branch September 23, 2025 18:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Bot doesn't track operator status

2 participants