Update content of files

This commit is contained in:
GitHub Action 2023-07-23 11:53:26 +00:00
parent 99275dbbe9
commit 0df4774c0c
9 changed files with 40 additions and 38 deletions

View file

@ -522,7 +522,7 @@ Pass <a href="/constructor/inputPeerEmpty">inputPeerEmpty</a> to <code>peer</cod
<a href='/method/account.deleteAccount'>account.deleteAccount</a>#a2c0cf74 flags:<a href='/type/%23'>#</a> reason:<a href='/type/string'>string</a> password:flags.0?<a href='/type/InputCheckPasswordSRP'>InputCheckPasswordSRP</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>These methods can be used for managing consent to Telegram's <a href="https://telegram.org/tos">Terms Of Service</a>. </p>
<p>Typically, before a user <a href="/api/auth#sign-insign-up">signs up</a> by invoking <a href="/method/auth.signUp">auth.signUp</a>, apps should show a pop-up (if the <code>popup</code> flag of the <a href="/constructor/help.termsOfService">help.termsOfService</a> method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow. </p>
<p>Typically, before a user <a href="/api/auth#sign-in-sign-up">signs up</a> by invoking <a href="/method/auth.signUp">auth.signUp</a>, apps should show a pop-up (if the <code>popup</code> flag of the <a href="/constructor/help.termsOfService">help.termsOfService</a> method is set), asking the user to accept Telegram's terms of service; in case of denial, the user is to be returned to the initial page of the login flow. </p>
<p>When signing up for the first time, the <a href="/constructor/help.termsOfService">help.termsOfService</a> is to be obtained from the <a href="/constructor/auth.authorizationSignUpRequired">auth.authorizationSignUpRequired</a> constructor returned by the <a href="/method/auth.signIn">auth.signIn</a>. </p>
<p>After signing up, or when logging in as an existing user, apps are supposed to call <a href="/method/help.getTermsOfServiceUpdate">help.getTermsOfServiceUpdate</a> to check for any updates to the Terms of Service; this call should be repeated after <code>expires</code> seconds have elapsed.<br>
If an update to the Terms Of Service is available, clients are supposed to show a consent popup; if accepted, clients should call <a href="/method/help.acceptTermsOfService">help.acceptTermsOfService</a>, providing the <a href="/constructor/help.termsOfService">termsOfService <code>id</code> JSON object</a>; in case of denial, clients are to delete the account using <a href="/method/account.deleteAccount">account.deleteAccount</a>, providing <code>Decline ToS update</code> as deletion <code>reason</code>. </p>

View file

@ -523,7 +523,7 @@ Third-party apps may log in using any of the other code delivery methods (Telegr
<a href="/method/channels.reorderPinnedForumTopics">channels.reorderPinnedForumTopics</a>#2950a18f flags:<a href="/type/%23">#</a> force:flags.0?<a href="/constructor/true">true</a> channel:<a href="/type/InputChannel">InputChannel</a> order:<a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/int">int</a>&gt; = <a href="/type/Updates">Updates</a>;<br></code></pre></div>
<h3><a class="anchor" href="#layer-148" id="layer-148" name="layer-148"><i class="anchor-icon"></i></a><a href="/schema?layer=148">Layer 148</a></h3>
<p><a href="/api/fragment">Collectible usernames »</a>, groups with topics (aka <a href="/api/forum">forums »</a>), sponsored message improvements.<br>
Added support for thread IDs in <a href="/api/links#message-links">message deep links »</a>, which now double as <a href="/api/links#forum-topic-links">forum topic deep links »</a>, and added a new <code>manage_topics</code> parameter to <a href="/api/links#groupchannel-bot-links">group/channel bot deep links</a>.</p>
Added support for thread IDs in <a href="/api/links#message-links">message deep links »</a>, which now double as <a href="/api/links#forum-topic-links">forum topic deep links »</a>, and added a new <code>manage_topics</code> parameter to <a href="/api/links#group-channel-bot-links">group/channel bot deep links</a>.</p>
<h4><a class="anchor" href="#schema-changes" id="schema-changes" name="schema-changes"><i class="anchor-icon"></i></a>Schema changes</h4>
<h5><a class="anchor" href="#new-methods" id="new-methods" name="new-methods"><i class="anchor-icon"></i></a>New Methods</h5>
<ul>

View file

@ -281,7 +281,7 @@ t.me/share?url=&lt;url&gt;&amp;text=&lt;text&gt;</code></pre>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#video-chatlivestream-links" id="video-chatlivestream-links" name="video-chatlivestream-links"><i class="anchor-icon"></i></a>Video chat/Livestream links</h3>
<h3><a class="anchor" href="#video-chat-livestream-links" id="video-chat-livestream-links" name="video-chat-livestream-links"><i class="anchor-icon"></i></a>Video chat/Livestream links</h3>
<p>Used to join video/voice chats in groups, and livestreams in channels.<br>
Such links are generated using <a href="/method/phone.exportGroupCallInvite">phone.exportGroupCallInvite</a>.<br>
Note that <code>voicechat</code> links are deprecated, the API will always export <code>videochat</code> links for video and voice chats in groups, clients should support parsing the old link format only for backwards compatibility. </p>
@ -755,7 +755,7 @@ tg://bg?slug=&lt;slug&gt;&amp;intensity=&lt;intensity&gt;&amp;bg_color=&lt;hex_c
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#groupchannel-bot-links" id="groupchannel-bot-links" name="groupchannel-bot-links"><i class="anchor-icon"></i></a>Group/channel bot links</h3>
<h3><a class="anchor" href="#group-channel-bot-links" id="group-channel-bot-links" name="group-channel-bot-links"><i class="anchor-icon"></i></a>Group/channel bot links</h3>
<p>Used to add bots to groups or channels.<br>
First of all, check that the <code>&lt;bot_username&gt;</code> indeed links to a bot.<br>
Then, for group links:</p>

View file

@ -63,7 +63,7 @@
<p>Bots can use <a href="/method/bots.setBotBroadcastDefaultAdminRights">bots.setBotBroadcastDefaultAdminRights</a> to indicate a suggested set of <a href="/api/rights">admin rights »</a> to use when adding the bot to a <a href="/api/channel">channel</a>, and <a href="/method/bots.setBotGroupDefaultAdminRights">bots.setBotGroupDefaultAdminRights</a> when adding the bot to a <a href="/api/channel">group</a>. </p>
<p>These suggested admin rights are contained in the <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code> paremeters of <a href="/constructor/userFull">userFull</a>, obtainable using <a href="/method/users.getFullUser">users.getFullUser</a>. </p>
<p>A client application trying to add a bot as admin should fetch the default rights and present them as editable defaults to the user: the rights can then be modified before <a href="#admin-rights">setting the bot as admin</a>.</p>
<p>Note that admin rights suggested by a <a href="/api/links#groupchannel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin. </p></div>
<p>Note that admin rights suggested by a <a href="/api/links#group-channel-bot-links">bot deep link</a> take priority over the suggested rights specified by <code>bot_broadcast_admin_rights</code> and <code>bot_group_admin_rights</code>: they can still be modified by the user before setting the bot as admin.</p></div>
</div>

View file

@ -42,7 +42,7 @@
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/methods" >All Methods</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/method/phone.exportGroupCallInvite" >phone.exportGroupCallInvite</a></li></ul></div>
<h1 id="dev_page_title">phone.exportGroupCallInvite</h1>
<div id="dev_page_content"><p>Get an <a href="/api/links#video-chatlivestream-links">invite link</a> for a group call or livestream</p>
<div id="dev_page_content"><p>Get an <a href="/api/links#video-chat-livestream-links">invite link</a> for a group call or livestream</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">

View file

@ -102,7 +102,7 @@
<tr>
<td><strong>invite_hash</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/string">string</a></td>
<td>The invitation hash from the <a href="/api/links#video-chatlivestream-links">invite link »</a>, if provided allows speaking in a livestream or muted group chat.</td>
<td>The invitation hash from the <a href="/api/links#video-chat-livestream-links">invite link »</a>, if provided allows speaking in a livestream or muted group chat.</td>
</tr>
<tr>
<td><strong>params</strong></td>

View file

@ -205,7 +205,7 @@
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#registrationauthorization" id="registrationauthorization" name="registrationauthorization"><i class="anchor-icon"></i></a>Registration/Authorization</h3>
<h3><a class="anchor" href="#registration-authorization" id="registration-authorization" name="registration-authorization"><i class="anchor-icon"></i></a>Registration/Authorization</h3>
<table class="table">
<thead>
<tr>
@ -556,7 +556,7 @@
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#working-with-channelssupergroupsgeogroups" id="working-with-channelssupergroupsgeogroups" name="working-with-channelssupergroupsgeogroups"><i class="anchor-icon"></i></a>Working with <a href="/api/channel">channels/supergroups/geogroups</a></h3>
<h3><a class="anchor" href="#working-with-channels-supergroups-geogroups" id="working-with-channels-supergroups-geogroups" name="working-with-channels-supergroups-geogroups"><i class="anchor-icon"></i></a>Working with <a href="/api/channel">channels/supergroups/geogroups</a></h3>
<table class="table">
<thead>
<tr>
@ -762,7 +762,7 @@
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#working-with-chatssupergroupschannels" id="working-with-chatssupergroupschannels" name="working-with-chatssupergroupschannels"><i class="anchor-icon"></i></a>Working with <a href="/api/channel">chats/supergroups/channels</a></h3>
<h3><a class="anchor" href="#working-with-chats-supergroups-channels" id="working-with-chats-supergroups-channels" name="working-with-chats-supergroups-channels"><i class="anchor-icon"></i></a>Working with <a href="/api/channel">chats/supergroups/channels</a></h3>
<table class="table">
<thead>
<tr>
@ -2039,7 +2039,7 @@
<tbody>
<tr>
<td><a href="/method/phone.exportGroupCallInvite">phone.exportGroupCallInvite</a></td>
<td>Get an <a href="/api/links#video-chatlivestream-links">invite link</a> for a group call or livestream</td>
<td>Get an <a href="/api/links#video-chat-livestream-links">invite link</a> for a group call or livestream</td>
</tr>
<tr>
<td><a href="/method/phone.getGroupCallJoinAs">phone.getGroupCallJoinAs</a></td>

View file

@ -46,72 +46,75 @@ rpc_result#f35c6d01 req_msg_id:long…">
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/mtproto" >Mobile Protocol</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/mtproto/service_messages" >Service Messages</a></li></ul></div>
<h1 id="dev_page_title">Service Messages</h1>
<div id="dev_page_content"><h4><a class="anchor" name="response-to-an-rpc-query" href="#response-to-an-rpc-query"><i class="anchor-icon"></i></a>Response to an RPC query</h4>
<div id="dev_page_content"><h4><a class="anchor" href="#response-to-an-rpc-query" id="response-to-an-rpc-query" name="response-to-an-rpc-query"><i class="anchor-icon"></i></a>Response to an RPC query</h4>
<p>A response to an RPC query is normally wrapped as follows:</p>
<pre><code>rpc_result#f35c6d01 req_msg_id:long result:Object = RpcResult;</code></pre>
<p>Here req_msg_id is the identifier of the message sent by the other party and containing an RPC query. This way, the recipient knows that the result is a response to the specific RPC query in question.<br>At the same time, this response serves as acknowledgment of the other party&#39;s receipt of the req_msg_id message.</p>
<p>Here req_msg_id is the identifier of the message sent by the other party and containing an RPC query. This way, the recipient knows that the result is a response to the specific RPC query in question.
At the same time, this response serves as acknowledgment of the other party's receipt of the req_msg_id message.</p>
<p>Note that the response to an RPC query must also be acknowledged. Most frequently, this coincides with the transmission of the next message (which may have a container attached to it carrying a service message with the acknowledgment).</p>
<h4><a class="anchor" name="rpc-error" href="#rpc-error"><i class="anchor-icon"></i></a>RPC Error</h4>
<h4><a class="anchor" href="#rpc-error" id="rpc-error" name="rpc-error"><i class="anchor-icon"></i></a>RPC Error</h4>
<p>The result field returned in response to any RPC query may also contain an error message in the following format:</p>
<pre><code>rpc_error#2144ca19 error_code:int error_message:string = RpcError;</code></pre>
<h4><a class="anchor" name="cancellation-of-an-rpc-query" href="#cancellation-of-an-rpc-query"><i class="anchor-icon"></i></a>Cancellation of an RPC Query</h4>
<p>In certain situations, the client does not want to receive a response to an already transmitted RPC query, for example because the response turns out to be long and the client has decided to do without it because of insufficient link capacity. Simply interrupting the TCP connection will not have any effect because the server would re-send the missing response at the first opportunity. Therefore, the client needs a way to cancel receipt of the RPC response message, actually acknowledging its receipt prior to it being in fact received, which will settle the server down and prevent it from re-sending the response. However, the client does not know the RPC response&#39;s msg_id prior to receiving the response; the only thing it knows is the req_msg_id. i. e. the msg_id of the relevant RPC query. Therefore, a special query is used:</p>
<h4><a class="anchor" href="#cancellation-of-an-rpc-query" id="cancellation-of-an-rpc-query" name="cancellation-of-an-rpc-query"><i class="anchor-icon"></i></a>Cancellation of an RPC Query</h4>
<p>In certain situations, the client does not want to receive a response to an already transmitted RPC query, for example because the response turns out to be long and the client has decided to do without it because of insufficient link capacity. Simply interrupting the TCP connection will not have any effect because the server would re-send the missing response at the first opportunity. Therefore, the client needs a way to cancel receipt of the RPC response message, actually acknowledging its receipt prior to it being in fact received, which will settle the server down and prevent it from re-sending the response. However, the client does not know the RPC response's msg_id prior to receiving the response; the only thing it knows is the req_msg_id. i. e. the msg_id of the relevant RPC query. Therefore, a special query is used:</p>
<pre><code>rpc_drop_answer#58e4a740 req_msg_id:long = RpcDropAnswer;</code></pre>
<p>The response to this query returns as one of the following messages wrapped in rpc_result and requiring an acknowledgment: </p>
<pre><code>rpc_answer_unknown#5e2ad36e = RpcDropAnswer;
rpc_answer_dropped_running#cd78e586 = RpcDropAnswer;
rpc_answer_dropped#a43ad8b7 msg_id:long seq_no:int bytes:int = RpcDropAnswer;</code></pre>
<p>The first version of the response is used if the server remembers nothing of the incoming req_msg_id (if it has already been responded to, for example). The second version is used if the response was canceled while the RPC query was being processed (where the RPC query itself was still fully processed); in this case, the same rpc_answer_dropped_running is also returned in response to the original query, and both of these responses require an acknowledgment from the client. The final version means that the RPC response was removed from the server&#39;s outgoing queue, and its msg_id, seq_no, and length in bytes are transmitted to the client.</p>
<p>Note that rpc_answer_dropped_running and rpc_answer_dropped serve as acknowledgments of the server&#39;s receipt of the original query (the same one, the response to which we wish to forget). In addition, same as for any RPC queries, any response to rpc_drop_answer is an acknowledgment for rpc_drop_answer itself.</p>
<p>The first version of the response is used if the server remembers nothing of the incoming req_msg_id (if it has already been responded to, for example). The second version is used if the response was canceled while the RPC query was being processed (where the RPC query itself was still fully processed); in this case, the same rpc_answer_dropped_running is also returned in response to the original query, and both of these responses require an acknowledgment from the client. The final version means that the RPC response was removed from the server's outgoing queue, and its msg_id, seq_no, and length in bytes are transmitted to the client.</p>
<p>Note that rpc_answer_dropped_running and rpc_answer_dropped serve as acknowledgments of the server's receipt of the original query (the same one, the response to which we wish to forget). In addition, same as for any RPC queries, any response to rpc_drop_answer is an acknowledgment for rpc_drop_answer itself.</p>
<p>As an alternative to using rpc_drop_answer, a new session may be created after the connection is reset and the old session is removed through destroy_session.</p>
<h4><a class="anchor" name="messages-associated-with-querying-changing-and-receiving-the-sta" href="#messages-associated-with-querying-changing-and-receiving-the-sta"><i class="anchor-icon"></i></a>Messages associated with querying, changing, and receiving the status of other messages</h4>
<h4><a class="anchor" href="#messages-associated-with-querying-changing-and-receiving-the-status-of-other-messages" id="messages-associated-with-querying-changing-and-receiving-the-status-of-other-messages" name="messages-associated-with-querying-changing-and-receiving-the-status-of-other-messages"><i class="anchor-icon"></i></a>Messages associated with querying, changing, and receiving the status of other messages</h4>
<p>See <a href="/mtproto/service_messages_about_messages">Mobile Protocol: Service Messages about Messages</a></p>
<h4><a class="anchor" name="request-for-several-future-salts" href="#request-for-several-future-salts"><i class="anchor-icon"></i></a>Request for several future salts</h4>
<h4><a class="anchor" href="#request-for-several-future-salts" id="request-for-several-future-salts" name="request-for-several-future-salts"><i class="anchor-icon"></i></a>Request for several future salts</h4>
<p>The client may at any time request from the server several (between 1 and 64) future server salts together with their validity periods. Having stored them in persistent memory, the client may use them to send messages in the future even if it changes sessions (a server salt is attached to the authorization key rather than being session-specific).</p>
<pre><code>get_future_salts#b921bd04 num:int = FutureSalts;
future_salt#0949d9dc valid_since:int valid_until:int salt:long = FutureSalt;
future_salts#ae500895 req_msg_id:long now:int salts:vector&lt;future_salt&gt; = FutureSalts;</code></pre>
<p>The client must check to see that the response&#39;s req_msg_id in fact coincides with msg_id of the query for get_future_salts. The server returns a maximum of num future server salts (may return fewer). The response serves as the acknowledgment of the query and does not require an acknowledgment itself.</p>
<h4><a class="anchor" name="ping-messages-ping-pong" href="#ping-messages-ping-pong"><i class="anchor-icon"></i></a>Ping Messages (PING/PONG)</h4>
<p>The client must check to see that the response's req_msg_id in fact coincides with msg_id of the query for get_future_salts. The server returns a maximum of num future server salts (may return fewer). The response serves as the acknowledgment of the query and does not require an acknowledgment itself.</p>
<h4><a class="anchor" href="#ping-messages-ping-pong" id="ping-messages-ping-pong" name="ping-messages-ping-pong"><i class="anchor-icon"></i></a>Ping Messages (PING/PONG)</h4>
<pre><code>ping#7abe77ec ping_id:long = Pong;</code></pre>
<p>A response is usually returned to the same connection:</p>
<pre><code>pong#347773c5 msg_id:long ping_id:long = Pong;</code></pre>
<p>These messages do not require acknowledgments. A pong is transmitted only in response to a ping while a ping can be initiated by either side.</p>
<h4><a class="anchor" name="deferred-connection-closure-ping" href="#deferred-connection-closure-ping"><i class="anchor-icon"></i></a>Deferred Connection Closure + PING</h4>
<h4><a class="anchor" href="#deferred-connection-closure--ping" id="deferred-connection-closure--ping" name="deferred-connection-closure--ping"><i class="anchor-icon"></i></a>Deferred Connection Closure + PING</h4>
<pre><code>ping_delay_disconnect#f3427b8c ping_id:long disconnect_delay:int = Pong;</code></pre>
<p>Works like ping. In addition, after this is received, the server starts a timer which will close the current connection disconnect_delay seconds later unless it receives a new message of the same type which automatically resets all previous timers. If the client sends these pings once every 60 seconds, for example, it may set disconnect_delay equal to 75 seconds. </p>
<h4><a class="anchor" name="request-to-destroy-session" href="#request-to-destroy-session"><i class="anchor-icon"></i></a>Request to Destroy Session</h4>
<h4><a class="anchor" href="#request-to-destroy-session" id="request-to-destroy-session" name="request-to-destroy-session"><i class="anchor-icon"></i></a>Request to Destroy Session</h4>
<p>Used by the client to notify the server that it may forget the data from a different session belonging to the same user (i. e. with the same auth_key_id). The result of this being applied to the current session is undefined.</p>
<pre><code>destroy_session#e7512126 session_id:long = DestroySessionRes;
destroy_session_ok#e22045fc session_id:long = DestroySessionRes;
destroy_session_none#62d350c9 session_id:long = DestroySessionRes;</code></pre>
<h4><a class="anchor" name="new-session-creation-notification" href="#new-session-creation-notification"><i class="anchor-icon"></i></a>New Session Creation Notification</h4>
<p>The server notifies the client that a new session (from the server&#39;s standpoint) had to be created to handle a client message. If, after this, the server receives a message with an even smaller msg_id within the same session, a similar notification will be generated for this msg_id as well. No such notifications are generated for high msg_id values.</p>
<h4><a class="anchor" href="#new-session-creation-notification" id="new-session-creation-notification" name="new-session-creation-notification"><i class="anchor-icon"></i></a>New Session Creation Notification</h4>
<p>The server notifies the client that a new session (from the server's standpoint) had to be created to handle a client message. If, after this, the server receives a message with an even smaller msg_id within the same session, a similar notification will be generated for this msg_id as well. No such notifications are generated for high msg_id values.</p>
<pre><code>new_session_created#9ec20908 first_msg_id:long unique_id:long server_salt:long = NewSession</code></pre>
<p>The unique_id parameter is generated by the server every time a session is (re-)created.</p>
<p>This notification must be acknowledged by the client. It is necessary, for instance, for the client to understand that there is, in fact, a “gap” in the stream of long poll notifications received from the server (the user may have failed to receive notifications during some period of time).</p>
<p>Notice that the server may unilaterally destroy (close) any existing client sessions with all pending messages and notifications, without sending any notifications. This happens, for example, if the session is inactive for a long time, and the server runs out of memory. If the client at some point decides to send new messages to the server using the old session, already forgotten by the server, such a “new session created” notification will be generated. The client is expected to handle such situations gracefully.</p>
<h3><a class="anchor" name="containers" href="#containers"><i class="anchor-icon"></i></a>Containers</h3>
<p>Notice that the server may unilaterally destroy (close) any existing client sessions with all pending messages and notifications, without sending any notifications. This happens, for example, if the session is inactive for a long time, and the server runs out of memory. If the client at some point decides to send new messages to the server using the old session, already forgotten by the server, such a "new session created" notification will be generated. The client is expected to handle such situations gracefully.</p>
<h3><a class="anchor" href="#containers" id="containers" name="containers"><i class="anchor-icon"></i></a>Containers</h3>
<p><em>Containers</em> are messages containing several other messages. Used for the ability to transmit several RPC queries and/or service messages at the same time, using HTTP or even TCP or UDP protocol. A container may only be accepted or rejected by the other party as a whole.</p>
<h4><a class="anchor" name="simple-container" href="#simple-container"><i class="anchor-icon"></i></a>Simple Container</h4>
<h4><a class="anchor" href="#simple-container" id="simple-container" name="simple-container"><i class="anchor-icon"></i></a>Simple Container</h4>
<p>A simple container carries several messages as follows:</p>
<pre><code>msg_container#73f1f8dc messages:vector message = MessageContainer;</code></pre>
<p>Here message refers to any message together with its length and msg_id:</p>
<pre><code>message msg_id:long seqno:int bytes:int body:Object = Message;</code></pre>
<p><code>bytes</code> is the number of bytes in the body serialization.<br>All messages in a container must have msg_id lower than that of the container itself. A container does not require an acknowledgment and may not carry other simple containers. When messages are re-sent, they may be combined into a container in a different manner or sent individually.</p>
<p>MTProto container payloads have a limit of <code>2^15</code> bytes or <code>1020</code> messages, whichever limit is reached first.<br>Clients should group acknowledgments, state requests and message resend requests into three separate <a href="/mtproto/service_messages_about_messages#acknowledgment-of-receipt"><code>msgs_ack</code></a>, <a href="https://core.telegram.org/mtproto/service_messages_about_messages#request-for-message-status-information"><code>msgs_state_req</code></a>, <a href="/mtproto/service_messages_about_messages#explicit-request-to-re-send-messages"><code>msg_resend_req</code></a> service messages with at most 8192 IDs each; these three messages (+http_wait) will not be included in the <code>1020</code> message limit. </p>
<p><code>bytes</code> is the number of bytes in the body serialization.
All messages in a container must have msg_id lower than that of the container itself. A container does not require an acknowledgment and may not carry other simple containers. When messages are re-sent, they may be combined into a container in a different manner or sent individually.</p>
<p>MTProto container payloads have a limit of <code>2^15</code> bytes or <code>1020</code> messages, whichever limit is reached first.<br>
Clients should group acknowledgments, state requests and message resend requests into three separate <a href="/mtproto/service_messages_about_messages#acknowledgment-of-receipt"><code>msgs_ack</code></a>, <a href="https://core.telegram.org/mtproto/service_messages_about_messages#request-for-message-status-information"><code>msgs_state_req</code></a>, <a href="/mtproto/service_messages_about_messages#explicit-request-to-re-send-messages"><code>msg_resend_req</code></a> service messages with at most 8192 IDs each; these three messages (+http_wait) will not be included in the <code>1020</code> message limit. </p>
<p>Empty containers are also allowed. They are used by the server, for example, to respond to an HTTP request when the timeout specified in http_wait expires, and there are no messages to transmit. </p>
<p><a href="https://github.com/tdlib/td/blob/master/td/mtproto/SessionConnection.cpp">Example implementation</a>. </p>
<h4><a class="anchor" name="message-copies" href="#message-copies"><i class="anchor-icon"></i></a>Message Copies</h4>
<h4><a class="anchor" href="#message-copies" id="message-copies" name="message-copies"><i class="anchor-icon"></i></a>Message Copies</h4>
<p>In some situations, an old message with a msg_id that is no longer valid needs to be re-sent. Then, it is wrapped in a copy container:</p>
<pre><code>msg_copy#e06046b2 orig_message:Message = MessageCopy;</code></pre>
<p>Once received, the message is processed as if the wrapper were not there. However, if it is known for certain that the message orig_message.msg_id was received, then the new message is not processed (while at the same time, it and orig_message.msg_id are acknowledged). The value of orig_message.msg_id must be lower than the container&#39;s msg_id.</p>
<p>Once received, the message is processed as if the wrapper were not there. However, if it is known for certain that the message orig_message.msg_id was received, then the new message is not processed (while at the same time, it and orig_message.msg_id are acknowledged). The value of orig_message.msg_id must be lower than the container's msg_id.</p>
<p>This is not used at this time, because an old message can be wrapped in a simple container with the same result.</p>
<h4><a class="anchor" name="packed-object" href="#packed-object"><i class="anchor-icon"></i></a>Packed Object</h4>
<h4><a class="anchor" href="#packed-object" id="packed-object" name="packed-object"><i class="anchor-icon"></i></a>Packed Object</h4>
<p>Used to replace any other object (or rather, a serialization thereof) with its archived (gzipped) representation:</p>
<pre><code>gzip_packed#3072cfa1 packed_data:string = Object;</code></pre>
<p>At the present time, it is supported in the body of an RPC response (i.e., as result in rpc_result) and generated by the server for a limited number of high-level queries. In addition, it may be used to transmit non-service messages (i. e. RPC queries) from client to server.</p>
<h3><a class="anchor" name="http-wait-long-poll" href="#http-wait-long-poll"><i class="anchor-icon"></i></a>HTTP Wait/Long Poll</h3>
<h3><a class="anchor" href="#http-wait-long-poll" id="http-wait-long-poll" name="http-wait-long-poll"><i class="anchor-icon"></i></a>HTTP Wait/Long Poll</h3>
<p>The following special service query not requiring an acknowledgement (which must be transmitted only through an HTTP connection) is used to enable the server to send messages in the future to the client using HTTP protocol:</p>
<pre><code>http_wait#9299359f max_delay:int wait_after:int max_wait:int = HttpWait;</code></pre>
<p>When such a message (or a container carrying such a message) is received, the server either waits <code>max_delay</code> milliseconds, whereupon it forwards all the messages that it is holding on to the client if there is at least one message queued in session (if needed, by placing them into a container to which acknowledgments may also be added); or else waits no more than <code>max_wait</code> milliseconds until such a message is available. If a message never appears, an empty container is transmitted.</p>
@ -119,8 +122,7 @@ destroy_session_none#62d350c9 session_id:long = DestroySessionRes;</code></pre>
<p>At the same time, the <code>max_delay</code> parameter has higher priority than <code>wait_after</code>, and <code>max_wait</code> has higher priority than <code>max_delay</code>.</p>
<p>This message does not require a response or an acknowledgement. If the container transmitted over HTTP carries several such messages, the behavior is undefined (in fact, the latest parameter will be used). </p>
<p>If no <code>http_wait</code> is present in container, default values <code>max_delay=0</code> (milliseconds), <code>wait_after=0</code> (milliseconds), and <code>max_wait=25000</code> (milliseconds) are used. </p>
<p>If the client&#39;s ping of the server takes a long time, it may make sense to set <code>max_delay</code> to a value that is comparable in magnitude to ping time.</p>
</div>
<p>If the client's ping of the server takes a long time, it may make sense to set <code>max_delay</code> to a value that is comparable in magnitude to ping time.</p></div>
</div>

View file

@ -86,7 +86,7 @@
<tbody>
<tr>
<td><a href="/method/phone.exportGroupCallInvite">phone.exportGroupCallInvite</a></td>
<td>Get an <a href="/api/links#video-chatlivestream-links">invite link</a> for a group call or livestream</td>
<td>Get an <a href="/api/links#video-chat-livestream-links">invite link</a> for a group call or livestream</td>
</tr>
</tbody>
</table></div>