mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Display channels promoted by proxy on top.
This commit is contained in:
@@ -83,10 +83,14 @@ void Session::setupChannelLeavingViewer() {
|
||||
return update.peer->asChannel();
|
||||
}) | rpl::filter([](ChannelData *channel) {
|
||||
return (channel != nullptr)
|
||||
&& !(channel->amIn())
|
||||
&& (channel->feed() != nullptr);
|
||||
&& !(channel->amIn());
|
||||
}) | rpl::start_with_next([=](not_null<ChannelData*> channel) {
|
||||
channel->clearFeed();
|
||||
if (const auto history = App::historyLoaded(channel->id)) {
|
||||
history->removeJoinedMessage();
|
||||
history->updateChatListExistence();
|
||||
history->updateChatListSortPosition();
|
||||
}
|
||||
}, _lifetime);
|
||||
}
|
||||
|
||||
@@ -1592,4 +1596,24 @@ MessageIdsList Session::takeMimeForwardIds() {
|
||||
return std::move(_mimeForwardIds);
|
||||
}
|
||||
|
||||
void Session::setProxyPromoted(PeerData *promoted) {
|
||||
if (_proxyPromoted != promoted) {
|
||||
if (const auto history = App::historyLoaded(_proxyPromoted)) {
|
||||
history->cacheProxyPromoted(false);
|
||||
}
|
||||
_proxyPromoted = promoted;
|
||||
if (_proxyPromoted) {
|
||||
const auto history = App::history(_proxyPromoted);
|
||||
history->cacheProxyPromoted(true);
|
||||
if (!history->lastMessageKnown()) {
|
||||
_session->api().requestDialogEntry(history);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PeerData *Session::proxyPromoted() const {
|
||||
return _proxyPromoted;
|
||||
}
|
||||
|
||||
} // namespace Data
|
||||
|
Reference in New Issue
Block a user