From effe91badcfab273bca0bf9e5194280a010533b7 Mon Sep 17 00:00:00 2001 From: Rasmus Karlsson Date: Wed, 1 May 2019 22:10:51 +0200 Subject: [PATCH] clean up magic message suffix stuff --- src/providers/twitch/TwitchChannel.cpp | 8 +++----- src/providers/twitch/TwitchChannel.hpp | 1 - 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/src/providers/twitch/TwitchChannel.cpp b/src/providers/twitch/TwitchChannel.cpp index 1956e47f9..2d4ee4a49 100644 --- a/src/providers/twitch/TwitchChannel.cpp +++ b/src/providers/twitch/TwitchChannel.cpp @@ -30,6 +30,8 @@ namespace chatterino { namespace { + constexpr char MAGIC_MESSAGE_SUFFIX[] = u8" \U000E0000"; + // parseRecentMessages takes a json object and returns a vector of // Communi IrcMessages auto parseRecentMessages(const QJsonObject &jsonRoot, ChannelPtr channel) @@ -121,10 +123,6 @@ TwitchChannel::TwitchChannel(const QString &name, [=] { this->refreshLiveStatus(); }); this->liveStatusTimer_.start(60 * 1000); - // -- - this->messageSuffix_.append(' '); - this->messageSuffix_.append("󠀀"); // E0000 - // debugging #if 0 for (int i = 0; i < 1000; i++) { @@ -199,7 +197,7 @@ void TwitchChannel::sendMessage(const QString &message) { if (parsedMessage == this->lastSentMessage_) { - parsedMessage.append(this->messageSuffix_); + parsedMessage.append(MAGIC_MESSAGE_SUFFIX); } } } diff --git a/src/providers/twitch/TwitchChannel.hpp b/src/providers/twitch/TwitchChannel.hpp index 00a6c9513..9c4089ff0 100644 --- a/src/providers/twitch/TwitchChannel.hpp +++ b/src/providers/twitch/TwitchChannel.hpp @@ -166,7 +166,6 @@ private: bool partedUsersMergeQueued_ = false; // -- - QByteArray messageSuffix_; QString lastSentMessage_; QObject lifetimeGuard_; QTimer liveStatusTimer_;