mirror of
https://github.com/telegramdesktop/tdesktop
synced 2025-08-23 10:47:11 +00:00
Slightly improved check of today birthdays suggestion.
This commit is contained in:
parent
384c540197
commit
3501e4f44d
@ -218,9 +218,7 @@ rpl::producer<Ui::SlideWrap<Ui::RpWidget>*> TopBarSuggestionValue(
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
} else if (session->premiumCanBuy()
|
} else if (session->premiumCanBuy()
|
||||||
&& config->suggestionCurrent(kSugBirthdayContacts.utf8())
|
&& config->suggestionCurrent(kSugBirthdayContacts.utf8())) {
|
||||||
&& (!session->data().knownBirthdaysToday()
|
|
||||||
|| !session->data().knownBirthdaysToday()->size())) {
|
|
||||||
session->data().contactBirthdays(
|
session->data().contactBirthdays(
|
||||||
) | rpl::start_with_next(crl::guard(content, [=] {
|
) | rpl::start_with_next(crl::guard(content, [=] {
|
||||||
const auto users = session->data()
|
const auto users = session->data()
|
||||||
|
@ -321,12 +321,12 @@ std::vector<int> AppConfig::getIntArray(
|
|||||||
|
|
||||||
bool AppConfig::suggestionCurrent(const QString &key) const {
|
bool AppConfig::suggestionCurrent(const QString &key) const {
|
||||||
if (key == u"BIRTHDAY_CONTACTS_TODAY"_q) {
|
if (key == u"BIRTHDAY_CONTACTS_TODAY"_q) {
|
||||||
if (_dismissedSuggestions.contains(key)) {
|
if (_dismissedSuggestions.contains(key)
|
||||||
|
|| !_account->sessionExists()) {
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
const auto known = _account->sessionExists()
|
const auto known
|
||||||
? _account->session().data().knownContactBirthdays()
|
= _account->session().data().knownBirthdaysToday();
|
||||||
: std::vector<UserId>();
|
|
||||||
if (!known) {
|
if (!known) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user