feat(emote-popup): automatically reload Twitch emotes (#5580)

This commit is contained in:
nerix
2024-09-01 13:44:36 +02:00
committed by GitHub
parent 820aa12af6
commit 61b04dbe7b
8 changed files with 79 additions and 15 deletions
+10
View File
@@ -897,6 +897,11 @@ ChannelPtr ChannelView::channel()
return this->channel_;
}
ChannelPtr ChannelView::underlyingChannel() const
{
return this->underlyingChannel_;
}
bool ChannelView::showScrollbarHighlights() const
{
return this->channel_->getType() != Channel::Type::TwitchMentions;
@@ -976,6 +981,11 @@ void ChannelView::setChannel(const ChannelPtr &underlyingChannel)
this->channel_->fillInMissingMessages(filtered);
});
this->channelConnections_.managedConnect(underlyingChannel->messagesCleared,
[this]() {
this->clearMessages();
});
// Copy over messages from the backing channel to the filtered one
// and the ui.
auto snapshot = underlyingChannel->getMessageSnapshot();
+12 -1
View File
@@ -144,9 +144,20 @@ public:
/// filter settings. It will always be of type Channel, not TwitchChannel
/// nor IrcChannel.
/// It's **not** equal to the channel passed in #setChannel().
/// @see #underlyingChannel()
ChannelPtr channel();
/// Set the channel this view is displaying
/// @brief The channel this view displays messages for
///
/// This channel potentially contains more messages than visible in this
/// view due to filter settings.
/// It's equal to the channel passed in #setChannel().
/// @see #channel()
ChannelPtr underlyingChannel() const;
/// @brief Set the channel this view is displaying
///
/// @see #underlyingChannel()
void setChannel(const ChannelPtr &underlyingChannel);
void setFilters(const QList<QUuid> &ids);