Notify about feed channels list changes.

This commit is contained in:
John Preston
2018-01-29 16:52:09 +03:00
parent 3a5a002be2
commit 366ea1edc3
8 changed files with 87 additions and 8 deletions
+14 -1
View File
@@ -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;