Strict validity check for local lastseen.

This commit is contained in:
John Preston 2024-11-01 18:22:57 +04:00
parent f091f2b344
commit ead5dbe368

View file

@ -112,7 +112,9 @@ private:
static constexpr auto kValidAfter = kLifeStartDate + kSpecialValueSkip;
[[nodiscard]] bool valid() const {
return !_available || (_value >= kSpecialValueSkip);
constexpr auto kMaxSum = uint32(std::numeric_limits<TimeId>::max());
return (kMaxSum - _value > uint32(kLifeStartDate))
&& (!_available || (_value >= kSpecialValueSkip));
}
LastseenStatus(uint32 value, bool available, bool hiddenByMe)