mirror of
https://github.com/Qz3rK/tdesktop.git
synced 2026-07-03 14:15:08 +02:00
Add support for 1 month self-destruct messages.
This commit is contained in:
@@ -2020,8 +2020,11 @@ void Session::scheduleNextTTLs() {
|
||||
}
|
||||
const auto nearest = _ttlMessages.begin()->first;
|
||||
const auto now = base::unixtime::now();
|
||||
const auto timeout = (std::max(now, nearest) - now) * crl::time(1000);
|
||||
_ttlCheckTimer.callOnce(timeout);
|
||||
|
||||
// Set timer not more than for 24 hours.
|
||||
const auto maxTimeout = TimeId(86400);
|
||||
const auto timeout = std::min(std::max(now, nearest) - now, maxTimeout);
|
||||
_ttlCheckTimer.callOnce(timeout * crl::time(1000));
|
||||
}
|
||||
|
||||
void Session::unregisterMessageTTL(
|
||||
|
||||
Reference in New Issue
Block a user