Skip to content

Commit

Permalink
Fix send_as appearance in channels.
Browse files Browse the repository at this point in the history
  • Loading branch information
john-preston committed Aug 16, 2024
1 parent 73c0186 commit dc1df14
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions Telegram/SourceFiles/main/session/send_as_peers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit dc1df14

Please sign in to comment.