2
0
mirror of https://github.com/telegramdesktop/tdesktop synced 2025-08-30 22:16:14 +00:00

Move to std::optional.

This commit is contained in:
John Preston
2018-09-21 19:28:46 +03:00
parent 850efbde95
commit 2e5a0e056c
115 changed files with 632 additions and 672 deletions

View File

@@ -39,7 +39,7 @@ int OnlinePhraseChangeInSeconds(TimeId online, TimeId now) {
return std::max(static_cast<TimeId>(nowFull.secsTo(tomorrow)), 0);
}
base::optional<QString> OnlineTextSpecial(not_null<UserData*> user) {
std::optional<QString> OnlineTextSpecial(not_null<UserData*> user) {
if (isNotificationsUser(user->id)) {
return lang(lng_status_service_notifications);
} else if (user->botInfo) {
@@ -47,10 +47,10 @@ base::optional<QString> OnlineTextSpecial(not_null<UserData*> user) {
} else if (isServiceUser(user->id)) {
return lang(lng_status_support);
}
return base::none;
return std::nullopt;
}
base::optional<QString> OnlineTextCommon(TimeId online, TimeId now) {
std::optional<QString> OnlineTextCommon(TimeId online, TimeId now) {
if (online <= 0) {
switch (online) {
case 0:
@@ -65,7 +65,7 @@ base::optional<QString> OnlineTextCommon(TimeId online, TimeId now) {
} else if (online > now) {
return lang(lng_status_online);
}
return base::none;
return std::nullopt;
}
} // namespace