mirror of
https://github.com/kotatogram/kotatogram-desktop
synced 2025-08-31 06:35:14 +00:00
Fix possible crash in timer timeout values.
This commit is contained in:
@@ -257,11 +257,11 @@ namespace {
|
||||
|
||||
int32 onlineWillChangeIn(TimeId online, TimeId now) {
|
||||
if (online <= 0) {
|
||||
if (-online > now) return -online - now;
|
||||
if (-online > now) return std::max(-online - now, 86400);
|
||||
return 86400;
|
||||
}
|
||||
if (online > now) {
|
||||
return online - now;
|
||||
return std::max(online - now, 86400);
|
||||
}
|
||||
int32 minutes = (now - online) / 60;
|
||||
if (minutes < 60) {
|
||||
@@ -272,7 +272,7 @@ namespace {
|
||||
return (hours + 1) * 3600 - (now - online);
|
||||
}
|
||||
QDateTime dNow(date(now)), dTomorrow(dNow.date().addDays(1));
|
||||
return dNow.secsTo(dTomorrow);
|
||||
return std::max(dNow.secsTo(dTomorrow), 86400LL);
|
||||
}
|
||||
|
||||
QString onlineText(UserData *user, TimeId now, bool precise) {
|
||||
|
Reference in New Issue
Block a user