2
0
mirror of https://github.com/kotatogram/kotatogram-desktop synced 2025-08-30 22:25:12 +00:00

Fix localtime-related slowmode errors.

This commit is contained in:
John Preston
2019-08-20 12:42:13 +03:00
parent 1a06714f3a
commit e1fe373504
9 changed files with 35 additions and 25 deletions

View File

@@ -561,8 +561,12 @@ void ApiWrap::sendMessageFail(
const auto left = error.type().mid(chop).toInt();
if (const auto channel = peer->asChannel()) {
const auto seconds = channel->slowmodeSeconds();
channel->growSlowmodeLastMessage(
base::unixtime::now() - (left - seconds));
if (seconds >= left) {
channel->growSlowmodeLastMessage(
base::unixtime::now() - (left - seconds));
} else {
requestFullPeer(peer);
}
}
}
if (const auto item = _session->data().message(itemId)) {