From dc1df14a711dfc59f6a44eff3afed9c6d7119255 Mon Sep 17 00:00:00 2001 From: John Preston Date: Fri, 16 Aug 2024 09:45:17 +0200 Subject: [PATCH] Fix send_as appearance in channels. --- .../SourceFiles/main/session/send_as_peers.cpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/Telegram/SourceFiles/main/session/send_as_peers.cpp b/Telegram/SourceFiles/main/session/send_as_peers.cpp index ab75de10314f6..373a5ef40ec01 100644 --- a/Telegram/SourceFiles/main/session/send_as_peers.cpp +++ b/Telegram/SourceFiles/main/session/send_as_peers.cpp @@ -29,14 +29,16 @@ SendAsPeers::SendAsPeers(not_null session) ) | rpl::map([=](const Data::PeerUpdate &update) { const auto peer = update.peer; const auto channel = peer->asChannel(); - return std::tuple( - peer, - peer->amAnonymous(), - channel ? channel->isPublic() : false); + const auto bits = 0 + | (peer->amAnonymous() ? (1 << 0) : 0) + | ((channel && channel->isPublic()) ? (1 << 1) : 0) + | ((channel && channel->addsSignature()) ? (1 << 2) : 0) + | ((channel && channel->signatureProfiles()) ? (1 << 3) : 0); + return std::tuple(peer, bits); }) | rpl::distinct_until_changed( - ) | rpl::filter([=](not_null peer, bool, bool) { - return _lists.contains(peer); - }) | rpl::start_with_next([=](not_null peer, bool, bool) { + ) | rpl::filter([=](not_null peer, int) { + return _lists.contains(peer) || _lastRequestTime.contains(peer); + }) | rpl::start_with_next([=](not_null peer, int) { refresh(peer, true); }, _lifetime); }