2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

PoC content outside of PopupMenu.

This commit is contained in:
John Preston
2022-08-17 21:03:57 +03:00
parent c20ed7c7a8
commit a0d5456a4d
14 changed files with 275 additions and 25 deletions

View File

@@ -533,12 +533,20 @@ ReactionsFilter PeerReactionsFilter(not_null<PeerData*> peer) {
});
}
int UniqueReactionsLimit(not_null<Main::AppConfig*> config) {
return config->get<int>("reactions_uniq_max", 11);
}
int UniqueReactionsLimit(not_null<PeerData*> peer) {
return UniqueReactionsLimit(&peer->session().account().appConfig());
}
rpl::producer<int> UniqueReactionsLimitValue(
not_null<Main::Session*> session) {
const auto config = &session->account().appConfig();
return config->value(
) | rpl::map([=] {
return config->get<int>("reactions_uniq_max", 11);
return UniqueReactionsLimit(config);
}) | rpl::distinct_until_changed();
}

View File

@@ -138,6 +138,7 @@ inline auto PeerFullFlagValue(
[[nodiscard]] rpl::producer<ReactionsFilter> PeerReactionsFilterValue(
not_null<PeerData*> peer);
[[nodiscard]] int UniqueReactionsLimit(not_null<PeerData*> peer);
[[nodiscard]] rpl::producer<int> UniqueReactionsLimitValue(
not_null<Main::Session*> session);