Fix /me not going through upon sending an identical message (#3166)

This commit is contained in:
Paweł 2021-08-15 11:52:32 +02:00 committed by GitHub
parent d46589ca26
commit 9a1e405563
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 11 additions and 0 deletions

View file

@ -7,6 +7,7 @@
- Minor: Display a system message when reloading subscription emotes to match BTTV/FFZ behavior (#3135)
- Minor: Added a setting to hide similar messages by any user. (#2716)
- Minor: Duplicate spaces now count towards the display message length. (#3002)
- Bugfix: Restored ability to send duplicate `/me` messages. (#3166)
- Bugfix: Notifications for moderators about other moderators deleting messages can now be disabled. (#3121)
- Bugfix: Moderation mode and active filters are now preserved when opening a split as a popup. (#3113, #3130)
- Bugfix: Fixed a bug that caused all badge highlights to use the same color. (#3132, #3134)

View file

@ -377,6 +377,16 @@ void TwitchChannel::sendMessage(const QString &message)
if (parsedMessage == this->lastSentMessage_)
{
auto spaceIndex = parsedMessage.indexOf(' ');
// If the message starts with either '/' or '.' Twitch will treat it as a command, omitting
// first space and only rest of the arguments treated as actual message content
// In cases when user sends a message like ". .a b" first character and first space are omitted as well
bool ignoreFirstSpace =
parsedMessage.at(0) == '/' || parsedMessage.at(0) == '.';
if (ignoreFirstSpace)
{
spaceIndex = parsedMessage.indexOf(' ', spaceIndex + 1);
}
if (spaceIndex == -1)
{
// no spaces found, fall back to old magic character