Use double spaces instead of Chatterino character when possible (#3081)

This commit is contained in:
Mm2PL 2021-08-01 14:38:07 +02:00 committed by GitHub
parent d7e8f4eabd
commit 77f683577f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 1 deletions

View file

@ -9,6 +9,7 @@
- Minor: Received IRC messages use `time` message tag for timestamp if it's available. (#3021) - Minor: Received IRC messages use `time` message tag for timestamp if it's available. (#3021)
- Minor: Added informative messages for recent-messages API's errors. (#3029) - Minor: Added informative messages for recent-messages API's errors. (#3029)
- Minor: Added section with helpful Chatterino-related links to the About page. (#3068) - Minor: Added section with helpful Chatterino-related links to the About page. (#3068)
- Minor: Now uses spaces instead of magic Unicode character for sending duplicate messages (#3081)
- Minor: Added `channel.live` filter variable (#3092) - Minor: Added `channel.live` filter variable (#3092)
- Bugfix: Fixed "smiley" emotes being unable to be "Tabbed" with autocompletion, introduced in v2.3.3. (#3010) - Bugfix: Fixed "smiley" emotes being unable to be "Tabbed" with autocompletion, introduced in v2.3.3. (#3010)
- Bugfix: Fixed PubSub not properly trying to resolve pending listens when the pending listens list was larger than 50. (#3037) - Bugfix: Fixed PubSub not properly trying to resolve pending listens when the pending listens list was larger than 50. (#3037)

View file

@ -375,7 +375,17 @@ void TwitchChannel::sendMessage(const QString &message)
{ {
if (parsedMessage == this->lastSentMessage_) if (parsedMessage == this->lastSentMessage_)
{ {
parsedMessage.append(MAGIC_MESSAGE_SUFFIX); auto spaceIndex = parsedMessage.indexOf(' ');
if (spaceIndex == -1)
{
// no spaces found, fall back to old magic character
parsedMessage.append(MAGIC_MESSAGE_SUFFIX);
}
else
{
// replace the space we found in spaceIndex with two spaces
parsedMessage.replace(spaceIndex, 1, " ");
}
} }
} }
} }