Layer 104

This commit is contained in:
Daniil Gentili 2019-08-15 20:33:07 +02:00
parent e1100b3fc6
commit 2c2e33636f
8 changed files with 1437 additions and 10 deletions

View File

@ -432,6 +432,7 @@ Tip: if you receive an error (or nothing), [send us](https://t.me/pwrtelegramgro
* <a href="https://docs.madelineproto.xyz/API_docs/methods/account_initTakeoutSession.html" name="account_initTakeoutSession">Start account exporting session: account.initTakeoutSession</a>
* <a href="https://docs.madelineproto.xyz/API_docs/methods/account_unregisterDevice.html" name="account_unregisterDevice">Stop sending PUSH notifications to app: account.unregisterDevice</a>
* <a href="https://docs.madelineproto.xyz/API_docs/methods/channels_toggleSignatures.html" name="channels_toggleSignatures">Toggle channel signatures: channels.toggleSignatures</a>
* <a href="https://docs.madelineproto.xyz/API_docs/methods/channels_toggleSlowMode.html" name="channels_toggleSlowMode">Toggle slow mode: channels.toggleSlowMode</a>
* <a href="https://docs.madelineproto.xyz/API_docs/methods/contacts_toggleTopPeers.html" name="contacts_toggleTopPeers">Toggle top peers: contacts.toggleTopPeers</a>
* <a href="https://docs.madelineproto.xyz/API_docs/methods/contacts_unblock.html" name="contacts_unblock">Unblock a user: contacts.unblock</a>
* <a href="https://docs.madelineproto.xyz/API_docs/methods/account_updateStatus.html" name="account_updateStatus">Update online status: account.updateStatus</a>

View File

@ -43,9 +43,9 @@ $docs = [
'readme' => false,
],
[
'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v103.tl', 'calls' => __DIR__.'/src/danog/MadelineProto/TL_calls.tl', 'secret' => __DIR__.'/src/danog/MadelineProto/TL_secret.tl', 'td' => __DIR__.'/src/danog/MadelineProto/TL_td.tl'],
'title' => 'MadelineProto API documentation (layer 103)',
'description' => 'MadelineProto API documentation (layer 103)',
'tl_schema' => ['telegram' => __DIR__.'/src/danog/MadelineProto/TL_telegram_v104.tl', 'calls' => __DIR__.'/src/danog/MadelineProto/TL_calls.tl', 'secret' => __DIR__.'/src/danog/MadelineProto/TL_secret.tl', 'td' => __DIR__.'/src/danog/MadelineProto/TL_td.tl'],
'title' => 'MadelineProto API documentation (layer 104)',
'description' => 'MadelineProto API documentation (layer 104)',
'output_dir' => __DIR__.'/docs/docs/API_docs',
'readme' => false,
],

2
docs

@ -1 +1 @@
Subproject commit ddb2e4f76938b69ceac6e4615901c642accae1ef
Subproject commit 4adfd68d173052290751a7a603234c38fdc71ece

View File

@ -25,7 +25,6 @@ interface auth
* @param array params [
* string phone_number,
* string phone_code_hash,
* string phone_code,
* string first_name,
* string last_name,
* ]
@ -2139,6 +2138,7 @@ interface upload
/**
* @param array params [
* boolean precise,
* InputFileLocation location,
* int offset,
* int limit,
@ -2467,6 +2467,7 @@ interface channels
* InputChannel channel,
* InputUser user_id,
* ChatAdminRights admin_rights,
* string rank,
* ]
*
* @return Updates
@ -2692,6 +2693,16 @@ interface channels
* @return bool
*/
public function editLocation(array $params);
/**
* @param array params [
* InputChannel channel,
* int seconds,
* ]
*
* @return Updates
*/
public function toggleSlowMode(array $params);
}
interface bots

View File

