1
0
mirror of https://github.com/danog/MadelineProto.git synced 2025-01-10 20:48:20 +01:00
This commit is contained in:
Daniil Gentili 2024-12-10 17:58:03 +00:00
parent cfa546d7f7
commit d79fca4bed
2 changed files with 3 additions and 2 deletions

View File

@ -136,6 +136,7 @@ final class MTProtoIncomingMessage extends MTProtoMessage
*/ */
public function ack(): void public function ack(): void
{ {
unset($this->connection->incoming_messages[$this->msgId]);
$this->state |= self::STATE_ACKED; $this->state |= self::STATE_ACKED;
if ($this->contentRelated) { if ($this->contentRelated) {
// I let the server know that I received its message // I let the server know that I received its message

View File

@ -148,7 +148,7 @@ trait ResponseHandler
$tmp->setIteratorMode(SplQueue::IT_MODE_DELETE); $tmp->setIteratorMode(SplQueue::IT_MODE_DELETE);
foreach ($message->read()['messages'] as $msg) { foreach ($message->read()['messages'] as $msg) {
$this->msgIdHandler->checkIncomingMessageId($msg['msg_id'], true); $this->msgIdHandler->checkIncomingMessageId($msg['msg_id'], true);
$newMessage = new MTProtoIncomingMessage($this->connection, $msg['body'], $msg['msg_id'], $message->unencrypted, true); $newMessage = new MTProtoIncomingMessage($this, $msg['body'], $msg['msg_id'], $message->unencrypted, true);
$newMessage->setSeqNo($msg['seqno']); $newMessage->setSeqNo($msg['seqno']);
$this->checkInSeqNo($newMessage); $this->checkInSeqNo($newMessage);
$newMessage->setSeqNo(null); $newMessage->setSeqNo(null);
@ -167,7 +167,7 @@ trait ResponseHandler
$this->incoming_messages[$referencedMsgId]->ack(); $this->incoming_messages[$referencedMsgId]->ack();
} else { } else {
$this->msgIdHandler->checkIncomingMessageId($referencedMsgId, true); $this->msgIdHandler->checkIncomingMessageId($referencedMsgId, true);
$message = new MTProtoIncomingMessage($this->connection, $content['orig_message'], $referencedMsgId, $message->unencrypted); $message = new MTProtoIncomingMessage($this, $content['orig_message'], $referencedMsgId, $message->unencrypted);
$this->incomingCtr?->inc(); $this->incomingCtr?->inc();
$this->incoming_messages[$referencedMsgId] = $message; $this->incoming_messages[$referencedMsgId] = $message;
$this->handleMessages([$message]); $this->handleMessages([$message]);