Use the leaky bucket algorithm to rate limit irc messages.
Review Request #524 — Created Feb. 24, 2021 and submitted — Latest diff uploaded
The default values were suggested by an operator of libera.
We don't rate limit the login process, nor parts and quits. However, if you
paste a bunch of text and then part a channel, you will be spammed with a
bunch of "no such nick/channel" error dialogs. I tried to work around this,
but the alternative just makes irc unresponsive until all the pasted messages
are sent. That said, other messages are still delayed while these errors
dialogs are slowly popping up.
Lots