mirror of
https://github.com/AyuGram/AyuGramDesktop.git
synced 2025-06-05 06:33:57 +02:00
Read correct reactions limit from config.
This commit is contained in:
parent
ebf6cea2f5
commit
e540b8cbdc
1 changed files with 9 additions and 1 deletions
|
@ -74,6 +74,14 @@ constexpr auto kTopReactionsLimit = 10;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[[nodiscard]] int SentReactionsLimit(not_null<HistoryItem*> item) {
|
||||||
|
const auto session = &item->history()->session();
|
||||||
|
const auto config = &session->account().appConfig();
|
||||||
|
return session->premium()
|
||||||
|
? config->get<int>("reactions_user_max_premium", 3)
|
||||||
|
: config->get<int>("reactions_user_max_default", 1);
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace
|
} // namespace
|
||||||
|
|
||||||
PossibleItemReactionsRef LookupPossibleReactions(
|
PossibleItemReactionsRef LookupPossibleReactions(
|
||||||
|
@ -853,7 +861,7 @@ void MessageReactions::add(const ReactionId &id, bool addToRecent) {
|
||||||
|
|
||||||
const auto history = _item->history();
|
const auto history = _item->history();
|
||||||
const auto self = history->session().user();
|
const auto self = history->session().user();
|
||||||
const auto myLimit = self->isPremium() ? 5 : 1; // #TODO reactions
|
const auto myLimit = SentReactionsLimit(_item);
|
||||||
if (ranges::contains(chosen(), id)) {
|
if (ranges::contains(chosen(), id)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue