From 13f8dd92798cc446e10c76641dc7a5595b968e39 Mon Sep 17 00:00:00 2001 From: GitHub Action Date: Mon, 22 Jul 2024 17:48:13 +0000 Subject: [PATCH] Update content of files --- data/web/corefork.telegram.org/api/peers.html | 2 +- data/web/corefork.telegram.org/constructor/channel.html | 4 ++-- data/web/corefork.telegram.org/constructor/chat.html | 2 +- data/web/corefork.telegram.org/constructor/user.html | 4 ++-- data/web/corefork.telegram.org/type/InputChannel.html | 6 ++---- data/web/corefork.telegram.org/type/InputUser.html | 7 +++++-- 6 files changed, 13 insertions(+), 12 deletions(-) diff --git a/data/web/corefork.telegram.org/api/peers.html b/data/web/corefork.telegram.org/api/peers.html index 0a082938ec..e1e865d749 100644 --- a/data/web/corefork.telegram.org/api/peers.html +++ b/data/web/corefork.telegram.org/api/peers.html @@ -46,7 +46,7 @@

Many constructors in the API need to be stored in a local database upon reception and should only ever be updated reactively (passively) when received via updates or by other means (as specified in the documentation), to avoid overloading the server by continuously requesting changes for the same unchanged information.

user, chat, channel constructors and their full counterparts userFull, chatFull, channelFull are especially important, because they contain important information about users, bots, chats and channels (from now on, peers), and most importantly the access_hash value, required to interact with peers in the API.

-

This page describes exactly how and when should the local databases of the constructors listed above be refreshed.

+

This page describes exactly how and when should the local databases of the constructors listed above be refreshed, and contains a more detailed description of basic peer-related concepts.

For simplicity, the documentation often uses the term "cache" instead of "database" when referring to the peer database, however note that the peer database is not an ephemeral cache: peer information (or at the very least the id+access hash) must be persisted to a database and never deleted, to avoid losing access to the API, which requires the locally stored access hash to call methods.

diff --git a/data/web/corefork.telegram.org/constructor/channel.html b/data/web/corefork.telegram.org/constructor/channel.html index f9752b4b3b..e394dbdcb4 100644 --- a/data/web/corefork.telegram.org/constructor/channel.html +++ b/data/web/corefork.telegram.org/constructor/channel.html @@ -194,12 +194,12 @@ id long -ID of the channel +ID of the channel, see here » for more info access_hash flags.13?long -Access hash +Access hash, see here » for more info title diff --git a/data/web/corefork.telegram.org/constructor/chat.html b/data/web/corefork.telegram.org/constructor/chat.html index 494d42e052..6b58d8ffc3 100644 --- a/data/web/corefork.telegram.org/constructor/chat.html +++ b/data/web/corefork.telegram.org/constructor/chat.html @@ -104,7 +104,7 @@ id long -ID of the group +ID of the group, see here » for more info title diff --git a/data/web/corefork.telegram.org/constructor/user.html b/data/web/corefork.telegram.org/constructor/user.html index 52341f9c65..b62fac408b 100644 --- a/data/web/corefork.telegram.org/constructor/user.html +++ b/data/web/corefork.telegram.org/constructor/user.html @@ -201,12 +201,12 @@ id long -ID of the user +ID of the user, see here » for more info. access_hash flags.0?long -Access hash of the user.
If this flag is set, when updating the local peer database, generate a virtual flag called min_access_hash, which is:
- Set to true if min is set AND
   - The phone flag is not set OR
   - The phone flag is set and the associated phone number string is non-empty
- Set to false otherwise.

Then, apply both access_hash and min_access_hash to the local database if:
- min_access_hash is false OR
- min_access_hash is true AND
   - There is no locally cached object for this user OR
   - There is no access_hash in the local cache OR
   - The cached object's min_access_hash is also true
If the final merged object stored to the database has the min_access_hash field set to true, the related access_hash is only suitable to use in inputPeerPhotoFileLocation », to directly download the profile pictures of users, everywhere else a inputPeer*FromMessage constructor will have to be generated as specified here ».
Bots can also use min access hashes in some conditions, by passing 0 instead of the min access hash. +Access hash of the user, see here » for more info.
If this flag is set, when updating the local peer database, generate a virtual flag called min_access_hash, which is:
- Set to true if min is set AND
   - The phone flag is not set OR
   - The phone flag is set and the associated phone number string is non-empty
- Set to false otherwise.

Then, apply both access_hash and min_access_hash to the local database if:
- min_access_hash is false OR
- min_access_hash is true AND
   - There is no locally cached object for this user OR
   - There is no access_hash in the local cache OR
   - The cached object's min_access_hash is also true
If the final merged object stored to the database has the min_access_hash field set to true, the related access_hash is only suitable to use in inputPeerPhotoFileLocation », to directly download the profile pictures of users, everywhere else a inputPeer*FromMessage constructor will have to be generated as specified here ».
Bots can also use min access hashes in some conditions, by passing 0 instead of the min access hash. first_name diff --git a/data/web/corefork.telegram.org/type/InputChannel.html b/data/web/corefork.telegram.org/type/InputChannel.html index 2b84a7c8a5..0b28557c32 100644 --- a/data/web/corefork.telegram.org/type/InputChannel.html +++ b/data/web/corefork.telegram.org/type/InputChannel.html @@ -39,7 +39,7 @@
- +

InputChannel

Represents a channel

@@ -55,9 +55,7 @@
-
inputChannelEmpty#ee8c1e86 = InputChannel;
-inputChannel#f35aec28 channel_id:long access_hash:long = InputChannel;
-inputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel;

+

Constructors

diff --git a/data/web/corefork.telegram.org/type/InputUser.html b/data/web/corefork.telegram.org/type/InputUser.html index c711ece3c5..c1f957b10e 100644 --- a/data/web/corefork.telegram.org/type/InputUser.html +++ b/data/web/corefork.telegram.org/type/InputUser.html @@ -39,7 +39,7 @@
- +

InputUser

Defines a user for subsequent interaction.

@@ -55,7 +55,10 @@
-

+
inputUserEmpty#b98886cf = InputUser;
+inputUserSelf#f7c1b13f = InputUser;
+inputUser#f21158c6 user_id:long access_hash:long = InputUser;
+inputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;

Constructors