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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user