mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Update API scheme on layer 145.
This commit is contained in:
@@ -459,16 +459,16 @@ rpl::producer<int> AllowedReactionsCountValue(not_null<PeerData*> peer) {
|
||||
if (peer->isUser()) {
|
||||
return FullReactionsCountValue(&peer->session());
|
||||
}
|
||||
return peer->session().changes().peerFlagsValue(
|
||||
peer,
|
||||
UpdateFlag::Reactions
|
||||
) | rpl::map([=] {
|
||||
if (const auto chat = peer->asChat()) {
|
||||
return int(chat->allowedReactions().size());
|
||||
} else if (const auto channel = peer->asChannel()) {
|
||||
return int(channel->allowedReactions().size());
|
||||
}
|
||||
Unexpected("Peer type in AllowedReactionsCountValue.");
|
||||
return rpl::combine(
|
||||
FullReactionsCountValue(&peer->session()),
|
||||
peer->session().changes().peerFlagsValue(
|
||||
peer,
|
||||
UpdateFlag::Reactions)
|
||||
) | rpl::map([=](int full, const auto&) {
|
||||
const auto &allowed = Data::PeerAllowedReactions(peer);
|
||||
return (allowed.type == Data::AllowedReactionsType::Some)
|
||||
? int(allowed.some.size())
|
||||
: full;
|
||||
});
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user