Do not send layer notification every time

This commit is contained in:
Daniil Gentili 2020-10-19 19:08:32 +02:00
parent 34d46ea717
commit dc165eb30a
Signed by: danog
GPG Key ID: 8C1BE3B34B230CA7

View File

@ -80,7 +80,7 @@ trait ResponseHandler
if ((yield from $this->checkSecretOutSeqNo($chatId, $decryptedMessage['out_seq_no']))
&& (yield from $this->checkSecretInSeqNo($chatId, $decryptedMessage['in_seq_no']))) {
$this->secret_chats[$chatId]['in_seq_no']++;
if ($decryptedMessage['layer'] >= 17) {
if ($decryptedMessage['layer'] >= 17 && $decryptedMessage['layer'] !== $this->secret_chats[$chatId]['layer']) {
$this->secret_chats[$chatId]['layer'] = $decryptedMessage['layer'];
if ($decryptedMessage['layer'] >= 17 && \time() - $this->secret_chats[$chatId]['created'] > 15) {
yield from $this->notifyLayer($chatId);