From e87302ca2d15aaf6455e5cb84b2042c31436b2c7 Mon Sep 17 00:00:00 2001 From: iProdigy Date: Sun, 20 Oct 2024 21:40:32 -0700 Subject: [PATCH] docs: explain getOrPopulateChannelCache --- src/messages/MessageBuilder.cpp | 2 +- src/providers/twitch/TwitchIrcServer.hpp | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/messages/MessageBuilder.cpp b/src/messages/MessageBuilder.cpp index efc885a49..35b360b00 100644 --- a/src/messages/MessageBuilder.cpp +++ b/src/messages/MessageBuilder.cpp @@ -2759,7 +2759,7 @@ void MessageBuilder::appendTwitchBadges(const QVariantMap &tags, if (this->message().flags.has(MessageFlag::SharedMessage)) { - QString sourceId = tags["source-room-id"].toString(); + const QString sourceId = tags["source-room-id"].toString(); std::optional sourceName; if (twitchChannel->roomId() == sourceId) { diff --git a/src/providers/twitch/TwitchIrcServer.hpp b/src/providers/twitch/TwitchIrcServer.hpp index 532e0afe2..a590a41f8 100644 --- a/src/providers/twitch/TwitchIrcServer.hpp +++ b/src/providers/twitch/TwitchIrcServer.hpp @@ -100,6 +100,11 @@ public: std::shared_ptr getChannelOrEmptyByID( const QString &channelID) override; + /** + * Obtains the channel login name associated with the passed ID, + * so that Shared Chat messages can provide source channel context. + * Can yield an empty string if a helix request is already in-flight. + */ std::optional getOrPopulateChannelCache( const QString &channelId) override;