diff --git a/src/danog/MadelineProto/MTProto.php b/src/danog/MadelineProto/MTProto.php index 9faf34c1..7b730b31 100644 --- a/src/danog/MadelineProto/MTProto.php +++ b/src/danog/MadelineProto/MTProto.php @@ -483,7 +483,7 @@ Slv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB public function getV() { - return 5; + return 6; } public function get_self() diff --git a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php index 129985a2..41bbe208 100644 --- a/src/danog/MadelineProto/MTProtoTools/PeerHandler.php +++ b/src/danog/MadelineProto/MTProtoTools/PeerHandler.php @@ -404,9 +404,9 @@ trait PeerHandler } if (!isset($res['participants']) && isset($res['can_view_participants']) && $res['can_view_participants']) { $res['participants'] = []; - $limit = 400; + $limit = 200; $offset = -$limit; - $gres = $this->method_call('channels.getParticipants', ['channel' => $full['InputChannel'], 'filter' => ['_' => 'channelParticipantsRecent'], 'offset' => $offset += $limit, 'limit' => 200], ['datacenter' => $this->datacenter->curdc]); + $gres = $this->method_call('channels.getParticipants', ['channel' => $full['InputChannel'], 'filter' => ['_' => 'channelParticipantsRecent'], 'offset' => $offset += $limit, 'limit' => $limit], ['datacenter' => $this->datacenter->curdc]); $count = $gres['count']; $key = -1; while ($offset <= $count) { diff --git a/src/danog/MadelineProto/TL/Conversion/BotAPI.php b/src/danog/MadelineProto/TL/Conversion/BotAPI.php index c466b32a..eaf97b6c 100644 --- a/src/danog/MadelineProto/TL/Conversion/BotAPI.php +++ b/src/danog/MadelineProto/TL/Conversion/BotAPI.php @@ -322,9 +322,10 @@ trait BotAPI } else { $res['file_name'] .= $this->get_extension_from_mime($data['document']['mime_type']); } + $data['document']['_'] = 'bot_'.$type_name; $res['file_size'] = $data['document']['size']; $res['mime_type'] = $data['document']['mime_type']; - $res['file_id'] = $this->base64url_encode($this->rle_encode($this->serialize_object(['type' => 'bot_'.$type_name], $data['document']).chr(2))); + $res['file_id'] = $this->base64url_encode($this->rle_encode($this->serialize_object(['type' => 'File'], $data['document']).chr(2))); return [$type_name => $res, 'caption' => $data['caption']]; default: diff --git a/src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php b/src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php index 66d9ad70..be8f61f1 100644 --- a/src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php +++ b/src/danog/MadelineProto/TL/Conversion/BotAPIFiles.php @@ -68,9 +68,8 @@ trait BotAPIFiles $ext = $this->get_extension_from_location(['_' => 'inputFileLocation', 'volume_id' => $photo['location']['volume_id'], 'local_id' => $photo['location']['local_id'], 'secret' => $photo['location']['secret'], 'dc_id' => $photo['location']['dc_id']], '.jpg'); $photo['location']['access_hash'] = isset($message_media['access_hash']) ? $message_media['access_hash'] : 0; $photo['location']['id'] = isset($message_media['id']) ? $message_media['id'] : 0; - - $data = $this->serialize_object(['type' => $thumbnail ? 'bot_thumbnail' : 'bot_photo'], $photo['location']).chr(2); - + $photo['location']['_'] = $thumbnail ? 'bot_thumbnail' : 'bot_photo'; + $data = $this->serialize_object(['type' => 'File'], $photo['location']).chr(2); return [ 'file_id' => $this->base64url_encode($this->rle_encode($data)), 'width' => $photo['w'], diff --git a/src/danog/MadelineProto/TL/TL.php b/src/danog/MadelineProto/TL/TL.php index 45ccb1a9..115fdef9 100644 --- a/src/danog/MadelineProto/TL/TL.php +++ b/src/danog/MadelineProto/TL/TL.php @@ -119,11 +119,12 @@ trait TL '', '', ], $line); $id = hash('crc32b', $clean); - if (preg_match('/^[^\s]+#/', $line) && $scheme_type !== 'botAPI') { + if (preg_match('/^[^\s]+#/', $line)) { $nid = str_pad(preg_replace(['/^[^#]+#/', '/\s.+/'], '', $line), 8, '0', \STR_PAD_LEFT); - if ($id !== $nid) { + if ($id !== $nid && $scheme_type !== 'botAPI') { \danog\MadelineProto\Logger::log(['CRC32 mismatch ('.$id.', '.$nid.') for '.$line], \danog\MadelineProto\Logger::ERROR); } + $id = $nid; } if (!is_null($e)) { $this->td_descriptions[$type][$name] = ['description' => $e, 'params' => $dparams];