mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-13 19:49:51 +01:00
Compare commits
4 commits
731418dbb8
...
617d47b7e7
Author | SHA1 | Date | |
---|---|---|---|
617d47b7e7 | |||
a9b446ffc7 | |||
021f1a0bfc | |||
e87302ca2d |
|
@ -2759,7 +2759,7 @@ void MessageBuilder::appendTwitchBadges(const QVariantMap &tags,
|
||||||
|
|
||||||
if (this->message().flags.has(MessageFlag::SharedMessage))
|
if (this->message().flags.has(MessageFlag::SharedMessage))
|
||||||
{
|
{
|
||||||
QString sourceId = tags["source-room-id"].toString();
|
const QString sourceId = tags["source-room-id"].toString();
|
||||||
std::optional<QString> sourceName;
|
std::optional<QString> sourceName;
|
||||||
if (twitchChannel->roomId() == sourceId)
|
if (twitchChannel->roomId() == sourceId)
|
||||||
{
|
{
|
||||||
|
@ -2773,9 +2773,14 @@ void MessageBuilder::appendTwitchBadges(const QVariantMap &tags,
|
||||||
|
|
||||||
if (sourceName.has_value())
|
if (sourceName.has_value())
|
||||||
{
|
{
|
||||||
this->emplace<BadgeElement>(makeSharedChatBadge(sourceName.value()),
|
const auto &name = sourceName.value();
|
||||||
MessageElementFlag::BadgeSharedChannel)
|
auto *badge = this->emplace<BadgeElement>(
|
||||||
->setLink({Link::UserInfo, sourceName.value()});
|
makeSharedChatBadge(name),
|
||||||
|
MessageElementFlag::BadgeSharedChannel);
|
||||||
|
if (!name.isEmpty())
|
||||||
|
{
|
||||||
|
badge->setLink({Link::UserInfo, name});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -100,6 +100,11 @@ 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;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue