feat: improve handling of shared chat messages (#5606)

Co-authored-by: Rasmus Karlsson <rasmus.karlsson@pajlada.com>
This commit is contained in:
iProdigy
2024-10-05 10:31:52 +00:00
committed by GitHub
parent 81d72db76b
commit 06d9a37709
11 changed files with 199 additions and 33 deletions
+13
View File
@@ -15,6 +15,7 @@
#include <ctime>
#include <memory>
#include <optional>
#include <tuple>
#include <unordered_map>
#include <utility>
@@ -164,7 +165,10 @@ public:
QString userName;
/// The Twitch Channel the message was received in
TwitchChannel *twitchChannel = nullptr;
/// The Twitch Channel the message was sent in, according to the Shared Chat feature
TwitchChannel *sourceChannel = nullptr;
Message *operator->();
Message &message();
@@ -278,6 +282,15 @@ protected:
void appendChannelName();
void appendUsername();
/// Return the Twitch Channel this message originated from
///
/// Useful to handle messages from the "Shared Chat" feature
///
/// Can return nullptr
const TwitchChannel *getSourceChannel() const;
std::tuple<std::optional<EmotePtr>, MessageElementFlags, bool> parseEmote(
const EmoteName &name) const;
Outcome tryAppendEmote(const EmoteName &name);
void addWords(const QStringList &words,