mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-04-15 13:47:05 +02:00
Fix send_as appearance in channels.
This commit is contained in:
parent
73c018667d
commit
dc1df14a71
1 changed files with 9 additions and 7 deletions
|
@ -29,14 +29,16 @@ SendAsPeers::SendAsPeers(not_null<Session*> 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<PeerData*> peer, bool, bool) {
|
||||
return _lists.contains(peer);
|
||||
}) | rpl::start_with_next([=](not_null<PeerData*> peer, bool, bool) {
|
||||
) | rpl::filter([=](not_null<PeerData*> peer, int) {
|
||||
return _lists.contains(peer) || _lastRequestTime.contains(peer);
|
||||
}) | rpl::start_with_next([=](not_null<PeerData*> peer, int) {
|
||||
refresh(peer, true);
|
||||
}, _lifetime);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue