Skip to content

Add a countdown for slow mode and timeouts - #6782

Merged
pajlada merged 7 commits into
Chatterino:masterfrom
achow101:slowmode-timer
Feb 1, 2026
Merged

pajlada merged 7 commits into
Chatterino:masterfrom
achow101:slowmode-timer

Conversation

@achow101

@achow101 achow101 commented Jan 30, 2026 •

Copy link
Copy Markdown
Contributor

When a channel is in slow mode or a user is timed out, it is useful to know how long the user needs to wait before they are able to chat again. This does not prevent sending messages, it only counts down in a UI element to inform the user.

Showing the timer is controlled with a new setting that defaults to off.

There are a few situations I found where the timer is not accurate, and probably others that I didn't check for:

  • If the user is untimed out, there does not appear to be a notification for that. The timer will reset once a message from the user is received back from the channel.
  • If the channel is in slow mode and the message is held by automod, it's unclear when the timer begins. This PR starts the timer the next time a message from the user is received back from the channel.
  • If the user becomes a mod or vip, there does not appear to be a notification for these events so the timer keeps going. Once a message is sent and the USERSTATE update is received, the timer will be updated.

Loosely based on/inspired by #3329

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread src/providers/twitch/IrcMessageHandler.cpp Outdated
Comment thread src/providers/twitch/IrcMessageHandler.cpp Outdated
Comment thread src/providers/twitch/TwitchChannel.cpp Outdated
Comment thread src/providers/twitch/TwitchChannel.cpp Outdated
Comment thread src/providers/twitch/TwitchChannel.cpp Outdated
Comment thread src/widgets/helper/ChannelView.cpp Outdated
Comment thread src/widgets/splits/SplitInput.cpp Outdated
Comment thread src/widgets/splits/SplitInput.cpp Outdated
Comment thread src/widgets/splits/SplitInput.cpp Outdated
@achow101
achow101 force-pushed the slowmode-timer branch 4 times, most recently from 0287f48 to 24c94a0 Compare January 30, 2026 07:21

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread src/providers/twitch/TwitchChannel.cpp Outdated

@pajlada pajlada left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Initial quick review, haven't tested the functionality

Comment thread CHANGELOG.md Outdated
Comment thread src/widgets/splits/SplitInput.hpp
Comment thread src/providers/twitch/IrcMessageHandler.cpp
Comment thread src/providers/twitch/IrcMessageHandler.cpp
Comment thread src/providers/twitch/TwitchChannel.hpp
Comment thread src/providers/twitch/IrcMessageHandler.cpp
Comment thread src/providers/twitch/TwitchChannel.cpp
Comment thread src/providers/twitch/IrcMessageHandler.cpp Outdated
@achow101
achow101 force-pushed the slowmode-timer branch 2 times, most recently from 917e006 to bd6cea3 Compare January 30, 2026 08:41

@Nerixyz Nerixyz left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

The message length label now has more space to the right:

Image

Comment thread src/providers/twitch/IrcMessageHandler.cpp Outdated
Comment thread src/widgets/helper/ChannelView.cpp Outdated
Comment thread src/providers/twitch/IrcMessageHandler.cpp Outdated
@achow101
achow101 force-pushed the slowmode-timer branch 2 times, most recently from 21ba781 to 31cde74 Compare January 30, 2026 20:49
@achow101

Copy link
Copy Markdown
Contributor Author

The message length label now has more space to the right:

I'm not entirely sure how to resolve that. I tried using a vbox but that ends up increasing the height of the input box a lot when neither label is showing anything, and that looked odd to me. The message length label could be swapped to the other side of the timer label, but then the timer label would have the same issue.

@Nerixyz

Nerixyz commented Jan 30, 2026

Copy link
Copy Markdown
Contributor

I'm not entirely sure how to resolve that. I tried using a vbox but that ends up increasing the height of the input box a lot when neither label is showing anything, and that looked odd to me. The message length label could be swapped to the other side of the timer label, but then the timer label would have the same issue.

When no timeout is active, you can hide the label, then the space will be gone. The timeout label and message length label also use a different font.

@achow101

Copy link
Copy Markdown
Contributor Author

When no timeout is active, you can hide the label, then the space will be gone.

I see. I've implemented that now.

@pajlada pajlada left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

As you mentioned, we can't easily receive an untimeout event for ourselves, but it would be good to clear the timer after we've detected a successful message from ourselves that's sent, or a user could be stuck with a 14d timer.

I've tested it now and apart from the above & the review comments, this looks good to me.

Comment thread CHANGELOG.md Outdated
Comment thread src/providers/twitch/IrcMessageHandler.cpp Outdated
Comment thread src/providers/twitch/TwitchChannel.cpp Outdated
Comment thread src/widgets/settingspages/GeneralPage.cpp
@achow101
achow101 force-pushed the slowmode-timer branch 2 times, most recently from 7e8e992 to 71cd115 Compare January 31, 2026 22:53
@achow101

Copy link
Copy Markdown
Contributor Author

but it would be good to clear the timer after we've detected a successful message from ourselves that's sent, or a user could be stuck with a 14d timer.

I changed this so that the timer starts/resets whenever we see a message from the user in the channel. This should resolve the untimeout issue. I think this also resolves the automod issue as well.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

clang-tidy made some suggestions

Comment thread src/providers/twitch/TwitchChannel.cpp Outdated

@pajlada pajlada left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just this then I'm good to merge

Comment thread src/util/FormatTime.hpp Outdated
Adds 'components' to FormatTime to control how many most significant
components the formatted time will have.
When the user may be unable to send a message because they have been
timed out or the channel is in slow mode, it can be helpful to show to
the user how much time is remaining before they can chat again.
If a twitch channel is in slow mode, after a message from the user is
sent by the channel, start the countdown timer to show the user how
much time is remaining before they can chat again.
If the user has been timed out in a channel, start the countdown timer
to show the user how much time is remaining before they can chat again.
@pajlada
pajlada enabled auto-merge (squash) February 1, 2026 11:33
@pajlada
pajlada merged commit f61cd10 into Chatterino:master Feb 1, 2026
19 checks passed
babicekmarek pushed a commit to babicekmarek/streamally-chatterino that referenced this pull request Sep 14, 2026
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.

3 participants