Compare commits

..

1 commit

Author SHA1 Message Date
iProdigy 731418dbb8
Merge 64ccef94d1 into 867e3f3ab0 2024-10-21 00:57:41 +02:00
2 changed files with 4 additions and 14 deletions

View file

@ -2759,7 +2759,7 @@ void MessageBuilder::appendTwitchBadges(const QVariantMap &tags,
if (this->message().flags.has(MessageFlag::SharedMessage)) if (this->message().flags.has(MessageFlag::SharedMessage))
{ {
const QString sourceId = tags["source-room-id"].toString(); QString sourceId = tags["source-room-id"].toString();
std::optional<QString> sourceName; std::optional<QString> sourceName;
if (twitchChannel->roomId() == sourceId) if (twitchChannel->roomId() == sourceId)
{ {
@ -2773,14 +2773,9 @@ void MessageBuilder::appendTwitchBadges(const QVariantMap &tags,
if (sourceName.has_value()) if (sourceName.has_value())
{ {
const auto &name = sourceName.value(); this->emplace<BadgeElement>(makeSharedChatBadge(sourceName.value()),
auto *badge = this->emplace<BadgeElement>( MessageElementFlag::BadgeSharedChannel)
makeSharedChatBadge(name), ->setLink({Link::UserInfo, sourceName.value()});
MessageElementFlag::BadgeSharedChannel);
if (!name.isEmpty())
{
badge->setLink({Link::UserInfo, name});
}
} }
} }

View file

@ -100,11 +100,6 @@ public:
std::shared_ptr<Channel> getChannelOrEmptyByID( std::shared_ptr<Channel> getChannelOrEmptyByID(
const QString &channelID) override; 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<QString> getOrPopulateChannelCache( std::optional<QString> getOrPopulateChannelCache(
const QString &channelId) override; const QString &channelId) override;