mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2026-07-30 01:08:02 +00:00
Notify about feed channels list changes.
This commit is contained in:
@@ -76,10 +76,15 @@ void Feed::registerOne(not_null<ChannelData*> channel) {
|
||||
_parent->session().storage().remove(
|
||||
Storage::FeedMessagesInvalidate(_id));
|
||||
|
||||
history->updateChatListExistence();
|
||||
if (invisible && _channels.size() > 1) {
|
||||
updateChatListExistence();
|
||||
for (const auto history : _channels) {
|
||||
history->updateChatListExistence();
|
||||
}
|
||||
} else {
|
||||
history->updateChatListExistence();
|
||||
}
|
||||
_parent->notifyFeedUpdated(this, FeedUpdateFlag::Channels);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -98,7 +103,11 @@ void Feed::unregisterOne(not_null<ChannelData*> channel) {
|
||||
history->updateChatListExistence();
|
||||
if (visible && _channels.size() < 2) {
|
||||
updateChatListExistence();
|
||||
for (const auto history : _channels) {
|
||||
history->updateChatListExistence();
|
||||
}
|
||||
}
|
||||
_parent->notifyFeedUpdated(this, FeedUpdateFlag::Channels);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -138,6 +147,10 @@ void Feed::paintUserpic(
|
||||
}
|
||||
}
|
||||
|
||||
const std::vector<not_null<History*>> &Feed::channels() const {
|
||||
return _channels;
|
||||
}
|
||||
|
||||
bool Feed::justSetLastMessage(not_null<HistoryItem*> item) {
|
||||
if (_lastMessage && item->position() <= _lastMessage->position()) {
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user