Update content of files

This commit is contained in:
GitHub Action 2021-05-18 13:41:25 +00:00
parent bea5971c1a
commit f6f041cbec
8 changed files with 1854 additions and 0 deletions

View file

@ -0,0 +1,149 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Dice</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram supports sending [animated dice](https://telegram.org/blog/folders#and-one-more-thing) emojis.">
<meta property="og:title" content="Dice">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram supports sending [animated dice](https://telegram.org/blog/folders#and-one-more-thing) emojis.">
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?212" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<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="/api/dice" >Dice</a></li></ul></div>
<h1 id="dev_page_title">Dice</h1>
<div id="dev_page_content"><p>Telegram supports sending <a href="https://telegram.org/blog/folders#and-one-more-thing">animated dice</a> emojis.<br>
This is implemented by using the dice constructors: </p>
<pre><code><a href='/constructor/inputMediaDice'>inputMediaDice</a>#e66fbf7b emoticon:<a href='/type/string'>string</a> = <a href='/type/InputMedia'>InputMedia</a>;
<a href='/constructor/messageMediaDice'>messageMediaDice</a>#3f7ee58b value:<a href='/type/int'>int</a> emoticon:<a href='/type/string'>string</a> = <a href='/type/MessageMedia'>MessageMedia</a>;
<a href='/constructor/inputStickerSetDice'>inputStickerSetDice</a>#e67f520e emoticon:<a href='/type/string'>string</a> = <a href='/type/InputStickerSet'>InputStickerSet</a>;
<a href='/constructor/messages.stickerSet'>messages.stickerSet</a>#b60a24a6 set:<a href='/type/StickerSet'>StickerSet</a> packs:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StickerPack'>StickerPack</a>&gt; documents:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Document'>Document</a>&gt; = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
---functions---
<a href='/method/messages.sendMedia'>messages.sendMedia</a>#3491eba9 flags:<a href='/type/%23'>#</a> silent:flags.5?<a href='/constructor/true'>true</a> background:flags.6?<a href='/constructor/true'>true</a> clear_draft:flags.7?<a href='/constructor/true'>true</a> peer:<a href='/type/InputPeer'>InputPeer</a> reply_to_msg_id:flags.0?<a href='/type/int'>int</a> media:<a href='/type/InputMedia'>InputMedia</a> message:<a href='/type/string'>string</a> random_id:<a href='/type/long'>long</a> reply_markup:flags.2?<a href='/type/ReplyMarkup'>ReplyMarkup</a> entities:flags.3?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageEntity'>MessageEntity</a>&gt; schedule_date:flags.10?<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
<a href='/method/messages.getStickerSet'>messages.getStickerSet</a>#2619a90e stickerset:<a href='/type/InputStickerSet'>InputStickerSet</a> = <a href='/type/messages.StickerSet'>messages.StickerSet</a>;
<a href='/method/help.getAppConfig'>help.getAppConfig</a>#98914110 = <a href='/type/JSONValue'>JSONValue</a>;</code></pre>
<p>On startup, clients should fetch <a href="/api/config#client-configuration">app configuration using help.getAppConfig</a>.<br>
Then, for each dice emoji contained in the <code>emojies_send_dice</code> field, clients should fetch the dice emoji stickerset by calling the <a href="/method/messages.getStickerSet">messages.getStickerSet</a> method, providing the properly populated <a href="/constructor/inputStickerSetDice">inputStickerSetDice</a> to the <code>stickerset</code> field.<br>
The returned stickerset will contain a set of animated stickers, one for each of the dice outcomes, plus a first looping sticker that should be shown as preview to the user before actually sending the dice. </p>
<p>If a user attempts to send a single emoji from the ones specified in <code>emojies_send_dice</code>, the dice should be sent using <a href="/method/messages.sendMedia">messages.sendMedia</a>, providing the dice emoji to the <code>emoticon</code> field. </p>
<p>Incoming dice stickers will be received as a <a href="/constructor/messageMediaDice">messageMediaDice</a> constructor, along with a randomly generated server-side value, ranging from 1 to the maximum allowed value for this type of dice.<br>
Clients should display the correct dice animated sticker for the specified value: since dice values start from 1, and the first animated sticker in dice stickerset is the preview, <code>value</code> can be used to directly index the <code>documents</code> sticker array from the animated stickerset. </p>
<p>The <code>emojies_send_dice_success</code> configuration parameter contains more info about dice emojis other than the basic <img class="emoji" src="//telegram.org/img/emoji/40/F09F8EB2.png" width="20" height="20" alt="🎲" />: </p>
<pre><code> "emojies_send_dice_success": {
"\ud83c\udfaf": {
"value": 6,
"frame_start": 62
},
"\ud83c\udfc0": {
"value": 5,
"frame_start": 110
}
}</code></pre>
<p>For each of the dice emojis, a maximum "winning" value is specified, along with the frame number at which to show the fireworks <img class="emoji" src="//telegram.org/img/emoji/40/F09F8E86.png" width="20" height="20" alt="🎆" />.<br>
Please note that dice animated stickers should loop only once, right after being sent/received <strong>for the first time</strong>; clicking on the dice sticker should bring up a popup, inviting the user to send a new dice of the same type. </p></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/blog">Blog</a></li>
<li><a href="//telegram.org/jobs">Jobs</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/dl/android">Android</a></li>
<li><a href="//telegram.org/dl/wp">Windows Phone</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="/">Platform</a></h5>
<ul>
<li><a href="/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?42"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,165 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Pagination in the API</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="How to fetch results from large lists of objects.">
<meta property="og:title" content="Pagination in the API">
<meta property="og:image" content="4dd378cd0f58b0b820">
<meta property="og:description" content="How to fetch results from large lists of objects.">
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?212" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<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="/api/offsets" >Pagination in the API</a></li></ul></div>
<h1 id="dev_page_title">Pagination in the API</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Lots of Telegram API methods provide access to potentially large lists of objects, which requires pagination.</p>
<p>In order to fetch only relevant subset of results for each request there is a number of available input parameters. Here is a list in order how they are applied in API.</p>
<p>Typically, results are returned in antichronological order with descending object ID values.</p>
<h3><a class="anchor" href="#limit-parameter" id="limit-parameter" name="limit-parameter"><i class="anchor-icon"></i></a><code>limit</code> parameter</h3>
<p>A limit on the number of objects to be returned, typically between 1 and 100. When 0 is provided the limit will often default to an intermediate value like ~20.</p>
<h3><a class="anchor" href="#offset-based-pagination" id="offset-based-pagination" name="offset-based-pagination"><i class="anchor-icon"></i></a><code>offset</code>-based pagination</h3>
<p>For a few methods with mostly static data this parameter allows to skip <code>offset</code> elements from the beginning of list; negative values are ignored.</p>
<h3><a class="anchor" href="#offset-id-based-pagination" id="offset-id-based-pagination" name="offset-id-based-pagination"><i class="anchor-icon"></i></a><code>offset_id</code>-based pagination</h3>
<p>For most methods where results are real-time data (e.g. any chat history) <code>offset</code> value is not passed directly. Instead it is calculated from the passed <code>offset_id</code> and <code>add_offset</code> parameter values as <code>offsetFromID(offset_id) + add_offset</code>, where <code>offsetFromID(offset_id)</code> is a number of results from the beginning of list up to the result with ID <code>offset_id</code>, inclusive.</p>
<p>Sample use cases:</p>
<ul>
<li>
<p>Loading 20 messages, older than message with ID <code>MSGID</code>:</p>
<p>messages.getHistory({offset_id: MSGID, add_offset: 0, limit: 20})</p>
</li>
<li>
<p>Loading 20 messages, newer than message with ID <code>MSGID</code>:</p>
<p>messages.getHistory({offset_id: MSGID, add_offset: -20, limit: 20})</p>
</li>
<li>
<p>Loading 20 messages around message with ID <code>MSGID</code>:</p>
<p>messages.getHistory({offset_id: MSGID, add_offset: -10, limit: 20})</p>
</li>
</ul>
<h3><a class="anchor" href="#additional-filtering" id="additional-filtering" name="additional-filtering"><i class="anchor-icon"></i></a>Additional filtering</h3>
<p>There is a number of parameters, which are applied to the list after slicing with offset and limit, to reduce the result subset even more:</p>
<ul>
<li><strong>max_id</strong>: Can be used to only return results with ID strictly smaller than <code>max_id</code> (e.g. message ID)</li>
<li><strong>min_id</strong>: Can be used to only return results with ID strictly greater than <code>min_id</code>(e.g. message ID)</li>
<li><strong>max_date</strong>: Can be used to only return results that are older than <code>max_date</code>:</li>
<li><strong>min_date</strong>: Can be used to only return results with are newer than <code>min_date</code>:</li>
<li><strong>hash</strong>: See below.</li>
</ul>
<h3><a class="anchor" href="#hash-generation" id="hash-generation" name="hash-generation"><i class="anchor-icon"></i></a>Hash generation</h3>
<p>To further reduce the result subset, there is a mechanism to avoid fetching data if the resulting list hasn't changed from the one stored on client, similar to <a href="https://en.wikipedia.org/wiki/HTTP_ETag">ETag</a>.</p>
<p>When the client has cached results for API request, it can calculate the <code>hash</code> value for it by taking the result IDs (message IDs or other fields with name <code>id</code>) and using them to compute a 32-bit hash with the following algorithm:</p>
<pre><code>hash = 0
for id in ids:
hash = (((hash * 0x4F25) &amp; 0x7FFFFFFF) + id) &amp; 0x7FFFFFFF</code></pre>
<p>In some cases, the result container already has a <code>hash</code> field, that can be used instead.</p>
<p>When the client passes a correct value, the API will return one of <code>*NotModified</code> constructors, e.g. <a href="/constructor/messages.messagesNotModified">messages.messagesNotModified</a> instead of the actual results.</p>
<h3><a class="anchor" href="#example-methods" id="example-methods" name="example-methods"><i class="anchor-icon"></i></a>Example methods</h3>
<ul>
<li><a href="/method/messages.getHistory">messages.getHistory</a> supports all result navigation parameters including message ID hashes and except filters</li>
<li><a href="/method/channels.getParticipants">channels.getParticipants</a> supports simple navigation using <strong>limit</strong> and <strong>offset</strong>, along with filtering and <code>hash</code> reducing using the user IDs of returned participants</li>
</ul></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/blog">Blog</a></li>
<li><a href="//telegram.org/jobs">Jobs</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/dl/android">Android</a></li>
<li><a href="//telegram.org/dl/wp">Windows Phone</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="/">Platform</a></h5>
<ul>
<li><a href="/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?42"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,297 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Channel statistics</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram offers detailed channel statistics for channels and supergroups.">
<meta property="og:title" content="Channel statistics">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram offers detailed channel statistics for channels and supergroups.">
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?212" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<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="/api/stats" >Channel statistics</a></li></ul></div>
<h1 id="dev_page_title">Channel statistics</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Telegram offers detailed channel statistics for channels and supergroups. </p>
<h3><a class="anchor" href="#channel-statistics" id="channel-statistics" name="channel-statistics"><i class="anchor-icon"></i></a>Channel statistics</h3>
<p>Scheme:</p>
<pre><code><a href='/constructor/statsDateRangeDays'>statsDateRangeDays</a>#b637edaf min_date:<a href='/type/int'>int</a> max_date:<a href='/type/int'>int</a> = <a href='/type/StatsDateRangeDays'>StatsDateRangeDays</a>;
<a href='/constructor/statsAbsValueAndPrev'>statsAbsValueAndPrev</a>#cb43acde current:<a href='/type/double'>double</a> previous:<a href='/type/double'>double</a> = <a href='/type/StatsAbsValueAndPrev'>StatsAbsValueAndPrev</a>;
<a href='/constructor/statsPercentValue'>statsPercentValue</a>#cbce2fe0 part:<a href='/type/double'>double</a> total:<a href='/type/double'>double</a> = <a href='/type/StatsPercentValue'>StatsPercentValue</a>;
<a href='/constructor/statsGraphAsync'>statsGraphAsync</a>#4a27eb2d token:<a href='/type/string'>string</a> = <a href='/type/StatsGraph'>StatsGraph</a>;
<a href='/constructor/statsGraphError'>statsGraphError</a>#bedc9822 error:<a href='/type/string'>string</a> = <a href='/type/StatsGraph'>StatsGraph</a>;
<a href='/constructor/statsGraph'>statsGraph</a>#8ea464b6 flags:<a href='/type/%23'>#</a> json:<a href='/type/DataJSON'>DataJSON</a> zoom_token:flags.0?<a href='/type/string'>string</a> = <a href='/type/StatsGraph'>StatsGraph</a>;
<a href='/constructor/messageInteractionCounters'>messageInteractionCounters</a>#ad4fc9bd msg_id:<a href='/type/int'>int</a> views:<a href='/type/int'>int</a> forwards:<a href='/type/int'>int</a> = <a href='/type/MessageInteractionCounters'>MessageInteractionCounters</a>;
<a href='/constructor/stats.broadcastStats'>stats.broadcastStats</a>#bdf78394 period:<a href='/type/StatsDateRangeDays'>StatsDateRangeDays</a> followers:<a href='/type/StatsAbsValueAndPrev'>StatsAbsValueAndPrev</a> views_per_post:<a href='/type/StatsAbsValueAndPrev'>StatsAbsValueAndPrev</a> shares_per_post:<a href='/type/StatsAbsValueAndPrev'>StatsAbsValueAndPrev</a> enabled_notifications:<a href='/type/StatsPercentValue'>StatsPercentValue</a> growth_graph:<a href='/type/StatsGraph'>StatsGraph</a> followers_graph:<a href='/type/StatsGraph'>StatsGraph</a> mute_graph:<a href='/type/StatsGraph'>StatsGraph</a> top_hours_graph:<a href='/type/StatsGraph'>StatsGraph</a> interactions_graph:<a href='/type/StatsGraph'>StatsGraph</a> iv_interactions_graph:<a href='/type/StatsGraph'>StatsGraph</a> views_by_source_graph:<a href='/type/StatsGraph'>StatsGraph</a> new_followers_by_source_graph:<a href='/type/StatsGraph'>StatsGraph</a> languages_graph:<a href='/type/StatsGraph'>StatsGraph</a> recent_message_interactions:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/MessageInteractionCounters'>MessageInteractionCounters</a>&gt; = <a href='/type/stats.BroadcastStats'>stats.BroadcastStats</a>;
---functions---
<a href='/method/stats.getBroadcastStats'>stats.getBroadcastStats</a>#ab42441a flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/stats.BroadcastStats'>stats.BroadcastStats</a>;
<a href='/method/stats.loadAsyncGraph'>stats.loadAsyncGraph</a>#621d5fa0 flags:<a href='/type/%23'>#</a> token:<a href='/type/string'>string</a> x:flags.0?<a href='/type/long'>long</a> = <a href='/type/StatsGraph'>StatsGraph</a>;</code></pre>
<p>Administrators of <a href="/api/channel">channels</a> of a certain size (the exact limit is a server-side config, returned in the <code>can_view_stats</code> flag of <a href="/constructor/channelFull">channelFull</a>) can call <a href="/method/stats.getBroadcastStats">stats.getBroadcastStats</a> to get detailed channel statistics.<br>
The returned <a href="/constructor/stats.broadcastStats">stats.broadcastStats</a> contains multiple statistics: </p>
<ul>
<li>Period-related statistics: a pair of values, one at the beginning and one at the end of the period in consideration (<code>period</code>). <br> The <code>period</code> typically depends on channel activity.<ul>
<li>Absolute follower count (<code>followers</code>)</li>
<li><code>total_viewcount/postcount</code>, for posts posted during the period in consideration (<code>views_per_post</code>).<br>
Note that in this case, <code>current</code> refers to the <code>period</code> in consideration (<code>min_date</code> till <code>max_date</code>), and <code>prev</code> refers to the previous period (<code>(min_date - (max_date - min_date))</code> till <code>min_date</code>). </li>
<li><code>total_sharecount/postcount</code>, for posts posted during the period in consideration (<code>shares_per_post</code>).<br>
Note that in this case, <code>current</code> refers to the <code>period</code> in consideration (<code>min_date</code> till <code>max_date</code>), and <code>prev</code> refers to the previous period (<code>(min_date - (max_date - min_date))</code> till <code>min_date</code>).</li>
</ul>
</li>
<li>Percentage statistics<ul>
<li>Percentage of subscribers with enabled notifications (<code>enabled_notifications</code>)</li>
</ul>
</li>
<li>Graphs: <a href="#graph-visualization">graphs are described below »</a>. </li>
</ul>
<h3><a class="anchor" href="#supergroup-statistics" id="supergroup-statistics" name="supergroup-statistics"><i class="anchor-icon"></i></a>Supergroup statistics</h3>
<p>Scheme:</p>
<pre><code><a href='/constructor/statsGroupTopPoster'>statsGroupTopPoster</a>#18f3d0f7 user_id:<a href='/type/int'>int</a> messages:<a href='/type/int'>int</a> avg_chars:<a href='/type/int'>int</a> = <a href='/type/StatsGroupTopPoster'>StatsGroupTopPoster</a>;
<a href='/constructor/statsGroupTopInviter'>statsGroupTopInviter</a>#31962a4c user_id:<a href='/type/int'>int</a> invitations:<a href='/type/int'>int</a> = <a href='/type/StatsGroupTopInviter'>StatsGroupTopInviter</a>;
<a href='/constructor/statsGroupTopAdmin'>statsGroupTopAdmin</a>#6014f412 user_id:<a href='/type/int'>int</a> deleted:<a href='/type/int'>int</a> kicked:<a href='/type/int'>int</a> banned:<a href='/type/int'>int</a> = <a href='/type/StatsGroupTopAdmin'>StatsGroupTopAdmin</a>;
<a href='/constructor/stats.megagroupStats'>stats.megagroupStats</a>#ef7ff916 period:<a href='/type/StatsDateRangeDays'>StatsDateRangeDays</a> members:<a href='/type/StatsAbsValueAndPrev'>StatsAbsValueAndPrev</a> messages:<a href='/type/StatsAbsValueAndPrev'>StatsAbsValueAndPrev</a> viewers:<a href='/type/StatsAbsValueAndPrev'>StatsAbsValueAndPrev</a> posters:<a href='/type/StatsAbsValueAndPrev'>StatsAbsValueAndPrev</a> growth_graph:<a href='/type/StatsGraph'>StatsGraph</a> members_graph:<a href='/type/StatsGraph'>StatsGraph</a> new_members_by_source_graph:<a href='/type/StatsGraph'>StatsGraph</a> languages_graph:<a href='/type/StatsGraph'>StatsGraph</a> messages_graph:<a href='/type/StatsGraph'>StatsGraph</a> actions_graph:<a href='/type/StatsGraph'>StatsGraph</a> top_hours_graph:<a href='/type/StatsGraph'>StatsGraph</a> weekdays_graph:<a href='/type/StatsGraph'>StatsGraph</a> top_posters:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StatsGroupTopPoster'>StatsGroupTopPoster</a>&gt; top_admins:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StatsGroupTopAdmin'>StatsGroupTopAdmin</a>&gt; top_inviters:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/StatsGroupTopInviter'>StatsGroupTopInviter</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/stats.MegagroupStats'>stats.MegagroupStats</a>;
---functions---
<a href='/method/stats.getMegagroupStats'>stats.getMegagroupStats</a>#dcdf8607 flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/stats.MegagroupStats'>stats.MegagroupStats</a>;</code></pre>
<p>Administrators of <a href="/api/channel">supergroups</a> of a certain size (the exact limit is a server-side config, returned in the <code>can_view_stats</code> flag of <a href="/constructor/channelFull">channelFull</a>) can call <a href="/method/stats.getMegagroupStats">stats.getMegagroupStats</a> to get detailed supergroup statistics.<br>
The returned <a href="/constructor/stats.broadcastStats">stats.broadcastStats</a> contains multiple statistics, see the <a href="/constructor/stats.broadcastStats">constructor page for more info »</a>. </p>
<h3><a class="anchor" href="#message-statistics" id="message-statistics" name="message-statistics"><i class="anchor-icon"></i></a>Message statistics</h3>
<pre><code><a href='/constructor/stats.messageStats'>stats.messageStats</a>#8999f295 views_graph:<a href='/type/StatsGraph'>StatsGraph</a> = <a href='/type/stats.MessageStats'>stats.MessageStats</a>;
---functions---
<a href='/method/stats.getMessageStats'>stats.getMessageStats</a>#b6e0a3f5 flags:<a href='/type/%23'>#</a> dark:flags.0?<a href='/constructor/true'>true</a> channel:<a href='/type/InputChannel'>InputChannel</a> msg_id:<a href='/type/int'>int</a> = <a href='/type/stats.MessageStats'>stats.MessageStats</a>;</code></pre>
<p>Administrators of <a href="/api/channel">channels</a> of a certain size (the exact limit is a server-side config, returned in the <code>can_view_stats</code> flag of <a href="/constructor/channelFull">channelFull</a>) can call <a href="/method/stats.getMessageStats">stats.getMessageStats</a> to get statistics of a specific message.<br>
The returned <a href="/constructor/stats.messageStats">stats.messageStats</a> contains the view graph of the message. </p>
<h2><a class="anchor" href="#graph-visualization" id="graph-visualization" name="graph-visualization"><i class="anchor-icon"></i></a>Graph visualization</h2>
<p>There are four available visualizations for graph types:</p>
<ul>
<li><a href="#line-graph">Line graph</a></li>
<li><a href="#step-graph">Step graph</a></li>
<li><a href="#bar-graph">Bar graph</a></li>
<li><a href="#area-graph">Area graph</a></li>
</ul>
<p>Graph modifiers (see <a href="#graph-examples">various graphs</a> for examples): </p>
<ul>
<li><code>y_scaled</code> - Indicates that each of the two (!) lines in a step graph must be visualized on its own scale, with two different tick axes on the left and right parts of the graph</li>
<li><code>percentage</code> - Indicates whether value percentages should be shown in labels</li>
<li><code>stacked</code> - Depending on the graph type, indicates stacking of multiple columns in the same graph</li>
</ul>
<h3><a class="anchor" href="#graph-syntax" id="graph-syntax" name="graph-syntax"><i class="anchor-icon"></i></a>Graph syntax</h3>
<pre><code><a href='/constructor/statsGraphAsync'>statsGraphAsync</a>#4a27eb2d token:<a href='/type/string'>string</a> = <a href='/type/StatsGraph'>StatsGraph</a>;
<a href='/constructor/statsGraphError'>statsGraphError</a>#bedc9822 error:<a href='/type/string'>string</a> = <a href='/type/StatsGraph'>StatsGraph</a>;
<a href='/constructor/statsGraph'>statsGraph</a>#8ea464b6 flags:<a href='/type/%23'>#</a> json:<a href='/type/DataJSON'>DataJSON</a> zoom_token:flags.0?<a href='/type/string'>string</a> = <a href='/type/StatsGraph'>StatsGraph</a>;
<a href='/constructor/dataJSON'>dataJSON</a>#7d748d04 data:<a href='/type/string'>string</a> = <a href='/type/DataJSON'>DataJSON</a>;
---functions---
<a href='/method/stats.loadAsyncGraph'>stats.loadAsyncGraph</a>#621d5fa0 flags:<a href='/type/%23'>#</a> token:<a href='/type/string'>string</a> x:flags.0?<a href='/type/long'>long</a> = <a href='/type/StatsGraph'>StatsGraph</a>;</code></pre>
<p>Certain graphs are not directly sent in the <a href="/constructor/stats.broadcastStats">stats.broadcastStats</a> constructor to reduce server load: instead, those graphs will be sent as a <a href="/constructor/statsGraphAsync">statsGraphAsync</a> constructor, and should be fetched separately using <a href="/method/stats.loadAsyncGraph">stats.loadAsyncGraph</a>. </p>
<p>After obtaining the full <a href="/constructor/statsGraph">statsGraph</a> constructor, clients should parse the JSON graph object in the <code>json</code> field.</p>
<p>Object structure: </p>
<table class="table">
<thead>
<tr>
<th>Key</th>
<th>Graph title</th>
</tr>
</thead>
<tbody>
<tr>
<td>columns</td>
<td>Array of all data column arrays in the chart. Each column array has its <strong>label</strong> at position 0, followed by values.</td>
</tr>
<tr>
<td>types</td>
<td><a href="#graphs">Graphs types</a> for each of the column arrays (object, <code>"label": "type"</code>): <br>- <code>line</code> - <a href="#line-graph">line graph</a> <br>- <code>area</code> - <a href="#area-graph">area graph</a> <br>- <code>step</code> - <a href="#step-graph">step graph</a> <br>- <code>bar</code> - <a href="#bar-graph">bar graph</a> <br>- <code>x</code> - x axis values for each of the charts at the corresponding positions, UNIX timestamps in milliseconds.</td>
</tr>
<tr>
<td>colors</td>
<td>Color for each type (object, <code>"label": "colorKey#AAAAAA"</code>; see <a href="#chart-colors">chart colors</a>).</td>
</tr>
<tr>
<td>names</td>
<td>Localized name for each variable (object, <code>"label": "Name"</code>)</td>
</tr>
<tr>
<td>subchart</td>
<td>Object indicating the default zoom range for the graph, this is object's structure: <br>- <code>show</code> - Whether to use the specified zoom range (boolean) <br>- <code>defaultZoom</code> - An array with two <code>x</code> values, indicating the two ends of the default zoom range</td>
</tr>
<tr>
<td>y_scaled</td>
<td>Indicates that each of the two (!) lines in a step graph must be visualized on its own scale, with two different tick axes on the left and right parts of the graph (boolean, see <a href="#graph-examples">various graphs</a> for examples)</td>
</tr>
<tr>
<td>percentage</td>
<td>Indicates whether value percentages should be shown in labels (boolean, see <a href="#graph-examples">various graphs</a> for examples)</td>
</tr>
<tr>
<td>stacked</td>
<td>Depending on the graph type, indicates stacking of multiple columns in the same graph (boolean, see <a href="#graph-examples">various graphs</a> for examples)</td>
</tr>
</tbody>
</table>
<!-- | hidden | Array of columns that should not be visualized in the final graph | -->
<p>The following chart restrictions apply:</p>
<ul>
<li>Up to 50 columns on one graph must be supported.</li>
<li>Chart types are always the same for every column in the graph.</li>
<li>The <code>bar</code> chart type and <code>stacked</code> option are always used together.</li>
<li><code>percentage</code> is always used with the <code>area</code> graph.<!-- * Graphs with every chart type _should_ be able to zoom into the same chart type with the same columns (names and types). -->
<!-- * `y_scaled` is only used with exactly 2 `line` columns -->
</li>
</ul>
<h3><a class="anchor" href="#chart-zooming" id="chart-zooming" name="chart-zooming"><i class="anchor-icon"></i></a>Chart zooming</h3>
<pre><code><a href='/constructor/statsGraphError'>statsGraphError</a>#bedc9822 error:<a href='/type/string'>string</a> = <a href='/type/StatsGraph'>StatsGraph</a>;
<a href='/constructor/statsGraph'>statsGraph</a>#8ea464b6 flags:<a href='/type/%23'>#</a> json:<a href='/type/DataJSON'>DataJSON</a> zoom_token:flags.0?<a href='/type/string'>string</a> = <a href='/type/StatsGraph'>StatsGraph</a>;
<a href='/constructor/dataJSON'>dataJSON</a>#7d748d04 data:<a href='/type/string'>string</a> = <a href='/type/DataJSON'>DataJSON</a>;
---functions---
<a href='/method/stats.loadAsyncGraph'>stats.loadAsyncGraph</a>#621d5fa0 flags:<a href='/type/%23'>#</a> token:<a href='/type/string'>string</a> x:flags.0?<a href='/type/long'>long</a> = <a href='/type/StatsGraph'>StatsGraph</a>;</code></pre>
<p>Graphs that support zooming will contain a <code>zoom_token</code> in the <a href="/constructor/statsGraph">statsGraph</a> constructor.<br>
Said token should be then used as <code>token</code> in a new <a href="/method/stats.loadAsyncGraph">stats.loadAsyncGraph</a> call triggered when the user clicks on the label, related to a certain x axis in the graph (see <a href="#graph-examples">graph examples</a>).<br>
The <code>x</code> coordinate of the label should be provided to the <code>x</code> parameter; the method will then return (if available) a more detailed subgraph.<br>
If not enough data is available, a localized <a href="/constructor/statsGraphError">statsGraphError</a> will be returned. </p>
<p>Typical zoom <em>visualization</em> rules: </p>
<ul>
<li>Any <code>percentage</code> graph (even if a <code>zoom_token</code> is not available) =&gt; <a href="#piechart">piechart</a></li>
<li><a href="#line-graph">line graph</a> =&gt; <a href="#line-graph">line graph</a></li>
<li><a href="#step-graph">step graph</a> =&gt; <a href="#step-graph">step graph</a></li>
<li><a href="#bar-graph">bar graph</a> =&gt; <a href="#bar-graph">bar graph</a></li>
<li><a href="#area-graph">area graph</a> =&gt; <a href="#area-graph">area graph</a></li>
</ul>
<h3><a class="anchor" href="#chart-colors" id="chart-colors" name="chart-colors"><i class="anchor-icon"></i></a>Chart colors</h3>
<p>Chart colors can be provided as a color key, followed by the primary color value in hex format: </p>
<pre><code>red#e05356</code></pre>
<p>The color key can be one of <code>red</code>, <code>lightblue</code>, <code>lightgreen</code>, <code>golden</code>, <code>green</code>, <code>orange</code>, <code>blue</code>, <code>indigo</code>.<br>
Apps can choose to use a color value specified by the currently loaded theme: for example, the <a href="https://github.com/DrKLO/Telegram/blob/dceccae0b74576d092fb3b2accaffded2c0b5f63/TMessagesProj/src/main/java/org/telegram/ui/Charts/data/ChartData.java#L81">android app</a> uses <code>statisticChartLine_*</code> themekeys for each of the color keys, check out the <a href="https://github.com/DrKLO/Telegram/tree/master/TMessagesProj/src/main/assets">assets directory</a> for a bunch of default themes with various colors for channel statistics. </p>
<p>However, the server may also choose to return just a plain color value in hex format: </p>
<pre><code>#e05356</code></pre>
<p>In this case, the <code>dark</code> flag of the <a href="/method/stats.getBroadcastStats">stats.getBroadcastStats</a> method can be used to choose the palette of returned colors.</p>
<h2><a class="anchor" href="#graph-examples" id="graph-examples" name="graph-examples"><i class="anchor-icon"></i></a>Graph examples</h2>
<h3><a class="anchor" href="#line-graph" id="line-graph" name="line-graph"><i class="anchor-icon"></i></a>Line graph</h3>
<p>Simple single line graph</p>
<h3><a class="anchor" href="#step-graph" id="step-graph" name="step-graph"><i class="anchor-icon"></i></a>Step graph</h3>
<p>Step graph, always "stacked" (to indicate multiple lines)</p>
<h3><a class="anchor" href="#bar-graph" id="bar-graph" name="bar-graph"><i class="anchor-icon"></i></a>Bar graph</h3>
<p>Bar graph with multiple lines, always "stacked" (to indicate actual stacked bars, biggest bars first)</p>
<h3><a class="anchor" href="#area-graph" id="area-graph" name="area-graph"><i class="anchor-icon"></i></a>Area graph</h3>
<p>Mixed bar/line graph, always "stacked" (to indicate actual stacked bars, biggest bars first)</p>
<h3><a class="anchor" href="#piechart" id="piechart" name="piechart"><i class="anchor-icon"></i></a>Piechart</h3>
<p>Piechart, typically obtained only when zooming into percentage graphs</p></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/blog">Blog</a></li>
<li><a href="//telegram.org/jobs">Jobs</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/dl/android">Android</a></li>
<li><a href="//telegram.org/dl/wp">Windows Phone</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="/">Platform</a></h5>
<ul>
<li><a href="/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?42"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,282 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>user</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Indicates info about a certain user">
<meta property="og:title" content="user">
<meta property="og:image" content="">
<meta property="og:description" content="Indicates info about a certain user">
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?212" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class=""><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class="active"><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<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="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/user" >user</a></li></ul></div>
<h1 id="dev_page_title">user</h1>
<div id="dev_page_content"><p>Indicates info about a certain user</p>
<p><div class="clearfix">
<ul class="dev_layer_select slightly-pull-right nav nav-pills">
<li class="dropdown">
<a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 121 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121"><strong>121 &ndash; SVG-based Outlines for Stickers</strong></a></li>
<li class="divider"></li>
<li><a href="/api/layers">More...</a></li>
</ul>
</li>
</ul>
</div>
<pre class="page_scheme"><code><a href="/constructor/user" class="current_page_link" >user</a>#938458c1 flags:<a href="/type/%23" >#</a> self:flags.10?true contact:flags.11?true mutual_contact:flags.12?true deleted:flags.13?true bot:flags.14?true bot_chat_history:flags.15?true bot_nochats:flags.16?true verified:flags.17?true restricted:flags.18?true min:flags.20?true bot_inline_geo:flags.21?true support:flags.23?true scam:flags.24?true apply_min_photo:flags.25?true id:<a href="/type/int" >int</a> access_hash:flags.0?<a href="/type/long" >long</a> first_name:flags.1?<a href="/type/string" >string</a> last_name:flags.2?<a href="/type/string" >string</a> username:flags.3?<a href="/type/string" >string</a> phone:flags.4?<a href="/type/string" >string</a> photo:flags.5?<a href="/type/UserProfilePhoto" >UserProfilePhoto</a> status:flags.6?<a href="/type/UserStatus" >UserStatus</a> bot_info_version:flags.14?<a href="/type/int" >int</a> restriction_reason:flags.18?<a href="/type/Vector%20t" >Vector</a>&lt;<a href="/type/RestrictionReason" >RestrictionReason</a>&gt; bot_inline_placeholder:flags.19?<a href="/type/string" >string</a> lang_code:flags.22?<a href="/type/string" >string</a> = <a href="/type/User" >User</a>;</code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<table class="table">
<thead>
<tr>
<th>Name</th>
<th style="text-align: center;">Type</th>
<th>Description</th>
</tr>
</thead>
<tbody>
<tr>
<td><strong>flags</strong></td>
<td style="text-align: center;"><a href="/type/%23">#</a></td>
<td>Flags, see <a href="/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></td>
</tr>
<tr>
<td><strong>self</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.10?<a href="/constructor/true">true</a></td>
<td>Whether this user indicates the currently logged in user</td>
</tr>
<tr>
<td><strong>contact</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.11?<a href="/constructor/true">true</a></td>
<td>Whether this user is a contact</td>
</tr>
<tr>
<td><strong>mutual_contact</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.12?<a href="/constructor/true">true</a></td>
<td>Whether this user is a mutual contact</td>
</tr>
<tr>
<td><strong>deleted</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.13?<a href="/constructor/true">true</a></td>
<td>Whether the account of this user was deleted</td>
</tr>
<tr>
<td><strong>bot</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.14?<a href="/constructor/true">true</a></td>
<td>Is this user a bot?</td>
</tr>
<tr>
<td><strong>bot_chat_history</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.15?<a href="/constructor/true">true</a></td>
<td>Can the bot see all messages in groups?</td>
</tr>
<tr>
<td><strong>bot_nochats</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.16?<a href="/constructor/true">true</a></td>
<td>Can the bot be added to groups?</td>
</tr>
<tr>
<td><strong>verified</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.17?<a href="/constructor/true">true</a></td>
<td>Whether this user is verified</td>
</tr>
<tr>
<td><strong>restricted</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.18?<a href="/constructor/true">true</a></td>
<td>Access to this user must be restricted for the reason specified in <code>restriction_reason</code></td>
</tr>
<tr>
<td><strong>min</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.20?<a href="/constructor/true">true</a></td>
<td>See <a href="/api/min">min</a></td>
</tr>
<tr>
<td><strong>bot_inline_geo</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.21?<a href="/constructor/true">true</a></td>
<td>Whether the bot can request our geolocation in inline mode</td>
</tr>
<tr>
<td><strong>support</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.23?<a href="/constructor/true">true</a></td>
<td>Whether this is an official support user</td>
</tr>
<tr>
<td><strong>scam</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.24?<a href="/constructor/true">true</a></td>
<td>This may be a scam user</td>
</tr>
<tr>
<td><strong>apply_min_photo</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.25?<a href="/constructor/true">true</a></td>
<td>If set, the profile picture for this user should be refetched</td>
</tr>
<tr>
<td><strong>id</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>ID of the user</td>
</tr>
<tr>
<td><strong>access_hash</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/long">long</a></td>
<td>Access hash of the user</td>
</tr>
<tr>
<td><strong>first_name</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>First name</td>
</tr>
<tr>
<td><strong>last_name</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/type/string">string</a></td>
<td>Last name</td>
</tr>
<tr>
<td><strong>username</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/type/string">string</a></td>
<td>Username</td>
</tr>
<tr>
<td><strong>phone</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/type/string">string</a></td>
<td>Phone number</td>
</tr>
<tr>
<td><strong>photo</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.5?<a href="/type/UserProfilePhoto">UserProfilePhoto</a></td>
<td>Profile picture of user</td>
</tr>
<tr>
<td><strong>status</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.6?<a href="/type/UserStatus">UserStatus</a></td>
<td>Online status of user</td>
</tr>
<tr>
<td><strong>bot_info_version</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.14?<a href="/type/int">int</a></td>
<td>Version of the <a href="/constructor/userFull">bot_info field in userFull</a>, incremented every time it changes</td>
</tr>
<tr>
<td><strong>restriction_reason</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.18?<a href="/type/Vector%20t">Vector</a>&lt;<a href="/type/RestrictionReason">RestrictionReason</a>&gt;</td>
<td>Contains the reason why access to this user must be restricted.</td>
</tr>
<tr>
<td><strong>bot_inline_placeholder</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.19?<a href="/type/string">string</a></td>
<td>Inline placeholder for this inline bot</td>
</tr>
<tr>
<td><strong>lang_code</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.22?<a href="/type/string">string</a></td>
<td>Language code of the user</td>
</tr>
</tbody>
</table>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/User">User</a></p>
<h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3>
<h4><a class="anchor" href="#min-constructors" id="min-constructors" name="min-constructors"><i class="anchor-icon"></i></a><a href="/api/min">Min constructors</a></h4>
<p>In some situations user and channel constructors have reduced set of fields present (although id is always there) and min flag set.</p>
<h4><a class="anchor" href="#userfull" id="userfull" name="userfull"><i class="anchor-icon"></i></a><a href="/constructor/userFull">userFull</a></h4>
<p>Extended user info</p></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/blog">Blog</a></li>
<li><a href="//telegram.org/jobs">Jobs</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/dl/android">Android</a></li>
<li><a href="//telegram.org/dl/wp">Windows Phone</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="/">Platform</a></h5>
<ul>
<li><a href="/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?42"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

File diff suppressed because one or more lines are too long

View file

@ -0,0 +1,175 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Security Guidelines for Client Developers (v.1.0, DEPRECATED)</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="This document describes security recommendations for clients using MTProto 1.0, its status is DEPRECATED.
For up-to-date…">
<meta property="og:title" content="Security Guidelines for Client Developers (v.1.0, DEPRECATED)">
<meta property="og:image" content="">
<meta property="og:description" content="This document describes security recommendations for clients using MTProto 1.0, its status is DEPRECATED.
For up-to-date…">
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?212" rel="stylesheet" media="screen">
<style>
</style>
</head>
<body class="preload">
<div class="dev_page_wrap">
<div class="dev_page_head navbar navbar-static-top navbar-tg">
<div class="navbar-inner">
<div class="container clearfix">
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
<ul class="nav navbar-nav">
<li><a href="//telegram.org/">Home</a></li>
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
<li class=""><a href="/api">API</a></li>
<li class="active"><a href="/mtproto">Protocol</a></li>
<li class=""><a href="/schema">Schema</a></li>
</ul>
</div>
</div>
</div>
<div class="container clearfix">
<div class="dev_page">
<div id="dev_page_content_wrap" class=" ">
<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/security_guidelines_v1" >Security Guidelines for Client Developers…</a></li></ul></div>
<h1 id="dev_page_title">Security Guidelines for Client Developers (v.1.0, DEPRECATED)</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<blockquote>
<p>This document describes security recommendations for clients using MTProto 1.0, its status is <strong>DEPRECATED</strong>.
For up-to-date security recommendations, kindly see <a href="/mtproto/security_guidelines">this document</a>.</p>
</blockquote>
<p><strong>See also:</strong></p>
<p><div class="dev_page_nav_wrap"></p>
<ul>
<li><a href="/api/pfs">Perfect Forward Secrecy</a></li>
<li><a href="/api/end-to-end">Secret chats, end-to-end encryption</a></li>
<li><a href="/api/end-to-end/pfs">Perfect Forward Secrecy in Secret Chats</a>
</div></li>
</ul>
<p>While <a href="/mtproto">MTProto</a> is designed to be a reasonably fast and secure protocol, its advantages can be easily negated by careless implementation. We collected some security guidelines for client software developers on this page. All Telegram clients are required to comply with these.</p>
<h3><a class="anchor" href="#diffie--hellman-key-exchange" id="diffie--hellman-key-exchange" name="diffie--hellman-key-exchange"><i class="anchor-icon"></i></a>Diffie--Hellman key exchange</h3>
<p>We use DH key exchange in two cases:</p>
<ul>
<li><a href="/mtproto/auth_key">Creating an authorization key</a></li>
<li><a href="/api/end-to-end">Establishing Secret Chats with end-to-end encryption</a></li>
</ul>
<p>In both cases, there are some verifications to be done whenever DH is used:</p>
<h4><a class="anchor" href="#validation-of-dh-parameters" id="validation-of-dh-parameters" name="validation-of-dh-parameters"><i class="anchor-icon"></i></a>Validation of DH parameters</h4>
<p>Client is expected to check whether <strong>p = dh_prime</strong> is a safe 2048-bit prime (meaning that both <strong>p</strong> and <strong>(p-1)/2</strong> are prime, and that 2^2047 &lt; p &lt; 2^2048), and that <strong>g</strong> generates a cyclic subgroup of prime order <strong>(p-1)/2</strong>, i.e. is a quadratic residue <strong>mod p</strong>. Since <strong>g</strong> is always equal to 2, 3, 4, 5, 6 or 7, this is easily done using quadratic reciprocity law, yielding a simple condition on <strong>p mod 4g</strong> -- namely, <strong>p mod 8 = 7</strong> for <strong>g = 2</strong>; <strong>p mod 3 = 2</strong> for <strong>g = 3</strong>; no extra condition for <strong>g = 4</strong>; <strong>p mod 5 = 1 or 4</strong> for <strong>g = 5</strong>; <strong>p mod 24 = 19 or 23</strong> for <strong>g = 6</strong>; and <strong>p mod 7 = 3, 5 or 6</strong> for <strong>g = 7</strong>. After <strong>g</strong> and <strong>p</strong> have been checked by the client, it makes sense to cache the result, so as not to repeat lengthy computations in future.</p>
<p>If the verification takes too long (which is the case for older mobile devices), one might initially run only 15 Miller--Rabin iterations (use parameter 30 in Java) for verifying primeness of <strong>p</strong> and <strong>(p - 1)/2</strong> with error probability not exceeding one billionth, and do more iterations in the background later.</p>
<p>Another way to optimize this is to embed into the client application code a small table with some known "good" couples <strong>(g,p)</strong> (or just known safe primes <strong>p</strong>, since the condition on <strong>g</strong> is easily verified during execution), checked during code generation phase, so as to avoid doing such verification during runtime altogether. The server rarely changes these values, thus one usually needs to put the current value of server's <strong>dh_prime</strong> into such a table. For example, the current value of <strong>dh_prime</strong> equals (in big-endian byte order)</p>
<pre><code>C7 1C AE B9 C6 B1 C9 04 8E 6C 52 2F 70 F1 3F 73 98 0D 40 23 8E 3E 21 C1 49 34 D0 37 56 3D 93 0F 48 19 8A 0A A7 C1 40 58 22 94 93 D2 25 30 F4 DB FA 33 6F 6E 0A C9 25 13 95 43 AE D4 4C CE 7C 37 20 FD 51 F6 94 58 70 5A C6 8C D4 FE 6B 6B 13 AB DC 97 46 51 29 69 32 84 54 F1 8F AF 8C 59 5F 64 24 77 FE 96 BB 2A 94 1D 5B CD 1D 4A C8 CC 49 88 07 08 FA 9B 37 8E 3C 4F 3A 90 60 BE E6 7C F9 A4 A4 A6 95 81 10 51 90 7E 16 27 53 B5 6B 0F 6B 41 0D BA 74 D8 A8 4B 2A 14 B3 14 4E 0E F1 28 47 54 FD 17 ED 95 0D 59 65 B4 B9 DD 46 58 2D B1 17 8D 16 9C 6B C4 65 B0 D6 FF 9C A3 92 8F EF 5B 9A E4 E4 18 FC 15 E8 3E BE A0 F8 7F A9 FF 5E ED 70 05 0D ED 28 49 F4 7B F9 59 D9 56 85 0C E9 29 85 1F 0D 81 15 F6 35 B1 05 EE 2E 4E 15 D0 4B 24 54 BF 6F 4F AD F0 34 B1 04 03 11 9C D8 E3 B9 2F CC 5B</code></pre>
<h4><a class="anchor" href="#g-a-and-g-b-validation" id="g-a-and-g-b-validation" name="g-a-and-g-b-validation"><i class="anchor-icon"></i></a>g_a and g_b validation</h4>
<p>Apart from the conditions on the Diffie-Hellman prime <strong>dh_prime</strong> and generator <strong>g</strong>, both sides are to check that <strong>g</strong>, <strong>g_a</strong> and <strong>g_b</strong> are greater than <strong>1</strong> and less than <strong>dh_prime - 1</strong>. We recommend checking that <strong>g_a</strong> and <strong>g_b</strong> are between <strong>2^{2048-64}</strong> and <strong>dh_prime - 2^{2048-64}</strong> as well.</p>
<h4><a class="anchor" href="#checking-sha1-hash-values" id="checking-sha1-hash-values" name="checking-sha1-hash-values"><i class="anchor-icon"></i></a>Checking SHA1 hash values</h4>
<p>Once the client receives a <code>server_DH_params_ok</code> answer in step 5) of the Authorization Key generation protocol and decrypts it obtaining <code>answer_with_hash</code>, it MUST check that </p>
<pre><code>answer_with_hash := SHA1(answer) + answer + (0-15 random bytes)</code></pre>
<p>In other words, the first 20 bytes of <code>answer_with_hash</code> must be equal to SHA1 of the remainder of the decrypted message without the padding random bytes.</p>
<h4><a class="anchor" href="#checking-nonce-server-nonce-and-new-nonce-fields" id="checking-nonce-server-nonce-and-new-nonce-fields" name="checking-nonce-server-nonce-and-new-nonce-fields"><i class="anchor-icon"></i></a>Checking nonce, server_nonce and new_nonce fields</h4>
<p>When the client receives and/or decrypts server messages during creation of Authorization Key, and these messages contain some nonce fields already known to the client from messages previously obtained during the same run of the protocol, the client is to check that these fields indeed contain the values previosly known.</p>
<h4><a class="anchor" href="#using-secure-pseudorandom-number-generator-to-create-dh-secret-parameters-a-and-b" id="using-secure-pseudorandom-number-generator-to-create-dh-secret-parameters-a-and-b" name="using-secure-pseudorandom-number-generator-to-create-dh-secret-parameters-a-and-b"><i class="anchor-icon"></i></a>Using secure pseudorandom number generator to create DH secret parameters <code>a</code> and <code>b</code></h4>
<p>Client must use a cryptographically secure PRNG to generate secret exponents <code>a</code> or <code>b</code> for DH key exchange. For secret chats, the client might request some entropy (random bytes) from the server while invoking <a href="/method/messages.getDhConfig">messages.getDhConfig</a> and feed these random bytes into its PRNG (for example, by <code>PRNG_seed</code> if OpenSSL library is used), but never using these "random" bytes by themselves or replacing by them the local PRNG seed. One should mix bytes received from server into local PRNG seed.</p>
<h3><a class="anchor" href="#mtproto-encrypted-messages" id="mtproto-encrypted-messages" name="mtproto-encrypted-messages"><i class="anchor-icon"></i></a>MTProto Encrypted Messages</h3>
<p>Some important checks are to be done while sending and especially receiving <a href="/mtproto/description">encrypted MTProto messages</a>.</p>
<h4><a class="anchor" href="#checking-sha1-hash-value-of-msg-key" id="checking-sha1-hash-value-of-msg-key" name="checking-sha1-hash-value-of-msg-key"><i class="anchor-icon"></i></a>Checking SHA1 hash value of msg_key</h4>
<p><code>msg_key</code> is used not only to compute the AES key and IV to decrypt the received message. After decryption, the client <strong>MUST</strong> check that <code>msg_key</code> is indeed equal to SHA1 of the plaintext obtained as the result of decryption (without the final padding bytes).</p>
<p>If an error is encountered before this check could be performed, the client <strong>must</strong> perform the <code>msg-key</code> check anyway before returning any result. Note that the response to any error encountered before the <code>msg_key</code> check <strong>must</strong> be the same as the response to a failed <code>msg_key</code> check.</p>
<h4><a class="anchor" href="#checking-message-length" id="checking-message-length" name="checking-message-length"><i class="anchor-icon"></i></a>Checking message length</h4>
<p>The client is to check that the length of the message or container obtained from the decrypted message (computed from its <code>length</code> field) does not exceed the total size of the plaintext, and that the difference is not more than 15 bytes. Apart from this, knowing the total length is important for the previous verification.</p>
<p>The length should be always divisible by 4 and non-negative. On no account the client is to access data past the end of the decryption buffer containing the plaintext message.</p>
<h4><a class="anchor" href="#checking-session-id" id="checking-session-id" name="checking-session-id"><i class="anchor-icon"></i></a>Checking session_id</h4>
<p>The client is to check that the <code>session_id</code> field in the decrypted message indeed equals to that of an active session created by the client.</p>
<h4><a class="anchor" href="#checking-msg-id" id="checking-msg-id" name="checking-msg-id"><i class="anchor-icon"></i></a>Checking msg_id</h4>
<p>The client must check that <code>msg_id</code> has even parity for messages from client to server, and odd parity for messages from server to client.</p>
<p>In addition, the identifiers (msg_id) of the last N messages received from the other side must be stored, and if a message comes in with an msg_id lower than all or equal to any of the stored values, that message is to be ignored. Otherwise, the new message msg_id is added to the set, and, if the number of stored msg_id values is greater than N, the oldest (i. e. the lowest) is discarded.</p>
<p>In addition, msg_id values that belong over 30 seconds in the future or over 300 seconds in the past are to be ignored (recall that <code>msg_id</code> approximately equals unixtime * 2^32). This is especially important for the server. The client would also find this useful (to protect from a replay attack), but only if it is certain of its time (for example, if its time has been synchronized with that of the server).</p>
<p>Certain client-to-server service messages containing data sent by the client to the server (for example, <code>msg_id</code> of a recent client query) may, nonetheless, be processed on the client even if the time appears to be “incorrect”. This is especially true of messages to change server_salt and notifications about invalid time on the client. See <a href="/mtproto/service_messages">Mobile Protocol: Service Messages</a>.</p>
<h2><a class="anchor" href="#behavior-in-case-of-mismatch" id="behavior-in-case-of-mismatch" name="behavior-in-case-of-mismatch"><i class="anchor-icon"></i></a>Behavior in case of mismatch</h2>
<p>If one of the checks listed above fails, the client is to completely discard the message obtained from server. We also recommend closing and reestablishing the TCP connection to the server, then retrying the operation or the whole key generation protocol.</p>
<p>No information from incorrect messages can be used. Even if the application throws an exception and dies, this is much better than continuing with invalid data.</p>
<p>Notice that invalid messages will infrequently appear during normal work even if no malicious tampering is being done. This is due to network transmission errors. We recommend ignoring the invalid message and closing the TCP connection, then creating a new TCP connection to the server and retrying the original query.</p></div>
</div>
</div>
</div>
<div class="footer_wrap">
<div class="footer_columns_wrap footer_desktop">
<div class="footer_column footer_column_telegram">
<h5>Telegram</h5>
<div class="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
</div>
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
<ul>
<li><a href="//telegram.org/faq">FAQ</a></li>
<li><a href="//telegram.org/blog">Blog</a></li>
<li><a href="//telegram.org/jobs">Jobs</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
<ul>
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
<li><a href="//telegram.org/dl/android">Android</a></li>
<li><a href="//telegram.org/dl/wp">Windows Phone</a></li>
</ul>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
<ul>
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
<li><a href="//macos.telegram.org/">macOS</a></li>
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
</ul>
</div>
<div class="footer_column footer_column_platform">
<h5><a href="/">Platform</a></h5>
<ul>
<li><a href="/api">API</a></li>
<li><a href="//translations.telegram.org/">Translations</a></li>
<li><a href="//instantview.telegram.org/">Instant View</a></li>
</ul>
</div>
</div>
<div class="footer_columns_wrap footer_mobile">
<div class="footer_column">
<h5><a href="//telegram.org/faq">About</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/blog">Blog</a></h5>
</div>
<div class="footer_column">
<h5><a href="//telegram.org/apps">Apps</a></h5>
</div>
<div class="footer_column">
<h5><a href="/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?42"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,388 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Translations</title>
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="alternate icon" href="/favicon.ico?4" type="image/x-icon" />
<script>document.cookie="stel_dt="+encodeURIComponent((new Date).getTimezoneOffset())+";path=/;max-age=31536000;samesite=None;secure"</script>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet" type="text/css">
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/bootstrap-extra.css?2" rel="stylesheet">
<link href="/css/telegram.css?212" rel="stylesheet">
<link href="/css/translations.css?107" rel="stylesheet">
<link href="/css/jquery-ui.min.css" rel="stylesheet">
<link href="/css/health.css?126" rel="stylesheet">
<link href="/css/tchart.min.css?10" rel="stylesheet">
<link href="/css/billboard.css?17" rel="stylesheet">
</head>
<body class="emoji_image no-transition">
<div id="aj_progress" class="progress-bar"></div>
<div id="aj_content"><div class="tr-container">
<header class=" has-search">
<div class="container">
<section class="tr-search">
<div class="tr-search-field-wrap">
<div class="tr-search-filters">
<span class="tr-search-filters-label">Search in:</span><!--
--><span class="tr-search-filter-wrap tr-search-filter-lang"><span class="tr-search-filter dropdown-toggle" data-toggle="dropdown">English</span><span class="dropdown-menu"><ul class="dropdown-menu"><li class="selected"><a class="tr-search-filter-item" data-value="en">English</a></li><li><a class="tr-search-filter-item" data-value="sq">Albanian</a></li><li><a class="tr-search-filter-item" data-value="am">Amharic</a></li><li><a class="tr-search-filter-item" data-value="ar">Arabic</a></li><li><a class="tr-search-filter-item" data-value="az">Azerbaijani</a></li><li><a class="tr-search-filter-item" data-value="eu">Basque</a></li><li><a class="tr-search-filter-item" data-value="be">Belarusian</a></li><li><a class="tr-search-filter-item" data-value="bg">Bulgarian</a></li><li><a class="tr-search-filter-item" data-value="ca">Catalan</a></li><li><a class="tr-search-filter-item" data-value="zh-hans">Chinese (Simplified)</a></li><li><a class="tr-search-filter-item" data-value="zh-hant">Chinese (Traditional)</a></li><li><a class="tr-search-filter-item" data-value="hr">Croatian</a></li><li><a class="tr-search-filter-item" data-value="cs">Czech</a></li><li><a class="tr-search-filter-item" data-value="da">Danish</a></li><li><a class="tr-search-filter-item" data-value="nl">Dutch</a></li><li><a class="tr-search-filter-item" data-value="eo">Esperanto</a></li><li><a class="tr-search-filter-item" data-value="fi">Finnish</a></li><li><a class="tr-search-filter-item" data-value="fr">French</a></li><li><a class="tr-search-filter-item" data-value="gl">Galician</a></li><li><a class="tr-search-filter-item" data-value="de">German</a></li><li><a class="tr-search-filter-item" data-value="el">Greek</a></li><li><a class="tr-search-filter-item" data-value="gu">Gujarati</a></li><li><a class="tr-search-filter-item" data-value="he">Hebrew</a></li><li><a class="tr-search-filter-item" data-value="hi">Hindi</a></li><li><a class="tr-search-filter-item" data-value="hu">Hungarian</a></li><li><a class="tr-search-filter-item" data-value="id">Indonesian</a></li><li><a class="tr-search-filter-item" data-value="ga">Irish</a></li><li><a class="tr-search-filter-item" data-value="it">Italian</a></li><li><a class="tr-search-filter-item" data-value="ja">Japanese</a></li><li><a class="tr-search-filter-item" data-value="kn">Kannada</a></li><li><a class="tr-search-filter-item" data-value="kk">Kazakh</a></li><li><a class="tr-search-filter-item" data-value="ko">Korean</a></li><li><a class="tr-search-filter-item" data-value="lt">Lithuanian</a></li><li><a class="tr-search-filter-item" data-value="ms">Malay</a></li><li><a class="tr-search-filter-item" data-value="ml">Malayalam</a></li><li><a class="tr-search-filter-item" data-value="mt">Maltese</a></li><li><a class="tr-search-filter-item" data-value="mr">Marathi</a></li><li><a class="tr-search-filter-item" data-value="nb">Norwegian (Bokmål)</a></li><li><a class="tr-search-filter-item" data-value="or">Odia</a></li><li><a class="tr-search-filter-item" data-value="fa">Persian</a></li><li><a class="tr-search-filter-item" data-value="pl">Polish</a></li><li><a class="tr-search-filter-item" data-value="pt-br">Portuguese (Brazil)</a></li><li><a class="tr-search-filter-item" data-value="pt-pt">Portuguese (Portugal)</a></li><li><a class="tr-search-filter-item" data-value="ro">Romanian</a></li><li><a class="tr-search-filter-item" data-value="ru">Russian</a></li><li><a class="tr-search-filter-item" data-value="sr">Serbian</a></li><li><a class="tr-search-filter-item" data-value="sk">Slovak</a></li><li><a class="tr-search-filter-item" data-value="es">Spanish</a></li><li><a class="tr-search-filter-item" data-value="sw">Swahili</a></li><li><a class="tr-search-filter-item" data-value="sv">Swedish</a></li><li><a class="tr-search-filter-item" data-value="ta">Tamil</a></li><li><a class="tr-search-filter-item" data-value="te">Telugu</a></li><li><a class="tr-search-filter-item" data-value="th">Thai</a></li><li><a class="tr-search-filter-item" data-value="tr">Turkish</a></li><li><a class="tr-search-filter-item" data-value="tk">Turkmen</a></li><li><a class="tr-search-filter-item" data-value="uk">Ukrainian</a></li><li><a class="tr-search-filter-item" data-value="ur">Urdu</a></li><li><a class="tr-search-filter-item" data-value="uz">Uzbek</a></li><li><a class="tr-search-filter-item" data-value="vi">Vietnamese</a></li></ul></span></span><!--
--><span class="tr-search-filter-wrap tr-search-filter-langpack"><span class="tr-search-filter dropdown-toggle" data-toggle="dropdown">Android</span><span class="dropdown-menu"><ul class="dropdown-menu"><li><a class="tr-search-filter-item" data-value="">All Apps</a></li><li class="selected"><a class="tr-search-filter-item" data-value="android">Android</a></li><li><a class="tr-search-filter-item" data-value="ios">iOS</a></li><li><a class="tr-search-filter-item" data-value="tdesktop">TDesktop</a></li><li><a class="tr-search-filter-item" data-value="macos">macOS</a></li><li><a class="tr-search-filter-item" data-value="android_x">Android X</a></li></ul></span></span>
</div>
<div class="tr-search-binding binding"></div>
<div class="tr-search-enter arrow-right"></div>
<div class="tr-search-reset close"></div>
<form class="tr-search-form">
<input class="form-control tr-search-field" placeholder="Search translations and keys" autocomplete="off" value="" />
</form>
</div>
<div class="tr-search-results collapsed"></div>
</section>
<div class="header-wrap">
<div id="header-panel" class="header-panel">
<div class="header-auth">
<div class="header-auth-item"><a class="header-search-btn"></a></div><div class="header-auth-item"><a class="header-auth-link login-link" href="/auth">Login</a></div>
</div>
<div class="header-breadcrumb header-breadcrumb-simple">
<ol id="breadcrumb" class="header-nav breadcrumb"><li><a href="/">Translations</a></li><li><a href="/en/">English</a></li><li class="active">Android</li></ol>
</div>
</div>
</div>
</div>
</header>
<main class="container">
<nav class="tr-menu"><div class="tr-menu-section tr-menu-has-selected" data-menu-section-id="0">
<div class="tr-menu-header">
<span class="tr-menu-header-collapse"></span>
<div class="tr-menu-header-label">Languages</div>
<div class="tr-menu-selected">
<div class="tr-menu-item tr-menu-item-default">
<span class="nav-label">English</span>
</div>
</div>
</div>
<ul class="tr-menu-items" id="tr-menu-language-items"><li class="active">
<a class="tr-menu-item" href="/en/">
<span class="nav-label">English</span>
</a>
</li><li class="languages-link">
<a class="tr-menu-item">
<span class="nav-label">Other languages...</span>
</a>
</li></ul>
</div><div class="tr-menu-section tr-menu-has-selected" data-menu-section-id="1">
<div class="tr-menu-header">
<span class="tr-menu-header-collapse"></span>
<div class="tr-menu-header-label">Apps</div>
<div class="tr-menu-selected">
<div class="tr-menu-item">
<span class="nav-label">Android</span>
</div>
</div>
</div>
<ul class="tr-menu-items"><li class="active">
<a class="tr-menu-item" href="/en/android/">
<span class="nav-label">Android</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/ios/">
<span class="nav-label">iOS</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/tdesktop/">
<span class="nav-label">TDesktop</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/">
<span class="nav-label">macOS</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android_x/">
<span class="nav-label">Android X</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/emoji">
<span class="nav-label">Emoji</span>
</a>
</li></ul>
</div><div class="tr-menu-section tr-menu-has-selected" data-menu-section-id="2">
<div class="tr-menu-header">
<span class="tr-menu-header-collapse"></span>
<div class="tr-menu-header-label">Sections</div>
<div class="tr-menu-selected">
<div class="tr-menu-item">
<span class="nav-label">All Sections</span>
</div>
</div>
</div>
<ul class="tr-menu-items"><li class="active">
<a class="tr-menu-item" href="/en/android/">
<span class="nav-label">All Sections</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/login/">
<span class="nav-label">Log In</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/chat_list/">
<span class="nav-label">Chat List</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/private_chats/">
<span class="nav-label">Private chats</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/groups_and_channels/">
<span class="nav-label">Groups And Channels</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/profile/">
<span class="nav-label">Profile</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/settings/">
<span class="nav-label">Settings</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/camera_and_media/">
<span class="nav-label">Camera And Media</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/bots_and_payments/">
<span class="nav-label">Bots And Payments</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/passport/">
<span class="nav-label">Passport</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/general/">
<span class="nav-label">General</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android/unsorted/">
<span class="nav-label">Unsorted</span>
</a>
</li></ul>
</div></nav>
<section class="content clearfix">
<section class="tr-content"><h3 class="tr-header">
<a href="/en/" class="tr-back"></a>Android<span class="tr-header-counter">3918</span>
<div class="tr-header-tabs"><span class="tr-header-tab"><a href="/en/android/recent/translations">Translations</a></span><span class="tr-header-tab"><a href="/en/android/recent/suggestions">Suggestions</a></span><span class="tr-header-tab"><a href="/en/android/recent/comments">Comments</a></span></div>
</h3>
<section class="tr-sections clearfix">
<div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/login/" class="tr-section">
<div class="tr-section-cover cover2"></div>
<div class="tr-section-caption">Log In (129)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/chat_list/" class="tr-section">
<div class="tr-section-cover cover3"></div>
<div class="tr-section-caption">Chat List (249)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/private_chats/" class="tr-section">
<div class="tr-section-cover cover4"></div>
<div class="tr-section-caption">Private chats (283)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/groups_and_channels/" class="tr-section">
<div class="tr-section-cover cover8"></div>
<div class="tr-section-caption">Groups And Channels (901)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/profile/" class="tr-section">
<div class="tr-section-cover cover5"></div>
<div class="tr-section-caption">Profile (88)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/settings/" class="tr-section">
<div class="tr-section-cover cover7"></div>
<div class="tr-section-caption">Settings (856)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/camera_and_media/" class="tr-section">
<div class="tr-section-cover cover6"></div>
<div class="tr-section-caption">Camera And Media (221)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/bots_and_payments/" class="tr-section">
<div class="tr-section-cover cover9"></div>
<div class="tr-section-caption">Bots And Payments (107)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/passport/" class="tr-section">
<div class="tr-section-cover cover10"></div>
<div class="tr-section-caption">Passport (179)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/general/" class="tr-section">
<div class="tr-section-cover cover1"></div>
<div class="tr-section-caption">General (805)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/android/unsorted/" class="tr-section">
<div class="tr-section-cover cover0"></div>
<div class="tr-section-caption">Unsorted (461)</div>
</a></div>
</div>
</section></section>
</section>
</main>
</div><div class="popup-container login-popup-container hide" id="login-popup-container">
<div class="popup">
<div class="popup-body">
<section>
<h2>Log In</h2>
<p>Log in here to translate Telegram apps. Please enter your <b>phone number</b> in the <a target="_blank" rel="noopener" href="https://telegram.org/faq#login-and-sms">international format</a> and we will send a confirmation message to your account via Telegram.</p>
<form id="send-form" class="login-form">
<div class="form-group">
<input type="tel" class="form-control tr-form-control input-lg" id="login-phone" placeholder="+12223334455" autocomplete="off"/>
</div>
<div class="popup-buttons">
<a class="btn btn-link btn-lg login-cancel-btn">Cancel</a><button type="submit" class="btn btn-link btn-lg">Next</button>
</div>
</form>
<div id="login-form" class="hide">
<div class="form-group">
<span class="form-control tr-form-control input input-lg input-disabled"><strong id="login-phone-field"></strong> (<a class="login-back" href="/auth">Incorrect?</a>)</span>
<p class="help-block dots-animated">We&#39;ve just sent you a message.<br/>Please confirm access via Telegram</p>
</div>
<div class="popup-buttons">
<a class="btn btn-link btn-lg login-cancel-btn">Cancel</a><a class="btn btn-link btn-lg login-back">Back</a>
</div>
</div>
</section>
</div>
</div>
</div><div class="popup-container languages-popup-container hide" id="languages-popup-container">
<div class="popup">
<div class="popup-body popup-has-footer">
<h4>Languages</h4>
<form class="tr-popup-search-form tr-languages-search-form">
<input class="form-control tr-popup-search-field tr-languages-search-field" placeholder="Search languages" autocomplete="off" value="">
</form>
<div class="tr-popup-search-results-wrap tr-languages-results-wrap">
<div class="tr-popup-search-results tr-languages-results"></div>
</div>
<div class="tr-languages-add"><a href="/lang/new" data-layer class="need-auth">Add a new language</a></div>
</div>
</div>
</div></div>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/main-aj.js?48"></script>
<script src="/js/translations.js?95"></script>
<script src="/js/jquery-ui.min.js?1"></script>
<script src="/js/tesseract.js"></script>
<script src="/js/main.js?42"></script>
<script src="/js/tchart.min.js?13"></script>
<script src="/js/billboard.min.js"></script>
<script src="/js/stats.js?17"></script>
<script>ajInit({"version":694,"apiUrl":"\/api?hash=telegram-crawler","unauth":true,"state":{"searchLang":"en","searchLangpack":"android","langNames":{"en":"English","sq":"Albanian","am":"Amharic","ar":"Arabic","az":"Azerbaijani","eu":"Basque","be":"Belarusian","bg":"Bulgarian","ca":"Catalan","zh-hans":"Chinese (Simplified)","zh-hant":"Chinese (Traditional)","hr":"Croatian","cs":"Czech","da":"Danish","nl":"Dutch","eo":"Esperanto","fi":"Finnish","fr":"French","gl":"Galician","de":"German","el":"Greek","gu":"Gujarati","he":"Hebrew","hi":"Hindi","hu":"Hungarian","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","kn":"Kannada","kk":"Kazakh","ko":"Korean","lt":"Lithuanian","ms":"Malay","ml":"Malayalam","mt":"Maltese","mr":"Marathi","nb":"Norwegian (Bokmål)","or":"Odia","fa":"Persian","pl":"Polish","pt-br":"Portuguese (Brazil)","pt-pt":"Portuguese (Portugal)","ro":"Romanian","ru":"Russian","sr":"Serbian","sk":"Slovak","es":"Spanish","sw":"Swahili","sv":"Swedish","ta":"Tamil","te":"Telugu","th":"Thai","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","uz":"Uzbek","vi":"Vietnamese"},"langpackList":[],"langpackNames":{"":"All Apps","android":"Android","ios":"iOS","tdesktop":"TDesktop","macos":"macOS","android_x":"Android X"},"langList":["en","sq","am","ar","az","eu","be","bg","ca","zh-hans","zh-hant","hr","cs","da","nl","eo","fi","fr","gl","de","el","gu","he","hi","hu","id","ga","it","ja","kn","kk","ko","lt","ms","ml","mt","mr","nb","or","fa","pl","pt-br","pt-pt","ro","ru","sr","sk","es","sw","sv","ta","te","th","tr","tk","uk","ur","uz","vi"],"curLang":"en","curLangpack":"android"}});</script>
<script id="aj_script">l.add({"WEB_PLURALIZED_LABEL_0":"Zero","WEB_PLURALIZED_LABEL_1":"One","WEB_PLURALIZED_LABEL_2":"Two","WEB_PLURALIZED_LABEL_3":"Few","WEB_PLURALIZED_LABEL_4":"Many","WEB_PLURALIZED_LABEL_5":"Other","WEB_NO_TRANSLATIONS_FOUND":"No translations found","WEB_TRANSLATIONS_LOADING":"Loading","WEB_ACTIVATE_LANGPACK_CONFIRM_TEXT":"Do you want to begin translating <b>{lang_pack}<\/b> to <b>{lang}<\/b>?","WEB_ACTIVATE_LANGPACK_CONFIRM_BUTTON":"Start Translating","WEB_LOADING":"Loading","WEB_NO_LANGUAGES_FOUND":"No languages found"});
Search.init();
Header.init();
Nav.init();
Aj.onLoad(function(state) {
function requestConfirmation(event) {
event && event.preventDefault();
var phone = $('#login-phone').val();
$.ajax({
type: 'POST',
url: '/auth/request',
data: {
phone: phone
},
success: function(result) {
$('#login-phone-field').text(phone);
$('#send-form').addClass('hide');
$('#login-form').removeClass('hide');
checkAuth(result.temp_session);
},
error: function(xhr) {
showAlert(xhr.responseText || 'Server error');
},
dataType: 'json'
});
return false;
}
function cancelConfirmation(event) {
event && event.preventDefault();
$('#login-phone-field').text('');
$('#send-form').removeClass('hide');
$('#login-form').addClass('hide');
$('#login-phone').focus();
clearTimeout(window.authTimeout);
return false;
}
function checkAuth(temp_session) {
clearTimeout(window.authTimeout);
window.authTimeout = setTimeout(function doCheckAuth() {
$.ajax({
type: 'POST',
url: '/auth/login',
data: {
temp_session: temp_session
},
success: function(result) {
if (result) {
location.reload();
} else {
checkAuth(temp_session);
}
},
error: function (xhr) {
showAlert(xhr.responseText || 'Server error');
},
dataType: 'json'
});
}, 700);
}
$('#login-popup-container').on('popup:open', function() {
$('#login-phone').focus();
});
$('#login-popup-container').on('popup:close', function() {
cancelConfirmation();
if (location.pathname == '/auth') {
window.history && history.replaceState(null, null, '/');
}
});
$('#login-popup-container #send-form').on('submit', requestConfirmation);
$('#login-popup-container .login-cancel-btn').on('click', function(e) {
e.preventDefault();
closePopup('#login-popup-container');
});
$('#login-popup-container .login-back').on('click', cancelConfirmation);
$('header .login-link').on('click', function(e) {
e.stopImmediatePropagation();
e.preventDefault();
openPopup('#login-popup-container');
});
});
Aj.onUnload(function(state) {
$('#login-popup-container').off('popup:open');
$('#login-popup-container').off('popup:close');
$('#login-popup-container #send-form').off('submit');
$('#login-popup-container .login-cancel-btn').off('click');
$('#login-popup-container .login-back').off('click');
$('header .login-link').off('click');
});
</script>
<script>Aj.pageLoaded();</script>
</body>
</html>

View file

@ -0,0 +1,388 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Translations</title>
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
<link rel="alternate icon" href="/favicon.ico?4" type="image/x-icon" />
<script>document.cookie="stel_dt="+encodeURIComponent((new Date).getTimezoneOffset())+";path=/;max-age=31536000;samesite=None;secure"</script>
<link href="https://fonts.googleapis.com/css?family=Roboto:400,500,700" rel="stylesheet" type="text/css">
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/bootstrap-extra.css?2" rel="stylesheet">
<link href="/css/telegram.css?212" rel="stylesheet">
<link href="/css/translations.css?107" rel="stylesheet">
<link href="/css/jquery-ui.min.css" rel="stylesheet">
<link href="/css/health.css?126" rel="stylesheet">
<link href="/css/tchart.min.css?10" rel="stylesheet">
<link href="/css/billboard.css?17" rel="stylesheet">
</head>
<body class="emoji_image no-transition">
<div id="aj_progress" class="progress-bar"></div>
<div id="aj_content"><div class="tr-container">
<header class=" has-search">
<div class="container">
<section class="tr-search">
<div class="tr-search-field-wrap">
<div class="tr-search-filters">
<span class="tr-search-filters-label">Search in:</span><!--
--><span class="tr-search-filter-wrap tr-search-filter-lang"><span class="tr-search-filter dropdown-toggle" data-toggle="dropdown">English</span><span class="dropdown-menu"><ul class="dropdown-menu"><li class="selected"><a class="tr-search-filter-item" data-value="en">English</a></li><li><a class="tr-search-filter-item" data-value="sq">Albanian</a></li><li><a class="tr-search-filter-item" data-value="am">Amharic</a></li><li><a class="tr-search-filter-item" data-value="ar">Arabic</a></li><li><a class="tr-search-filter-item" data-value="az">Azerbaijani</a></li><li><a class="tr-search-filter-item" data-value="eu">Basque</a></li><li><a class="tr-search-filter-item" data-value="be">Belarusian</a></li><li><a class="tr-search-filter-item" data-value="bg">Bulgarian</a></li><li><a class="tr-search-filter-item" data-value="ca">Catalan</a></li><li><a class="tr-search-filter-item" data-value="zh-hans">Chinese (Simplified)</a></li><li><a class="tr-search-filter-item" data-value="zh-hant">Chinese (Traditional)</a></li><li><a class="tr-search-filter-item" data-value="hr">Croatian</a></li><li><a class="tr-search-filter-item" data-value="cs">Czech</a></li><li><a class="tr-search-filter-item" data-value="da">Danish</a></li><li><a class="tr-search-filter-item" data-value="nl">Dutch</a></li><li><a class="tr-search-filter-item" data-value="eo">Esperanto</a></li><li><a class="tr-search-filter-item" data-value="fi">Finnish</a></li><li><a class="tr-search-filter-item" data-value="fr">French</a></li><li><a class="tr-search-filter-item" data-value="gl">Galician</a></li><li><a class="tr-search-filter-item" data-value="de">German</a></li><li><a class="tr-search-filter-item" data-value="el">Greek</a></li><li><a class="tr-search-filter-item" data-value="gu">Gujarati</a></li><li><a class="tr-search-filter-item" data-value="he">Hebrew</a></li><li><a class="tr-search-filter-item" data-value="hi">Hindi</a></li><li><a class="tr-search-filter-item" data-value="hu">Hungarian</a></li><li><a class="tr-search-filter-item" data-value="id">Indonesian</a></li><li><a class="tr-search-filter-item" data-value="ga">Irish</a></li><li><a class="tr-search-filter-item" data-value="it">Italian</a></li><li><a class="tr-search-filter-item" data-value="ja">Japanese</a></li><li><a class="tr-search-filter-item" data-value="kn">Kannada</a></li><li><a class="tr-search-filter-item" data-value="kk">Kazakh</a></li><li><a class="tr-search-filter-item" data-value="ko">Korean</a></li><li><a class="tr-search-filter-item" data-value="lt">Lithuanian</a></li><li><a class="tr-search-filter-item" data-value="ms">Malay</a></li><li><a class="tr-search-filter-item" data-value="ml">Malayalam</a></li><li><a class="tr-search-filter-item" data-value="mt">Maltese</a></li><li><a class="tr-search-filter-item" data-value="mr">Marathi</a></li><li><a class="tr-search-filter-item" data-value="nb">Norwegian (Bokmål)</a></li><li><a class="tr-search-filter-item" data-value="or">Odia</a></li><li><a class="tr-search-filter-item" data-value="fa">Persian</a></li><li><a class="tr-search-filter-item" data-value="pl">Polish</a></li><li><a class="tr-search-filter-item" data-value="pt-br">Portuguese (Brazil)</a></li><li><a class="tr-search-filter-item" data-value="pt-pt">Portuguese (Portugal)</a></li><li><a class="tr-search-filter-item" data-value="ro">Romanian</a></li><li><a class="tr-search-filter-item" data-value="ru">Russian</a></li><li><a class="tr-search-filter-item" data-value="sr">Serbian</a></li><li><a class="tr-search-filter-item" data-value="sk">Slovak</a></li><li><a class="tr-search-filter-item" data-value="es">Spanish</a></li><li><a class="tr-search-filter-item" data-value="sw">Swahili</a></li><li><a class="tr-search-filter-item" data-value="sv">Swedish</a></li><li><a class="tr-search-filter-item" data-value="ta">Tamil</a></li><li><a class="tr-search-filter-item" data-value="te">Telugu</a></li><li><a class="tr-search-filter-item" data-value="th">Thai</a></li><li><a class="tr-search-filter-item" data-value="tr">Turkish</a></li><li><a class="tr-search-filter-item" data-value="tk">Turkmen</a></li><li><a class="tr-search-filter-item" data-value="uk">Ukrainian</a></li><li><a class="tr-search-filter-item" data-value="ur">Urdu</a></li><li><a class="tr-search-filter-item" data-value="uz">Uzbek</a></li><li><a class="tr-search-filter-item" data-value="vi">Vietnamese</a></li></ul></span></span><!--
--><span class="tr-search-filter-wrap tr-search-filter-langpack"><span class="tr-search-filter dropdown-toggle" data-toggle="dropdown">macOS</span><span class="dropdown-menu"><ul class="dropdown-menu"><li><a class="tr-search-filter-item" data-value="">All Apps</a></li><li><a class="tr-search-filter-item" data-value="android">Android</a></li><li><a class="tr-search-filter-item" data-value="ios">iOS</a></li><li><a class="tr-search-filter-item" data-value="tdesktop">TDesktop</a></li><li class="selected"><a class="tr-search-filter-item" data-value="macos">macOS</a></li><li><a class="tr-search-filter-item" data-value="android_x">Android X</a></li></ul></span></span>
</div>
<div class="tr-search-binding binding"></div>
<div class="tr-search-enter arrow-right"></div>
<div class="tr-search-reset close"></div>
<form class="tr-search-form">
<input class="form-control tr-search-field" placeholder="Search translations and keys" autocomplete="off" value="" />
</form>
</div>
<div class="tr-search-results collapsed"></div>
</section>
<div class="header-wrap">
<div id="header-panel" class="header-panel">
<div class="header-auth">
<div class="header-auth-item"><a class="header-search-btn"></a></div><div class="header-auth-item"><a class="header-auth-link login-link" href="/auth">Login</a></div>
</div>
<div class="header-breadcrumb header-breadcrumb-simple">
<ol id="breadcrumb" class="header-nav breadcrumb"><li><a href="/">Translations</a></li><li><a href="/en/">English</a></li><li class="active">macOS</li></ol>
</div>
</div>
</div>
</div>
</header>
<main class="container">
<nav class="tr-menu"><div class="tr-menu-section tr-menu-has-selected" data-menu-section-id="0">
<div class="tr-menu-header">
<span class="tr-menu-header-collapse"></span>
<div class="tr-menu-header-label">Languages</div>
<div class="tr-menu-selected">
<div class="tr-menu-item tr-menu-item-default">
<span class="nav-label">English</span>
</div>
</div>
</div>
<ul class="tr-menu-items" id="tr-menu-language-items"><li class="active">
<a class="tr-menu-item" href="/en/">
<span class="nav-label">English</span>
</a>
</li><li class="languages-link">
<a class="tr-menu-item">
<span class="nav-label">Other languages...</span>
</a>
</li></ul>
</div><div class="tr-menu-section tr-menu-has-selected" data-menu-section-id="1">
<div class="tr-menu-header">
<span class="tr-menu-header-collapse"></span>
<div class="tr-menu-header-label">Apps</div>
<div class="tr-menu-selected">
<div class="tr-menu-item">
<span class="nav-label">macOS</span>
</div>
</div>
</div>
<ul class="tr-menu-items"><li>
<a class="tr-menu-item" href="/en/android/">
<span class="nav-label">Android</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/ios/">
<span class="nav-label">iOS</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/tdesktop/">
<span class="nav-label">TDesktop</span>
</a>
</li><li class="active">
<a class="tr-menu-item" href="/en/macos/">
<span class="nav-label">macOS</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/android_x/">
<span class="nav-label">Android X</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/emoji">
<span class="nav-label">Emoji</span>
</a>
</li></ul>
</div><div class="tr-menu-section tr-menu-has-selected" data-menu-section-id="2">
<div class="tr-menu-header">
<span class="tr-menu-header-collapse"></span>
<div class="tr-menu-header-label">Sections</div>
<div class="tr-menu-selected">
<div class="tr-menu-item">
<span class="nav-label">All Sections</span>
</div>
</div>
</div>
<ul class="tr-menu-items"><li class="active">
<a class="tr-menu-item" href="/en/macos/">
<span class="nav-label">All Sections</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/login/">
<span class="nav-label">Log In</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/chat_list/">
<span class="nav-label">Chat List</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/private_chats/">
<span class="nav-label">Private chats</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/groups_and_channels/">
<span class="nav-label">Groups And Channels</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/profile/">
<span class="nav-label">Profile</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/settings/">
<span class="nav-label">Settings</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/camera_and_media/">
<span class="nav-label">Camera And Media</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/bots_and_payments/">
<span class="nav-label">Bots And Payments</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/passport/">
<span class="nav-label">Passport</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/general/">
<span class="nav-label">General</span>
</a>
</li><li>
<a class="tr-menu-item" href="/en/macos/unsorted/">
<span class="nav-label">Unsorted</span>
</a>
</li></ul>
</div></nav>
<section class="content clearfix">
<section class="tr-content"><h3 class="tr-header">
<a href="/en/" class="tr-back"></a>macOS<span class="tr-header-counter">3314</span>
<div class="tr-header-tabs"><span class="tr-header-tab"><a href="/en/macos/recent/translations">Translations</a></span><span class="tr-header-tab"><a href="/en/macos/recent/suggestions">Suggestions</a></span><span class="tr-header-tab"><a href="/en/macos/recent/comments">Comments</a></span></div>
</h3>
<section class="tr-sections clearfix">
<div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/login/" class="tr-section">
<div class="tr-section-cover cover2"></div>
<div class="tr-section-caption">Log In (56)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/chat_list/" class="tr-section">
<div class="tr-section-cover cover3"></div>
<div class="tr-section-caption">Chat List (196)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/private_chats/" class="tr-section">
<div class="tr-section-cover cover4"></div>
<div class="tr-section-caption">Private chats (132)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/groups_and_channels/" class="tr-section">
<div class="tr-section-cover cover8"></div>
<div class="tr-section-caption">Groups And Channels (888)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/profile/" class="tr-section">
<div class="tr-section-cover cover5"></div>
<div class="tr-section-caption">Profile (28)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/settings/" class="tr-section">
<div class="tr-section-cover cover7"></div>
<div class="tr-section-caption">Settings (630)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/camera_and_media/" class="tr-section">
<div class="tr-section-cover cover6"></div>
<div class="tr-section-caption">Camera And Media (77)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/bots_and_payments/" class="tr-section">
<div class="tr-section-cover cover9"></div>
<div class="tr-section-caption">Bots And Payments (92)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/passport/" class="tr-section">
<div class="tr-section-cover cover10"></div>
<div class="tr-section-caption">Passport (211)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/general/" class="tr-section">
<div class="tr-section-cover cover1"></div>
<div class="tr-section-caption">General (553)</div>
</a></div>
</div><div class="tr-section-col col-lg-4 col-xs-6">
<div class="tr-section-wrap"><a href="/en/macos/unsorted/" class="tr-section">
<div class="tr-section-cover cover0"></div>
<div class="tr-section-caption">Unsorted (581)</div>
</a></div>
</div>
</section></section>
</section>
</main>
</div><div class="popup-container login-popup-container hide" id="login-popup-container">
<div class="popup">
<div class="popup-body">
<section>
<h2>Log In</h2>
<p>Log in here to translate Telegram apps. Please enter your <b>phone number</b> in the <a target="_blank" rel="noopener" href="https://telegram.org/faq#login-and-sms">international format</a> and we will send a confirmation message to your account via Telegram.</p>
<form id="send-form" class="login-form">
<div class="form-group">
<input type="tel" class="form-control tr-form-control input-lg" id="login-phone" placeholder="+12223334455" autocomplete="off"/>
</div>
<div class="popup-buttons">
<a class="btn btn-link btn-lg login-cancel-btn">Cancel</a><button type="submit" class="btn btn-link btn-lg">Next</button>
</div>
</form>
<div id="login-form" class="hide">
<div class="form-group">
<span class="form-control tr-form-control input input-lg input-disabled"><strong id="login-phone-field"></strong> (<a class="login-back" href="/auth">Incorrect?</a>)</span>
<p class="help-block dots-animated">We&#39;ve just sent you a message.<br/>Please confirm access via Telegram</p>
</div>
<div class="popup-buttons">
<a class="btn btn-link btn-lg login-cancel-btn">Cancel</a><a class="btn btn-link btn-lg login-back">Back</a>
</div>
</div>
</section>
</div>
</div>
</div><div class="popup-container languages-popup-container hide" id="languages-popup-container">
<div class="popup">
<div class="popup-body popup-has-footer">
<h4>Languages</h4>
<form class="tr-popup-search-form tr-languages-search-form">
<input class="form-control tr-popup-search-field tr-languages-search-field" placeholder="Search languages" autocomplete="off" value="">
</form>
<div class="tr-popup-search-results-wrap tr-languages-results-wrap">
<div class="tr-popup-search-results tr-languages-results"></div>
</div>
<div class="tr-languages-add"><a href="/lang/new" data-layer class="need-auth">Add a new language</a></div>
</div>
</div>
</div></div>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js"></script>
<script src="/js/main-aj.js?48"></script>
<script src="/js/translations.js?95"></script>
<script src="/js/jquery-ui.min.js?1"></script>
<script src="/js/tesseract.js"></script>
<script src="/js/main.js?42"></script>
<script src="/js/tchart.min.js?13"></script>
<script src="/js/billboard.min.js"></script>
<script src="/js/stats.js?17"></script>
<script>ajInit({"version":694,"apiUrl":"\/api?hash=telegram-crawler","unauth":true,"state":{"searchLang":"en","searchLangpack":"macos","langNames":{"en":"English","sq":"Albanian","am":"Amharic","ar":"Arabic","az":"Azerbaijani","eu":"Basque","be":"Belarusian","bg":"Bulgarian","ca":"Catalan","zh-hans":"Chinese (Simplified)","zh-hant":"Chinese (Traditional)","hr":"Croatian","cs":"Czech","da":"Danish","nl":"Dutch","eo":"Esperanto","fi":"Finnish","fr":"French","gl":"Galician","de":"German","el":"Greek","gu":"Gujarati","he":"Hebrew","hi":"Hindi","hu":"Hungarian","id":"Indonesian","ga":"Irish","it":"Italian","ja":"Japanese","kn":"Kannada","kk":"Kazakh","ko":"Korean","lt":"Lithuanian","ms":"Malay","ml":"Malayalam","mt":"Maltese","mr":"Marathi","nb":"Norwegian (Bokmål)","or":"Odia","fa":"Persian","pl":"Polish","pt-br":"Portuguese (Brazil)","pt-pt":"Portuguese (Portugal)","ro":"Romanian","ru":"Russian","sr":"Serbian","sk":"Slovak","es":"Spanish","sw":"Swahili","sv":"Swedish","ta":"Tamil","te":"Telugu","th":"Thai","tr":"Turkish","tk":"Turkmen","uk":"Ukrainian","ur":"Urdu","uz":"Uzbek","vi":"Vietnamese"},"langpackList":[],"langpackNames":{"":"All Apps","android":"Android","ios":"iOS","tdesktop":"TDesktop","macos":"macOS","android_x":"Android X"},"langList":["en","sq","am","ar","az","eu","be","bg","ca","zh-hans","zh-hant","hr","cs","da","nl","eo","fi","fr","gl","de","el","gu","he","hi","hu","id","ga","it","ja","kn","kk","ko","lt","ms","ml","mt","mr","nb","or","fa","pl","pt-br","pt-pt","ro","ru","sr","sk","es","sw","sv","ta","te","th","tr","tk","uk","ur","uz","vi"],"curLang":"en","curLangpack":"macos"}});</script>
<script id="aj_script">l.add({"WEB_PLURALIZED_LABEL_0":"Zero","WEB_PLURALIZED_LABEL_1":"One","WEB_PLURALIZED_LABEL_2":"Two","WEB_PLURALIZED_LABEL_3":"Few","WEB_PLURALIZED_LABEL_4":"Many","WEB_PLURALIZED_LABEL_5":"Other","WEB_NO_TRANSLATIONS_FOUND":"No translations found","WEB_TRANSLATIONS_LOADING":"Loading","WEB_ACTIVATE_LANGPACK_CONFIRM_TEXT":"Do you want to begin translating <b>{lang_pack}<\/b> to <b>{lang}<\/b>?","WEB_ACTIVATE_LANGPACK_CONFIRM_BUTTON":"Start Translating","WEB_LOADING":"Loading","WEB_NO_LANGUAGES_FOUND":"No languages found"});
Search.init();
Header.init();
Nav.init();
Aj.onLoad(function(state) {
function requestConfirmation(event) {
event && event.preventDefault();
var phone = $('#login-phone').val();
$.ajax({
type: 'POST',
url: '/auth/request',
data: {
phone: phone
},
success: function(result) {
$('#login-phone-field').text(phone);
$('#send-form').addClass('hide');
$('#login-form').removeClass('hide');
checkAuth(result.temp_session);
},
error: function(xhr) {
showAlert(xhr.responseText || 'Server error');
},
dataType: 'json'
});
return false;
}
function cancelConfirmation(event) {
event && event.preventDefault();
$('#login-phone-field').text('');
$('#send-form').removeClass('hide');
$('#login-form').addClass('hide');
$('#login-phone').focus();
clearTimeout(window.authTimeout);
return false;
}
function checkAuth(temp_session) {
clearTimeout(window.authTimeout);
window.authTimeout = setTimeout(function doCheckAuth() {
$.ajax({
type: 'POST',
url: '/auth/login',
data: {
temp_session: temp_session
},
success: function(result) {
if (result) {
location.reload();
} else {
checkAuth(temp_session);
}
},
error: function (xhr) {
showAlert(xhr.responseText || 'Server error');
},
dataType: 'json'
});
}, 700);
}
$('#login-popup-container').on('popup:open', function() {
$('#login-phone').focus();
});
$('#login-popup-container').on('popup:close', function() {
cancelConfirmation();
if (location.pathname == '/auth') {
window.history && history.replaceState(null, null, '/');
}
});
$('#login-popup-container #send-form').on('submit', requestConfirmation);
$('#login-popup-container .login-cancel-btn').on('click', function(e) {
e.preventDefault();
closePopup('#login-popup-container');
});
$('#login-popup-container .login-back').on('click', cancelConfirmation);
$('header .login-link').on('click', function(e) {
e.stopImmediatePropagation();
e.preventDefault();
openPopup('#login-popup-container');
});
});
Aj.onUnload(function(state) {
$('#login-popup-container').off('popup:open');
$('#login-popup-container').off('popup:close');
$('#login-popup-container #send-form').off('submit');
$('#login-popup-container .login-cancel-btn').off('click');
$('#login-popup-container .login-back').off('click');
$('header .login-link').off('click');
});
</script>
<script>Aj.pageLoaded();</script>
</body>
</html>