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
2 changed files with 12 additions and 1 deletions
+11 -1
View File
@@ -375,7 +375,17 @@ void TwitchChannel::sendMessage(const QString &message)
{
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, " ");
}
}
}
}