mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 14:45:14 +00:00
Improved processing of premium accounts limits.
This commit is contained in:
@@ -467,11 +467,11 @@ void Domain::scheduleWriteAccounts() {
|
||||
}
|
||||
|
||||
int Domain::maxAccounts() const {
|
||||
const auto isAnyPreimium = ranges::any_of(accounts(), [](
|
||||
const auto premiumCount = ranges::count_if(accounts(), [](
|
||||
const Main::Domain::AccountWithIndex &d) {
|
||||
return d.account->session().premium();
|
||||
return d.account->sessionExists() && d.account->session().premium();
|
||||
});
|
||||
return isAnyPreimium ? kPremiumMaxAccounts : kMaxAccounts;
|
||||
return std::min(int(premiumCount) + kMaxAccounts, kPremiumMaxAccounts);
|
||||
}
|
||||
|
||||
rpl::producer<int> Domain::maxAccountsChanges() const {
|
||||
|
@@ -31,7 +31,7 @@ public:
|
||||
};
|
||||
|
||||
static constexpr auto kMaxAccounts = 3;
|
||||
static constexpr auto kPremiumMaxAccounts = 4;
|
||||
static constexpr auto kPremiumMaxAccounts = 6;
|
||||
|
||||
explicit Domain(const QString &dataName);
|
||||
~Domain();
|
||||
|
Reference in New Issue
Block a user