Made small fixes to TL

This commit is contained in:
danogentili 2016-11-26 16:12:36 +03:00
parent 546d7cc46e
commit 1d9ea6ad0c
2 changed files with 4 additions and 2 deletions

View File

@ -233,6 +233,7 @@ src/danog/MadelineProto/
TL - Handles TL serialization and deserialization
TLConstructor - Stores TL constructors
TLMethod - Stores TL methods
TLParams - Parses params
API - Wrapper class that instantiates the MTProto class, sets the error handler, provides a wrapper for calling mtproto methods directly as class submethods, and provides some simplified wrappers for logging in to telegram
APIFactory - Provides a wrapper for calling namespaced mtproto methods directly as class submethods
Connection - Handles tcp/udp/http connections and wrapping payloads generated by MTProtoTools/MessageHandler into the right message according to the protocol, stores authorization keys, session id and sequence number

View File

@ -21,8 +21,9 @@ class TLParams
$param['subtype'] = null;
if (preg_match('/^flags\.\d*\?/', $param['type'])) {
$param['flag'] = true;
$param['pow'] = pow(2, preg_replace(['/^flags\./', '/\?.*/'], '', $param['type']));
$param['type'] = preg_replace('/^flags\.\d*\?/', '', $param['type']);
$flag = explode('?', explode('.', $param['type'])[1]);
$param['pow'] = pow(2, $flag[0]);
$param['type'] = $flag[1];
}
if (preg_match('/vector<.*>/i', $param['type'])) {
if (preg_match('/vector/', $param['type'])) {