Skip to content
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

Dont queue msg if its a WHOIS msg already queued as last msg #1485

Closed
wants to merge 1 commit into from

Conversation

michaelortmann
Copy link
Member

@michaelortmann michaelortmann commented Oct 13, 2023

Found by: michaelortmann
Patch by: michaelortmann
Fixes: #715

One-line summary:
Dont queue msg if its a WHOIS msg already queued as last msg

Additional description (if needed):
We already have config setting double-server, but it defaults to 1 and i guess it would have side effects to change its default value to 1, while sending two identical WHOIS in a row should be avoided and doesnt make sense.

eggdrop/eggdrop.conf

Lines 1250 to 1251 in 322bddb

# Allow identical messages in the server queue?
set double-server 1

Test cases demonstrating functionality (if applicable):
.console *
connect to irc server
Before:

[...]
[23:12:12] [!s] WHOIS BotA
[...]
[23:12:12] [@] :irc.example.org 422 BotA :MOTD File is missing
[23:12:12] [@] :BotA MODE BotA :+iwx
[23:12:12] [!s] WHOIS BotA
[23:12:14] [m->] MODE BotA +i-ws
[23:12:14] [@] :BotA MODE BotA :-w
[23:12:14] [!s] WHOIS BotA
[23:12:20] [s->] WHOIS BotA
[23:12:20] [@] :irc.example.org 311 BotA BotA BotA Clk-8553FB0D * :/msg BotA hello
[23:12:20] [@] :irc.example.org 379 BotA BotA :is using modes +ix 
[23:12:20] [@] :irc.example.org 378 BotA BotA :is connecting from *@localhost 127.0.0.1
[23:12:20] [@] :irc.example.org 312 BotA BotA irc.example.org :ExampleNET Server
[23:12:20] [@] :irc.example.org 317 BotA BotA 7 1697231532 :seconds idle, signon time
[23:12:20] [@] :irc.example.org 318 BotA BotA :End of /WHOIS list.
[23:12:22] [s->] WHOIS BotA
[23:12:22] [@] :irc.example.org 311 BotA BotA BotA Clk-8553FB0D * :/msg BotA hello
[23:12:22] [@] :irc.example.org 379 BotA BotA :is using modes +ix 
[23:12:22] [@] :irc.example.org 378 BotA BotA :is connecting from *@localhost 127.0.0.1
[23:12:22] [@] :irc.example.org 312 BotA BotA irc.example.org :ExampleNET Server
[23:12:22] [@] :irc.example.org 317 BotA BotA 10 1697231532 :seconds idle, signon time
[23:12:22] [@] :irc.example.org 318 BotA BotA :End of /WHOIS list.
[23:12:24] [s->] WHOIS BotA
[23:12:24] [@] :irc.example.org 311 BotA BotA BotA Clk-8553FB0D * :/msg BotA hello
[23:12:24] [@] :irc.example.org 379 BotA BotA :is using modes +ix 
[23:12:24] [@] :irc.example.org 378 BotA BotA :is connecting from *@localhost 127.0.0.1
[23:12:24] [@] :irc.example.org 312 BotA BotA irc.example.org :ExampleNET Server
[23:12:24] [@] :irc.example.org 317 BotA BotA 12 1697231532 :seconds idle, signon time
[23:12:24] [@] :irc.example.org 318 BotA BotA :End of /WHOIS list.

After:

[...]
[23:12:45] [!s] WHOIS BotA
[...]
[23:12:45] [@] :irc.example.org 422 BotA :MOTD File is missing
[23:12:45] [@] :BotA MODE BotA :+iwx
[23:12:45] WHOIS Message already queued as last message; skipping: WHOIS BotA
[23:12:47] [m->] MODE BotA +i-ws
[23:12:47] [@] :BotA MODE BotA :-w
[23:12:47] WHOIS Message already queued as last message; skipping: WHOIS BotA
[23:12:53] [s->] WHOIS BotA
[23:12:53] [@] :irc.example.org 311 BotA BotA BotA Clk-8553FB0D * :/msg BotA hello
[23:12:53] [@] :irc.example.org 379 BotA BotA :is using modes +ix 
[23:12:53] [@] :irc.example.org 378 BotA BotA :is connecting from *@localhost 127.0.0.1
[23:12:53] [@] :irc.example.org 312 BotA BotA irc.example.org :ExampleNET Server
[23:12:53] [@] :irc.example.org 317 BotA BotA 8 1697231565 :seconds idle, signon time
[23:12:53] [@] :irc.example.org 318 BotA BotA :End of /WHOIS list.

@thommey
Copy link
Member

thommey commented Dec 30, 2023

Unfortunately, I don't want to merge this approach.

I understand the idea but Tcl scripts are free to send commands as well, and they could rely on them all being answered.

Whether something has to be duplicated or it's fine if it's already in the queue is something only the caller can tell.

Maybe a solution would be a queue-command that checks if the exact line is already in the queue and then not queue it. Could also solve #1489 with it.

Closing this one though.

@thommey thommey closed this Dec 30, 2023
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.

[s->] WHOIS <nick>
2 participants