@ -5136,6 +5136,27 @@ class Lang
'object_peerLocated_param_expires_type_int' => 'Expiry date',
'object_peerLocated_param_distance_type_int' => 'Distance',
'method_account.registerDevice_param_no_muted_type_true' => 'Idk yet',
'method_upload.getFile_param_precise_type_true' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info',
'method_channels.editAdmin_param_rank_type_string' => 'Admin rank, an arbitrary string',
'method_channels.toggleSlowMode' => 'Toggle slow mode',
'method_channels.toggleSlowMode_param_channel_type_InputChannel' => 'Supergroup',
'method_channels.toggleSlowMode_param_seconds_type_int' => 'Users will only be able to send one message every `seconds` seconds, `0` to disable the limitation ',
'object_channel_param_has_geo_type_true' => 'Whether this is a geogroup',
'object_channel_param_slowmode_enabled_type_true' => 'Whether slowmode is enabled',
'object_channelFull_param_slowmode_seconds_type_int' => 'If specified, users in supergroups will only be able to send one message every `slowmode_seconds` seconds',
'object_auth.authorizationSignUpRequired' => 'Signup is required',
'object_auth.authorizationSignUpRequired_param_terms_of_service_type_help.TermsOfService' => 'Telegram\'s Terms of Service',
'object_help.appUpdate_param_can_not_skip_type_true' => 'Whether the update is skippable',
'object_inputStickerSetAnimatedEmoji' => 'Animated emojis stickerset',
'object_channelParticipantCreator_param_rank_type_string' => 'Creator rank, an arbitrary string',
'object_channelParticipantAdmin_param_rank_type_string' => 'Admin\'s rank, an arbitrary string',
'object_payments.paymentVerificationNeeded' => 'Payment verification needed',
'object_payments.paymentVerificationNeeded_param_url_type_string' => '3dsecure URL',
'object_channelAdminLogEventActionToggleSlowMode' => 'Channel admin log event action toggle slow mode',
'object_channelAdminLogEventActionToggleSlowMode_param_prev_value_type_int' => 'Prev value',
'object_channelAdminLogEventActionToggleSlowMode_param_new_value_type_int' => 'New value',
'object_codeSettings_param_allow_app_hash_type_true' => 'Whether to allow a persistent app hash',
'object_channelFull_param_slowmode_next_send_date_type_int' => ' Indicates when the user will be allowed to send another message in the supergroup (unixdate)',
),
);
@ -5185,7 +5206,7 @@ class Lang
'loading_key' => 'Loading key...',
'computing_fingerprint' => 'Computing fingerprint...',
'rsa_encrypting' => 'Encrypting with rsa key...',
'rpc_tg_error' => 'Telegram ha ritornato un errore RPC: %s (%s), causato da %s:%s%sTL trace:',
'rpc_tg_error' => 'Telegram returned an RPC error: %s (%s), caused by %s:%s%sTL trace:',
'v_error' => '506c656173652075706461746520746f20746865206c61746573742076657273696f6e206f66204d6164656c696e6550726f746f2e',
'v_tgerror' => '506c6561736520757064617465207068702d6c69627467766f6970',
'no_mode_specified' => 'No mode was specified!',
@ -10113,5 +10134,26 @@ class Lang
'object_peerLocated_param_expires_type_int' => 'Expiry date',
'object_peerLocated_param_distance_type_int' => 'Distance',
'method_account.registerDevice_param_no_muted_type_true' => 'Idk yet',
'method_upload.getFile_param_precise_type_true' => 'You cannot use this method directly, use the upload, download_to_stream, download_to_file, download_to_dir methods instead; see https://docs.madelineproto.xyz for more info',
'method_channels.editAdmin_param_rank_type_string' => 'Admin rank, an arbitrary string',
'method_channels.toggleSlowMode' => 'Toggle slow mode',
'method_channels.toggleSlowMode_param_channel_type_InputChannel' => 'Supergroup',
'method_channels.toggleSlowMode_param_seconds_type_int' => 'Users will only be able to send one message every `seconds` seconds, `0` to disable the limitation ',
'object_channel_param_has_geo_type_true' => 'Whether this is a geogroup',
'object_channel_param_slowmode_enabled_type_true' => 'Whether slowmode is enabled',
'object_channelFull_param_slowmode_seconds_type_int' => 'If specified, users in supergroups will only be able to send one message every `slowmode_seconds` seconds',
'object_auth.authorizationSignUpRequired' => 'Signup is required',
'object_auth.authorizationSignUpRequired_param_terms_of_service_type_help.TermsOfService' => 'Telegram\'s Terms of Service',
'object_help.appUpdate_param_can_not_skip_type_true' => 'Whether the update is skippable',
'object_inputStickerSetAnimatedEmoji' => 'Animated emojis stickerset',
'object_channelParticipantCreator_param_rank_type_string' => 'Creator rank, an arbitrary string',
'object_channelParticipantAdmin_param_rank_type_string' => 'Admin\'s rank, an arbitrary string',
'object_payments.paymentVerificationNeeded' => 'Payment verification needed',
'object_payments.paymentVerificationNeeded_param_url_type_string' => '3dsecure URL',
'object_channelAdminLogEventActionToggleSlowMode' => 'Channel admin log event action toggle slow mode',
'object_channelAdminLogEventActionToggleSlowMode_param_prev_value_type_int' => 'Prev value',
'object_channelAdminLogEventActionToggleSlowMode_param_new_value_type_int' => 'New value',
'object_codeSettings_param_allow_app_hash_type_true' => 'Whether to allow a persistent app hash',
'object_channelFull_param_slowmode_next_send_date_type_int' => ' Indicates when the user will be allowed to send another message in the supergroup (unixdate)',
);
}
}

View File

@ -74,7 +74,7 @@ class MTProto extends AsyncConstruct implements TLCallback
/*
const V = 71;
*/
const V = 127;
const V = 128;
const RELEASE = '4.0';
const NOT_LOGGED_IN = 0;
const WAITING_CODE = 1;
@ -749,12 +749,12 @@ class MTProto extends AsyncConstruct implements TLCallback
'lang_pack' => $lang_pack,
], 'tl_schema' => [
// TL scheme files
'layer' => 103,
'layer' => 104,
// layer version
'src' => [
'mtproto' => __DIR__.'/TL_mtproto_v1.tl',
// mtproto TL scheme
'telegram' => __DIR__.'/TL_telegram_v103.tl',
'telegram' => __DIR__.'/TL_telegram_v104.tl',
// telegram TL scheme
'secret' => __DIR__.'/TL_secret.tl',
// secret chats TL scheme

File diff suppressed because it is too large Load Diff

View File

@ -107,6 +107,14 @@ trait Login
throw $e;
}
if ($authorization['_'] === 'auth.authorizationSignUpRequired') {
$this->logger->logger(\danog\MadelineProto\Lang::$current_lang['login_need_signup'], \danog\MadelineProto\Logger::NOTICE);
$this->authorized = self::WAITING_SIGNUP;
$this->authorization['phone_code'] = $code;
$authorization['_'] = 'account.needSignup';
return $authorization;
}
$this->authorized = self::LOGGED_IN;
$this->authorization = $authorization;
$this->datacenter->sockets[$this->datacenter->curdc]->authorized = true;