From be11dcfef117374b4129ee8d73e1cab23b73269e Mon Sep 17 00:00:00 2001 From: Daniil Gentili Date: Thu, 30 May 2019 15:25:56 +0200 Subject: [PATCH] Check message IDs of messages received with getDiff --- src/danog/MadelineProto/Loop/Update/FeedLoop.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/danog/MadelineProto/Loop/Update/FeedLoop.php b/src/danog/MadelineProto/Loop/Update/FeedLoop.php index 6067dc9e..1dd72847 100644 --- a/src/danog/MadelineProto/Loop/Update/FeedLoop.php +++ b/src/danog/MadelineProto/Loop/Update/FeedLoop.php @@ -261,6 +261,12 @@ class FeedLoop extends ResumableSignalLoop public function saveMessages($messages) { foreach ($messages as $message) { + if (!$this->API->check_msg_id($message)) { + $this->API->logger->logger("MSGID duplicate ({$message['id']}) in $this"); + + continue; + } + $this->parsedUpdates[] = ['_' => $this->channelId === false ? 'updateNewMessage' : 'updateNewChannelMessage', 'message' => $message, 'pts' => -1, 'pts_count' => -1]; } }