1
0
mirror of https://github.com/danog/MadelineProto.git synced 2024-11-27 03:14:39 +01:00

Polyfill BC-breaking changes

This commit is contained in:
Daniil Gentili 2023-07-20 22:09:26 +02:00
parent 923afaf651
commit 1b76f591b1
2 changed files with 14 additions and 0 deletions

View File

@ -397,6 +397,16 @@ final class Connection
$arguments['queuePromise'] = new DeferredFuture;
return $arguments['queuePromise'];
}
if (isset($arguments['reply_to_msg_id'])) {
if (isset($arguments['reply_to'])) {
throw new Exception("You can't provide a reply_to together with reply_to_msg_id and top_msg_id!");
}
$arguments['reply_to'] = [
'_' => 'inputReplyToMessage',
'reply_to_msg_id' => $arguments['reply_to_msg_id'],
'top_msg_id' => $arguments['top_msg_id'] ?? null
];
}
return null;
}
/**

View File

@ -761,6 +761,10 @@ final class TL implements TLInterface
$serialized .= "\0\0\0\0\0\0\0\0";
continue;
}
if ($current_argument['type'] === 'double') {
$serialized .= "\0\0\0\0\0\0\0\0";
continue;
}
if ($tl['type'] === 'InputMedia' && $current_argument['name'] === 'mime_type') {
$serialized .= ($this->serializeObject($current_argument, $arguments['file']['mime_type'], $current_argument['name'], $layer));
continue;