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

Use crl::time/now instead of TimeMs/getms.

This commit is contained in:
John Preston
2019-02-19 10:57:53 +04:00
parent d208236994
commit fe618bd652
310 changed files with 1133 additions and 1141 deletions

View File

@@ -15,8 +15,8 @@ https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
namespace Data {
namespace {
constexpr auto kMinOnlineChangeTimeout = TimeMs(1000);
constexpr auto kMaxOnlineChangeTimeout = 86400 * TimeMs(1000);
constexpr auto kMinOnlineChangeTimeout = crl::time(1000);
constexpr auto kMaxOnlineChangeTimeout = 86400 * crl::time(1000);
constexpr auto kSecondsInDay = 86400;
int OnlinePhraseChangeInSeconds(TimeId online, TimeId now) {
@@ -273,16 +273,16 @@ TimeId SortByOnlineValue(not_null<UserData*> user, TimeId now) {
return online;
}
TimeMs OnlineChangeTimeout(TimeId online, TimeId now) {
crl::time OnlineChangeTimeout(TimeId online, TimeId now) {
const auto result = OnlinePhraseChangeInSeconds(online, now);
Assert(result >= 0);
return snap(
result * TimeMs(1000),
result * crl::time(1000),
kMinOnlineChangeTimeout,
kMaxOnlineChangeTimeout);
}
TimeMs OnlineChangeTimeout(not_null<UserData*> user, TimeId now) {
crl::time OnlineChangeTimeout(not_null<UserData*> user, TimeId now) {
if (isServiceUser(user->id) || user->botInfo) {
return kMaxOnlineChangeTimeout;
}