Merge remote-tracking branch 'td/master'

This commit is contained in:
Andrea Cavalli 2021-09-25 19:24:57 +02:00
commit 897d4af16c
190 changed files with 5185 additions and 2980 deletions

View File

@ -48,9 +48,9 @@ endif (CMAKE_UNAME)
# Force the compilers to gcc for iOS
set (CMAKE_C_COMPILER /usr/bin/gcc)
set (CMAKE_CXX_COMPILER /usr/bin/g++)
set(CMAKE_AR ar CACHE FILEPATH "" FORCE)
set(CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
set(PKG_CONFIG_EXECUTABLE pkg-config CACHE FILEPATH "" FORCE)
set (CMAKE_AR ar CACHE FILEPATH "" FORCE)
set (CMAKE_RANLIB ranlib CACHE FILEPATH "" FORCE)
set (PKG_CONFIG_EXECUTABLE pkg-config CACHE FILEPATH "" FORCE)
# Setup iOS platform unless specified manually with IOS_PLATFORM
if (NOT DEFINED IOS_PLATFORM)

View File

@ -6,7 +6,7 @@ if (POLICY CMP0065)
cmake_policy(SET CMP0065 NEW)
endif()
project(TDLib VERSION 1.7.7 LANGUAGES CXX C)
project(TDLib VERSION 1.7.8 LANGUAGES CXX C)
if (NOT DEFINED CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH "")
@ -41,7 +41,6 @@ prevent_in_source_build()
option(TD_ENABLE_JNI "Use \"ON\" to enable JNI-compatible TDLib API.")
option(TD_ENABLE_DOTNET "Use \"ON\" to enable generation of C++/CLI or C++/CX TDLib API bindings.")
option(TD_EXPERIMENTAL_WATCH_OS "Use \"ON\" to enable watch os support.")
if (TD_ENABLE_DOTNET AND (CMAKE_VERSION VERSION_LESS "3.1.0"))
message(FATAL_ERROR "CMake 3.1.0 or higher is required. You are running version ${CMAKE_VERSION}.")
@ -262,6 +261,7 @@ set(TL_DOTNET_SCHEME_SOURCE
set(TDLIB_SOURCE
td/mtproto/AuthData.cpp
td/mtproto/ConnectionManager.cpp
td/mtproto/DhHandshake.cpp
td/mtproto/Handshake.cpp
td/mtproto/HandshakeActor.cpp
@ -295,6 +295,7 @@ set(TDLIB_SOURCE
td/telegram/ClientActor.cpp
td/telegram/ConfigManager.cpp
td/telegram/ConfigShared.cpp
td/telegram/ConnectionState.cpp
td/telegram/Contact.cpp
td/telegram/ContactsManager.cpp
td/telegram/CountryInfoManager.cpp
@ -426,6 +427,7 @@ set(TDLIB_SOURCE
td/mtproto/AuthData.h
td/mtproto/AuthKey.h
td/mtproto/ConnectionManager.h
td/mtproto/CryptoStorer.h
td/mtproto/DhCallback.h
td/mtproto/DhHandshake.h
@ -472,6 +474,7 @@ set(TDLIB_SOURCE
td/telegram/ClientActor.h
td/telegram/ConfigManager.h
td/telegram/ConfigShared.h
td/telegram/ConnectionState.h
td/telegram/Contact.h
td/telegram/ContactsManager.h
td/telegram/CountryInfoManager.h

View File

@ -176,7 +176,7 @@ target_link_libraries(YourTarget PRIVATE Td::TdStatic)
Or you could install `TDLib` and then reference it in your CMakeLists.txt like this:
```
find_package(Td 1.7.7 REQUIRED)
find_package(Td 1.7.8 REQUIRED)
target_link_libraries(YourTarget PRIVATE Td::TdStatic)
```
See [example/cpp/CMakeLists.txt](https://github.com/tdlib/td/tree/master/example/cpp/CMakeLists.txt).

View File

@ -4,12 +4,11 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/utils/benchmark.h"
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/benchmark.h"
#include "td/utils/common.h"
#include "td/utils/crypto.h"
#include "td/utils/logging.h"

View File

@ -4,9 +4,6 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/db/binlog/Binlog.h"
#include "td/db/binlog/ConcurrentBinlog.h"
#include "td/db/BinlogKeyValue.h"
@ -17,6 +14,9 @@
#include "td/db/SqliteKeyValueAsync.h"
#include "td/db/SqliteKeyValueSafe.h"
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/utils/benchmark.h"
#include "td/utils/common.h"
#include "td/utils/format.h"
@ -98,10 +98,9 @@ class SqliteKVBench final : public td::Benchmark {
td::string path = "testdb.sqlite";
td::SqliteDb::destroy(path).ignore();
if (is_encrypted) {
td::SqliteDb::change_key(path, td::DbKey::password("cucumber"), td::DbKey::empty()).ensure();
db = td::SqliteDb::open_with_key(path, td::DbKey::password("cucumber")).move_as_ok();
db = td::SqliteDb::change_key(path, true, td::DbKey::password("cucumber"), td::DbKey::empty()).move_as_ok();
} else {
db = td::SqliteDb::open_with_key(path, td::DbKey::empty()).move_as_ok();
db = td::SqliteDb::open_with_key(path, true, td::DbKey::empty()).move_as_ok();
}
db.exec("PRAGMA encoding=\"UTF-8\"").ensure();
db.exec("PRAGMA synchronous=NORMAL").ensure();
@ -188,7 +187,7 @@ class SqliteKeyValueAsyncBench final : public td::Benchmark {
td::string sql_db_name = "testdb.sqlite";
td::SqliteDb::destroy(sql_db_name).ignore();
sql_connection_ = std::make_shared<td::SqliteConnectionSafe>(sql_db_name);
sql_connection_ = std::make_shared<td::SqliteConnectionSafe>(sql_db_name, td::DbKey::empty());
auto &db = sql_connection_->get();
TRY_STATUS(init_db(db));

View File

@ -4,12 +4,11 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/utils/benchmark.h"
#include "td/mtproto/DhCallback.h"
#include "td/mtproto/DhHandshake.h"
#include "td/utils/base64.h"
#include "td/utils/benchmark.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"

View File

@ -4,13 +4,13 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/net/HttpOutboundConnection.h"
#include "td/net/HttpQuery.h"
#include "td/net/SslStream.h"
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/utils/buffer.h"
#include "td/utils/logging.h"
#include "td/utils/port/IPAddress.h"

View File

@ -4,14 +4,14 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/net/HttpHeaderCreator.h"
#include "td/net/HttpInboundConnection.h"
#include "td/net/HttpQuery.h"
#include "td/net/TcpListener.h"
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/utils/buffer.h"
#include "td/utils/logging.h"
#include "td/utils/port/SocketFd.h"

View File

@ -4,13 +4,13 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/net/HttpHeaderCreator.h"
#include "td/net/HttpInboundConnection.h"
#include "td/net/TcpListener.h"
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/utils/buffer.h"
#include "td/utils/logging.h"
#include "td/utils/port/detail/PollableFd.h"

View File

@ -4,14 +4,14 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/net/HttpHeaderCreator.h"
#include "td/net/HttpQuery.h"
#include "td/net/HttpReader.h"
#include "td/net/TcpListener.h"
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/utils/buffer.h"
#include "td/utils/BufferedFd.h"
#include "td/utils/logging.h"

View File

@ -4,6 +4,9 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/telegram/telegram_api.h"
#include "td/telegram/telegram_api.hpp"
#include "td/utils/benchmark.h"
#include "td/utils/common.h"
#include "td/utils/format.h"
@ -20,9 +23,6 @@
#include "td/utils/Status.h"
#include "td/utils/ThreadSafeCounter.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/telegram_api.hpp"
#if !TD_WINDOWS
#include <unistd.h>
#include <utime.h>

View File

@ -11,12 +11,12 @@
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/UserId.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/actor/PromiseFuture.h"
#include "td/db/SqliteConnectionSafe.h"
#include "td/db/SqliteDb.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/benchmark.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"
@ -50,12 +50,12 @@ class MessagesDbBench final : public Benchmark {
void run(int n) final {
auto guard = scheduler_->get_main_guard();
for (int i = 0; i < n; i += 20) {
auto dialog_id = DialogId{UserId{Random::fast(1, 100)}};
auto dialog_id = DialogId(UserId(static_cast<int64>(Random::fast(1, 100))));
auto message_id_raw = Random::fast(1, 100000);
for (int j = 0; j < 20; j++) {
auto message_id = MessageId{ServerMessageId{message_id_raw + j}};
auto unique_message_id = ServerMessageId{i + 1};
auto sender_user_id = UserId{Random::fast(1, 1000)};
auto sender_user_id = UserId(static_cast<int64>(Random::fast(1, 1000)));
auto random_id = i + 1;
auto ttl_expires_at = 0;
auto data = BufferSlice(Random::fast(100, 299));
@ -94,7 +94,7 @@ class MessagesDbBench final : public Benchmark {
auto guard = scheduler_->get_main_guard();
string sql_db_name = "testdb.sqlite";
sql_connection_ = std::make_shared<SqliteConnectionSafe>(sql_db_name);
sql_connection_ = std::make_shared<SqliteConnectionSafe>(sql_db_name, DbKey::empty());
auto &db = sql_connection_->get();
TRY_STATUS(init_db(db));

View File

@ -4,13 +4,13 @@
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/net/HttpQuery.h"
#include "td/net/Wget.h"
#include "td/actor/actor.h"
#include "td/actor/ConcurrentScheduler.h"
#include "td/actor/PromiseFuture.h"
#include "td/net/HttpQuery.h"
#include "td/net/Wget.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Status.h"

View File

@ -725,7 +725,7 @@ function onOptionsChanged() {
commands.push('cd vcpkg');
commands.push(local + 'bootstrap-vcpkg.bat');
if (target === 'C++/CX') {
commands.push(local + 'vcpkg.exe install gperf:x86-windows openssl-uwp:arm-uwp openssl-uwp:x64-uwp openssl-uwp:x86-uwp zlib:arm-uwp zlib:x64-uwp zlib:x86-uwp');
commands.push(local + 'vcpkg.exe install gperf:x86-windows openssl:arm-uwp openssl:arm64-uwp openssl:x64-uwp openssl:x86-uwp zlib:arm-uwp zlib:arm64-uwp zlib:x64-uwp zlib:x86-uwp');
} else {
if (build_64bit) {
commands.push(local + 'vcpkg.exe install gperf:x64-windows openssl:x64-windows zlib:x64-windows');
@ -774,7 +774,7 @@ function onOptionsChanged() {
break;
}
commands.push('powershell -ExecutionPolicy ByPass ' + local + 'build.ps1 -mode clean');
commands.push('powershell -ExecutionPolicy ByPass ' + local + 'build.ps1 -vcpkg_root ../../vcpkg -mode clean');
commands.push('powershell -ExecutionPolicy ByPass ' + local + 'build.ps1 -vcpkg_root ../../vcpkg' + archiver_option);
if (install_dir) {
commands.push('cp build-uwp/vsix/tdlib.vsix ' + install_dir);

View File

@ -179,6 +179,8 @@ See [rtdlib](https://github.com/fewensa/rtdlib), [tdlib-rs](https://github.com/d
[tdlib-sys](https://github.com/nuxeh/tdlib-sys), or
[tdjson-rs](https://github.com/mersinvald/tdjson-rs) for examples of TDLib Rust bindings.
Also see [Telegrand](https://github.com/melix99/telegrand) a Telegram client optimized for the GNOME desktop.
<a name="erlang"></a>
## Using TDLib in Erlang projects

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(TdExample VERSION 1.0 LANGUAGES CXX)
find_package(Td 1.7.7 REQUIRED)
find_package(Td 1.7.8 REQUIRED)
add_executable(tdjson_example tdjson_example.cpp)
target_link_libraries(tdjson_example PRIVATE Td::TdJson)

View File

@ -142,7 +142,7 @@ class TdExample {
std::map<std::uint64_t, std::function<void(Object)>> handlers_;
std::map<std::int32_t, td_api::object_ptr<td_api::user>> users_;
std::map<std::int64_t, td_api::object_ptr<td_api::user>> users_;
std::map<std::int64_t, std::string> chat_title_;
@ -174,7 +174,7 @@ class TdExample {
}
}
std::string get_user_name(std::int32_t user_id) const {
std::string get_user_name(std::int64_t user_id) const {
auto it = users_.find(user_id);
if (it == users_.end()) {
return "unknown user";

View File

@ -36,10 +36,8 @@ do
if [[ $platform = "macOS" ]]; then
other_options="-DCMAKE_OSX_ARCHITECTURES='x86_64;arm64'"
else
watchos=""
if [[ $platform = "watchOS" ]]; then
ios_platform="WATCH"
watchos="-DTD_EXPERIMENTAL_WATCH_OS=ON"
elif [[ $platform = "tvOS" ]]; then
ios_platform="TV"
else
@ -54,7 +52,7 @@ do
fi
echo "iOS platform = ${ios_platform}"
other_options="${watchos} -DIOS_PLATFORM=${ios_platform} -DCMAKE_TOOLCHAIN_FILE=${td_path}/CMake/iOS.cmake"
other_options="-DIOS_PLATFORM=${ios_platform} -DCMAKE_TOOLCHAIN_FILE=${td_path}/CMake/iOS.cmake"
fi
set_cmake_options $platform

View File

@ -37,18 +37,18 @@ public final class Example {
private static final Lock authorizationLock = new ReentrantLock();
private static final Condition gotAuthorization = authorizationLock.newCondition();
private static final ConcurrentMap<Integer, TdApi.User> users = new ConcurrentHashMap<Integer, TdApi.User>();
private static final ConcurrentMap<Integer, TdApi.BasicGroup> basicGroups = new ConcurrentHashMap<Integer, TdApi.BasicGroup>();
private static final ConcurrentMap<Integer, TdApi.Supergroup> supergroups = new ConcurrentHashMap<Integer, TdApi.Supergroup>();
private static final ConcurrentMap<Long, TdApi.User> users = new ConcurrentHashMap<Long, TdApi.User>();
private static final ConcurrentMap<Long, TdApi.BasicGroup> basicGroups = new ConcurrentHashMap<Long, TdApi.BasicGroup>();
private static final ConcurrentMap<Long, TdApi.Supergroup> supergroups = new ConcurrentHashMap<Long, TdApi.Supergroup>();
private static final ConcurrentMap<Integer, TdApi.SecretChat> secretChats = new ConcurrentHashMap<Integer, TdApi.SecretChat>();
private static final ConcurrentMap<Long, TdApi.Chat> chats = new ConcurrentHashMap<Long, TdApi.Chat>();
private static final NavigableSet<OrderedChat> mainChatList = new TreeSet<OrderedChat>();
private static boolean haveFullMainChatList = false;
private static final ConcurrentMap<Integer, TdApi.UserFullInfo> usersFullInfo = new ConcurrentHashMap<Integer, TdApi.UserFullInfo>();
private static final ConcurrentMap<Integer, TdApi.BasicGroupFullInfo> basicGroupsFullInfo = new ConcurrentHashMap<Integer, TdApi.BasicGroupFullInfo>();
private static final ConcurrentMap<Integer, TdApi.SupergroupFullInfo> supergroupsFullInfo = new ConcurrentHashMap<Integer, TdApi.SupergroupFullInfo>();
private static final ConcurrentMap<Long, TdApi.UserFullInfo> usersFullInfo = new ConcurrentHashMap<Long, TdApi.UserFullInfo>();
private static final ConcurrentMap<Long, TdApi.BasicGroupFullInfo> basicGroupsFullInfo = new ConcurrentHashMap<Long, TdApi.BasicGroupFullInfo>();
private static final ConcurrentMap<Long, TdApi.SupergroupFullInfo> supergroupsFullInfo = new ConcurrentHashMap<Long, TdApi.SupergroupFullInfo>();
private static final String newLine = System.getProperty("line.separator");
private static final String commandsLine = "Enter command (gcs - GetChats, gc <chatId> - GetChat, me - GetMe, sm <chatId> <message> - SendMessage, lo - LogOut, q - Quit): ";

View File

@ -10,7 +10,7 @@ This is an example of building TDLib SDK for Universal Windows Platform and an e
* Install `zlib` and `openssl` for all UWP architectures and `gperf` for x86 using `vcpkg`:
```
cd <path to vcpkg>
.\vcpkg.exe install gperf:x86-windows openssl-uwp:arm-uwp openssl-uwp:x64-uwp openssl-uwp:x86-uwp zlib:arm-uwp zlib:x64-uwp zlib:x86-uwp
.\vcpkg.exe install gperf:x86-windows openssl:arm-uwp openssl:arm64-uwp openssl:x64-uwp openssl:x86-uwp zlib:arm-uwp zlib:arm64-uwp zlib:x64-uwp zlib:x86-uwp
```
* (Optional. For XML documentation generation.) Download [PHP](https://windows.php.net/download#php-7.2). Add the path to php.exe to the PATH environment variable.
* Download and install [7-Zip](http://www.7-zip.org/download.html) archiver, which is used by the `build.ps1` script to create a Telegram.Td.UWP Visual Studio Extension. Add the path to 7z.exe to the PATH environment variable.
@ -19,7 +19,7 @@ cd <path to vcpkg>
```
powershell -ExecutionPolicy ByPass .\build.ps1 -vcpkg_root C:\vcpkg
```
If you need to restart the build from scratch, call `.\build.ps1 -mode clean` first.
If you need to restart the build from scratch, call `.\build.ps1 -vcpkg_root ../../vcpkg -mode clean` first.
* Install Visual Studio Extension "TDLib for Universal Windows Platform" located at `build-uwp\vsix\tdlib.vsix`, which was created on the previous step by `build.ps1` script.
Now `TDLib` can be used from any UWP project, built in Visual Studio.

View File

@ -1,6 +1,6 @@
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011">
<Metadata>
<Identity Id="Telegram.Td.UWP" Version="1.7.7" Language="en-US" Publisher="Telegram LLC" />
<Identity Id="Telegram.Td.UWP" Version="1.7.8" Language="en-US" Publisher="Telegram LLC" />
<DisplayName>TDLib for Universal Windows Platform</DisplayName>
<Description>TDLib is a library for building Telegram clients</Description>
<MoreInfo>https://core.telegram.org/tdlib</MoreInfo>

View File

@ -32,14 +32,21 @@ if (WIN32)
endif()
target_compile_definitions(tdsqlite PRIVATE
-DOMIT_MEMLOCK
-DSQLITE_DEFAULT_MEMSTATUS=0
-DSQLITE_OMIT_LOAD_EXTENSION
-DSQLITE_DEFAULT_RECURSIVE_TRIGGERS=1
-DSQLITE_DEFAULT_SYNCHRONOUS=1
-DSQLITE_DISABLE_LFS
-DSQLITE_ENABLE_FTS5
-DSQLITE_HAS_CODEC
-DSQLITE_OMIT_DECLTYPE
-DSQLITE_OMIT_PROGRESS_CALLBACK
-DSQLITE_OMIT_DEPRECATED
-DSQLITE_OMIT_DESERIALIZE
-DSQLITE_OMIT_LOAD_EXTENSION
-DSQLITE_OMIT_PROGRESS_CALLBACK
#-DSQLITE_OMIT_SHARED_CACHE
-DSQLITE_TEMP_STORE=2
)
target_compile_definitions(tdsqlite PRIVATE -DSQLITE_HAS_CODEC -DSQLITE_TEMP_STORE=2 -DSQLITE_ENABLE_FTS5 -DSQLITE_DISABLE_LFS -DOMIT_MEMLOCK)
if (NOT WIN32)
target_compile_definitions(tdsqlite PRIVATE -DHAVE_USLEEP -DNDEBUG=1)

View File

@ -295,7 +295,7 @@ videoNote duration:int32 length:int32 minithumbnail:minithumbnail thumbnail:thum
voiceNote duration:int32 waveform:bytes mime_type:string voice:file = VoiceNote;
//@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0
contact phone_number:string first_name:string last_name:string vcard:string user_id:int32 = Contact;
contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact;
//@description Describes a location on planet Earth @latitude Latitude of the location in degrees; as defined by the sender @longitude Longitude of the location, in degrees; as defined by the sender
//@horizontal_accuracy The estimated horizontal accuracy of the location, in meters; as defined by the sender. 0 if unknown
@ -313,7 +313,7 @@ game id:int64 short_name:string title:string text:formattedText description:stri
//@total_voter_count Total number of voters, participating in the poll @recent_voter_user_ids User identifiers of recent voters, if the poll is non-anonymous
//@is_anonymous True, if the poll is anonymous @type Type of the poll
//@open_period Amount of time the poll will be active after creation, in seconds @close_date Point in time (Unix timestamp) when the poll will be automatically closed @is_closed True, if the poll is closed
poll id:int64 question:string options:vector<pollOption> total_voter_count:int32 recent_voter_user_ids:vector<int32> is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll;
poll id:int64 question:string options:vector<pollOption> total_voter_count:int32 recent_voter_user_ids:vector<int53> is_anonymous:Bool type:PollType open_period:int32 close_date:int32 is_closed:Bool = Poll;
//@description Describes a user profile photo @id Photo identifier; 0 for an empty photo. Can be used to find a photo in a list of user profile photos
@ -366,7 +366,7 @@ accessHash chat_id:int53 type:AccessHashType access_hash:int64 = AccessHash;
botCommand command:string description:string = BotCommand;
//@description Contains a list of bot commands @bot_user_id Bot's user identifier @commands List of bot commands
botCommands bot_user_id:int32 commands:vector<botCommand> = BotCommands;
botCommands bot_user_id:int53 commands:vector<botCommand> = BotCommands;
//@description Represents a location to which a chat is connected @location The location @address Location address; 1-64 characters, as defined by the chat owner
@ -424,7 +424,7 @@ inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputC
//@have_access If false, the user is inaccessible, and the only information known about the user is inside this class. It can't be passed to any method except GetUser
//@type Type of the user
//@language_code IETF language tag of the user's language; only available to bots
user id:int32 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string = User;
user id:int53 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string = User;
//@description Contains full information about a user
//@photo User profile photo; may be null
@ -441,11 +441,11 @@ user id:int32 first_name:string last_name:string username:string phone_number:st
userFullInfo photo:chatPhoto is_blocked:Bool can_be_called:Bool supports_video_calls:Bool has_private_calls:Bool need_phone_number_privacy_exception:Bool bio:string share_text:string description:string group_in_common_count:int32 commands:vector<botCommand> = UserFullInfo;
//@description Represents a list of users @total_count Approximate total count of users found @user_ids A list of user identifiers
users total_count:int32 user_ids:vector<int32> = Users;
users total_count:int32 user_ids:vector<int53> = Users;
//@description Contains information about a chat administrator @user_id User identifier of the administrator @custom_title Custom title of the administrator @is_owner True, if the user is the owner of the chat
chatAdministrator user_id:int32 custom_title:string is_owner:Bool = ChatAdministrator;
chatAdministrator user_id:int53 custom_title:string is_owner:Bool = ChatAdministrator;
//@description Represents a list of chat administrators @administrators A list of chat administrators
chatAdministrators administrators:vector<chatAdministrator> = ChatAdministrators;
@ -509,7 +509,7 @@ chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus;
//@inviter_user_id Identifier of a user that invited/promoted/banned this member in the chat; 0 if unknown
//@joined_chat_date Point in time (Unix timestamp) when the user joined the chat
//@status Status of the member in the chat
chatMember member_id:MessageSender inviter_user_id:int32 joined_chat_date:int32 status:ChatMemberStatus = ChatMember;
chatMember member_id:MessageSender inviter_user_id:int53 joined_chat_date:int32 status:ChatMemberStatus = ChatMember;
//@description Contains a list of chat members @total_count Approximate total count of chat members found @members A list of chat members
chatMembers total_count:int32 members:vector<chatMember> = ChatMembers;
@ -574,7 +574,7 @@ supergroupMembersFilterBots = SupergroupMembersFilter;
//@member_count Number of chat members, which joined the chat using the link
//@is_primary True, if the link is primary. Primary invite link can't have expire date or usage limit. There is exactly one primary invite link for each administrator with can_invite_users right at a given time
//@is_revoked True, if the link was revoked
chatInviteLink invite_link:string creator_user_id:int32 date:int32 edit_date:int32 expire_date:int32 member_limit:int32 member_count:int32 is_primary:Bool is_revoked:Bool = ChatInviteLink;
chatInviteLink invite_link:string creator_user_id:int53 date:int32 edit_date:int32 expire_date:int32 member_limit:int32 member_count:int32 is_primary:Bool is_revoked:Bool = ChatInviteLink;
//@description Contains a list of chat invite links @total_count Approximate total count of chat invite links found @invite_links List of invite links
chatInviteLinks total_count:int32 invite_links:vector<chatInviteLink> = ChatInviteLinks;
@ -583,13 +583,13 @@ chatInviteLinks total_count:int32 invite_links:vector<chatInviteLink> = ChatInvi
//@user_id Administrator's user identifier
//@invite_link_count Number of active invite links
//@revoked_invite_link_count Number of revoked invite links
chatInviteLinkCount user_id:int32 invite_link_count:int32 revoked_invite_link_count:int32 = ChatInviteLinkCount;
chatInviteLinkCount user_id:int53 invite_link_count:int32 revoked_invite_link_count:int32 = ChatInviteLinkCount;
//@description Contains a list of chat invite link counts @invite_link_counts List of invite linkcounts
chatInviteLinkCounts invite_link_counts:vector<chatInviteLinkCount> = ChatInviteLinkCounts;
//@description Describes a chat member joined a chat by an invite link @user_id User identifier @joined_chat_date Point in time (Unix timestamp) when the user joined the chat
chatInviteLinkMember user_id:int32 joined_chat_date:int32 = ChatInviteLinkMember;
chatInviteLinkMember user_id:int53 joined_chat_date:int32 = ChatInviteLinkMember;
//@description Contains a list of chat members joined a chat by an invite link @total_count Approximate total count of chat members found @members List of chat members, joined a chat by an invite link
chatInviteLinkMembers total_count:int32 members:vector<chatInviteLinkMember> = ChatInviteLinkMembers;
@ -603,7 +603,7 @@ chatInviteLinkMembers total_count:int32 members:vector<chatInviteLinkMember> = C
//@member_count Number of members in the chat
//@member_user_ids User identifiers of some chat members that may be known to the current user
//@is_public True, if the chat is a public supergroup or channel, i.e. it has a username or it is a location-based supergroup
chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string photo:chatPhotoInfo member_count:int32 member_user_ids:vector<int32> is_public:Bool = ChatInviteLinkInfo;
chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string photo:chatPhotoInfo member_count:int32 member_user_ids:vector<int53> is_public:Bool = ChatInviteLinkInfo;
//@description Represents a basic group of 0-200 users (must be upgraded to a supergroup to accommodate more than 200 users)
@ -612,7 +612,7 @@ chatInviteLinkInfo chat_id:int53 accessible_for:int32 type:ChatType title:string
//@status Status of the current user in the group
//@is_active True, if the group is active
//@upgraded_to_supergroup_id Identifier of the supergroup to which this group was upgraded; 0 if none
basicGroup id:int32 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int32 = BasicGroup;
basicGroup id:int53 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup;
//@description Contains full information about a basic group
//@photo Chat photo; may be null
@ -621,7 +621,7 @@ basicGroup id:int32 member_count:int32 status:ChatMemberStatus is_active:Bool up
//@members Group members
//@invite_link Primary invite link for this group; may be null. For chat administrators with can_invite_users right only. Updated only after the basic group is opened
//@bot_commands List of commands of bots in the group
basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int32 members:vector<chatMember> invite_link:chatInviteLink bot_commands:vector<botCommands> = BasicGroupFullInfo;
basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 members:vector<chatMember> invite_link:chatInviteLink bot_commands:vector<botCommands> = BasicGroupFullInfo;
//@description Represents a supergroup or channel with zero or more members (subscribers in the case of channels). From the point of view of the system, a channel is a special kind of a supergroup: only administrators can post and see the list of members, and posts from all administrators use the name and photo of the channel instead of individual names and profile photos. Unlike supergroups, channels can have an unlimited number of subscribers
@ -640,7 +640,7 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int32 memb
//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this supergroup or channel must be restricted
//@is_scam True, if many users reported this supergroup or channel as a scam
//@is_fake True, if many users reported this supergroup or channel as a fake account
supergroup id:int32 username:string date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup;
supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup;
//@description Contains full information about a supergroup or channel
//@photo Chat photo; may be null
@ -664,7 +664,7 @@ supergroup id:int32 username:string date:int32 status:ChatMemberStatus member_co
//@bot_commands List of commands of bots in the group
//@upgraded_from_basic_group_id Identifier of the basic group from which supergroup was upgraded; 0 if none
//@upgraded_from_max_message_id Identifier of the last message in the basic group from which supergroup was upgraded; 0 if none
supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool is_all_history_available:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> upgraded_from_basic_group_id:int32 upgraded_from_max_message_id:int53 = SupergroupFullInfo;
supergroupFullInfo photo:chatPhoto description:string member_count:int32 administrator_count:int32 restricted_count:int32 banned_count:int32 linked_chat_id:int53 slow_mode_delay:int32 slow_mode_delay_expires_in:double can_get_members:Bool can_set_username:Bool can_set_sticker_set:Bool can_set_location:Bool can_get_statistics:Bool is_all_history_available:Bool sticker_set_id:int64 location:chatLocation invite_link:chatInviteLink bot_commands:vector<botCommands> upgraded_from_basic_group_id:int53 upgraded_from_max_message_id:int53 = SupergroupFullInfo;
//@class SecretChatState @description Describes the current secret chat state
@ -687,13 +687,13 @@ secretChatStateClosed = SecretChatState;
//@key_hash Hash of the currently used key for comparison with the hash of the chat partner's key. This is a string of 36 little-endian bytes, which must be split into groups of 2 bits, each denoting a pixel of one of 4 colors FFFFFF, D5E6F3, 2D5775, and 2F99C9.
//-The pixels must be used to make a 12x12 square image filled from left to right, top to bottom. Alternatively, the first 32 bytes of the hash can be converted to the hexadecimal format and printed as 32 2-digit hex numbers
//@layer Secret chat layer; determines features supported by the chat partner's application. Nested text entities and underline and strikethrough entities are supported if the layer >= 101
secretChat id:int32 user_id:int32 state:SecretChatState is_outbound:Bool key_hash:bytes layer:int32 = SecretChat;
secretChat id:int32 user_id:int53 state:SecretChatState is_outbound:Bool key_hash:bytes layer:int32 = SecretChat;
//@class MessageSender @description Contains information about the sender of a message
//@description The message was sent by a known user @user_id Identifier of the user that sent the message
messageSenderUser user_id:int32 = MessageSender;
messageSenderUser user_id:int53 = MessageSender;
//@description The message was sent on behalf of a chat @chat_id Identifier of the chat that sent the message
messageSenderChat chat_id:int53 = MessageSender;
@ -706,7 +706,7 @@ messageSenders total_count:int32 senders:vector<MessageSender> = MessageSenders;
//@class MessageForwardOrigin @description Contains information about the origin of a forwarded message
//@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message
messageForwardOriginUser sender_user_id:int32 = MessageForwardOrigin;
messageForwardOriginUser sender_user_id:int53 = MessageForwardOrigin;
//@description The message was originally sent by an anonymous chat administrator on behalf of the chat
//@sender_chat_id Identifier of the chat that originally sent the message
@ -773,6 +773,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool r
//@can_be_deleted_for_all_users True, if the message can be deleted for all users
//@can_get_statistics True, if the message statistics are available
//@can_get_message_thread True, if the message thread info is available
//@can_get_viewers True, if chat members already viewed the message can be received through getMessageViewers
//@can_get_media_timestamp_links True, if media timestamp links can be generated for media timestamp entities in the message text, caption or web page description
//@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message
//@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts
@ -792,7 +793,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool r
//@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted
//@content Content of the message
//@reply_markup Reply markup for the message; may be null
message id:int53 sender:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int32 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message;
message id:int53 sender:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message;
//@description Contains a list of messages @total_count Approximate total count of messages found @messages List of messages; messages may be null
messages total_count:int32 messages:vector<message> = Messages;
@ -848,16 +849,16 @@ draftMessage reply_to_message_id:int53 date:int32 input_message_text:InputMessag
//@class ChatType @description Describes the type of a chat
//@description An ordinary chat with a user @user_id User identifier
chatTypePrivate user_id:int32 = ChatType;
chatTypePrivate user_id:int53 = ChatType;
//@description A basic group (i.e., a chat with 0-200 other users) @basic_group_id Basic group identifier
chatTypeBasicGroup basic_group_id:int32 = ChatType;
//@description A basic group (a chat with 0-200 other users) @basic_group_id Basic group identifier
chatTypeBasicGroup basic_group_id:int53 = ChatType;
//@description A supergroup (i.e. a chat with up to GetOption("supergroup_max_size") other users), or channel (with unlimited members) @supergroup_id Supergroup or channel identifier @is_channel True, if the supergroup is a channel
chatTypeSupergroup supergroup_id:int32 is_channel:Bool = ChatType;
//@description A supergroup or channel (with unlimited members) @supergroup_id Supergroup or channel identifier @is_channel True, if the supergroup is a channel
chatTypeSupergroup supergroup_id:int53 is_channel:Bool = ChatType;
//@description A secret chat with a user @secret_chat_id Secret chat identifier @user_id User identifier of the secret chat peer
chatTypeSecret secret_chat_id:int32 user_id:int32 = ChatType;
chatTypeSecret secret_chat_id:int32 user_id:int53 = ChatType;
//@description Represents a filter of user chats
@ -950,7 +951,7 @@ voiceChat group_call_id:int32 has_participants:Bool default_participant_id:Messa
//@unread_mention_count Number of unread messages with a mention/reply in the chat
//@notification_settings Notification settings for this chat
//@message_ttl_setting Current message Time To Live setting (self-destruct timer) for the chat; 0 if not defined. TTL is counted from the time message or its content is viewed in secret chats and from the send date in other chats
//@theme_name If non-empty, name of a theme set for the chat
//@theme_name If non-empty, name of a theme, set for the chat
//@action_bar Describes actions which should be possible to do through a chat action bar; may be null
//@voice_chat Contains information about voice chat of the chat
//@reply_markup_message_id Identifier of the message from which reply markup needs to be used; 0 if there is no default custom reply markup in the chat
@ -990,7 +991,7 @@ chatActionBarReportUnrelatedLocation = ChatActionBar;
//@description The chat is a recently created group chat, to which new members can be invited
chatActionBarInviteMembers = ChatActionBar;
//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method blockUser, or the other user can be added to the contact list using the method addContact
//@description The chat is a private or secret chat, which can be reported using the method reportChat, or the other user can be blocked using the method toggleMessageSenderIsBlocked, or the other user can be added to the contact list using the method addContact
//@can_unarchive If true, the chat was automatically archived and can be moved back to the main chat list using addChatToList simultaneously with setting chat notification settings to default using setChatNotificationSettings
//@distance If non-negative, the current user was found by the peer through searchChatsNearby and this is the distance between the users
chatActionBarReportAddBlock can_unarchive:Bool distance:int32 = ChatActionBar;
@ -1027,7 +1028,7 @@ keyboardButton text:string type:KeyboardButtonType = KeyboardButton;
inlineKeyboardButtonTypeUrl url:string = InlineKeyboardButtonType;
//@description A button that opens a specified URL and automatically authorize the current user if allowed to do so @url An HTTP URL to open @id Unique button identifier @forward_text If non-empty, new text of the button in forwarded messages
inlineKeyboardButtonTypeLoginUrl url:string id:int32 forward_text:string = InlineKeyboardButtonType;
inlineKeyboardButtonTypeLoginUrl url:string id:int53 forward_text:string = InlineKeyboardButtonType;
//@description A button that sends a callback query to a bot @data Data to be sent to the bot via a callback query
inlineKeyboardButtonTypeCallback data:bytes = InlineKeyboardButtonType;
@ -1080,7 +1081,7 @@ loginUrlInfoOpen url:string skip_confirm:Bool = LoginUrlInfo;
//@description An authorization confirmation dialog needs to be shown to the user @url An HTTP URL to be opened @domain A domain of the URL
//@bot_user_id User identifier of a bot linked with the website @request_write_access True, if the user needs to be requested to give the permission to the bot to send them messages
loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int32 request_write_access:Bool = LoginUrlInfo;
loginUrlInfoRequestConfirmation url:string domain:string bot_user_id:int53 request_write_access:Bool = LoginUrlInfo;
//@description Contains information about a message thread
@ -1400,7 +1401,7 @@ paymentFormTheme background_color:int32 text_color:int32 hint_color:int32 link_c
//@saved_credentials Contains information about saved card credentials; may be null
//@can_save_credentials True, if the user can choose to save credentials
//@need_password True, if the user will be able to save credentials protected by a password they set up
paymentForm id:int64 invoice:invoice url:string seller_bot_user_id:int32 payments_provider_user_id:int32 payments_provider:paymentsProviderStripe saved_order_info:orderInfo saved_credentials:savedCredentials can_save_credentials:Bool need_password:Bool = PaymentForm;
paymentForm id:int64 invoice:invoice url:string seller_bot_user_id:int53 payments_provider_user_id:int53 payments_provider:paymentsProviderStripe saved_order_info:orderInfo saved_credentials:savedCredentials can_save_credentials:Bool need_password:Bool = PaymentForm;
//@description Contains a temporary identifier of validated order information, which is stored for one hour. Also contains the available shipping options @order_info_id Temporary identifier of the order information @shipping_options Available shipping options
validatedOrderInfo order_info_id:string shipping_options:vector<shippingOption> = ValidatedOrderInfo;
@ -1420,7 +1421,7 @@ paymentResult success:Bool verification_url:string = PaymentResult;
//@shipping_option Chosen shipping option; may be null
//@credentials_title Title of the saved credentials chosen by the buyer
//@tip_amount The amount of tip chosen by the buyer in the smallest units of the currency
paymentReceipt title:string description:string photo:photo date:int32 seller_bot_user_id:int32 payments_provider_user_id:int32 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceipt;
paymentReceipt title:string description:string photo:photo date:int32 seller_bot_user_id:int53 payments_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceipt;
//@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded
@ -1752,10 +1753,10 @@ messageVoiceChatStarted group_call_id:int32 = MessageContent;
messageVoiceChatEnded duration:int32 = MessageContent;
//@description A message with information about an invite to a voice chat @group_call_id Identifier of the voice chat. The voice chat can be received through the method getGroupCall @user_ids Invited user identifiers
messageInviteVoiceChatParticipants group_call_id:int32 user_ids:vector<int32> = MessageContent;
messageInviteVoiceChatParticipants group_call_id:int32 user_ids:vector<int53> = MessageContent;
//@description A newly created basic group @title Title of the basic group @member_user_ids User identifiers of members in the basic group
messageBasicGroupChatCreate title:string member_user_ids:vector<int32> = MessageContent;
messageBasicGroupChatCreate title:string member_user_ids:vector<int53> = MessageContent;
//@description A newly created supergroup or channel @title Title of the supergroup or channel
messageSupergroupChatCreate title:string = MessageContent;
@ -1770,19 +1771,19 @@ messageChatChangePhoto photo:chatPhoto = MessageContent;
messageChatDeletePhoto = MessageContent;
//@description New chat members were added @member_user_ids User identifiers of the new members
messageChatAddMembers member_user_ids:vector<int32> = MessageContent;
messageChatAddMembers member_user_ids:vector<int53> = MessageContent;
//@description A new member joined the chat by invite link
messageChatJoinByLink = MessageContent;
//@description A chat member was deleted @user_id User identifier of the deleted chat member
messageChatDeleteMember user_id:int32 = MessageContent;
messageChatDeleteMember user_id:int53 = MessageContent;
//@description A basic group was upgraded to a supergroup and was deactivated as the result @supergroup_id Identifier of the supergroup to which the basic group was upgraded
messageChatUpgradeTo supergroup_id:int32 = MessageContent;
messageChatUpgradeTo supergroup_id:int53 = MessageContent;
//@description A supergroup has been created from a basic group @title Title of the newly created supergroup @basic_group_id The identifier of the original basic group
messageChatUpgradeFrom title:string basic_group_id:int32 = MessageContent;
messageChatUpgradeFrom title:string basic_group_id:int53 = MessageContent;
//@description A message has been pinned @message_id Identifier of the pinned message, can be an identifier of a deleted message or 0
messagePinMessage message_id:int53 = MessageContent;
@ -1790,7 +1791,7 @@ messagePinMessage message_id:int53 = MessageContent;
//@description A screenshot of a message in the chat has been taken
messageScreenshotTaken = MessageContent;
//@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme set for the chat. Otherwise chat theme was reset to the default one
//@description A theme in the chat has been changed @theme_name If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one
messageChatSetTheme theme_name:string = MessageContent;
//@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL setting
@ -1837,7 +1838,7 @@ textEntityTypeMention = TextEntityType;
//@description A hashtag text, beginning with "#"
textEntityTypeHashtag = TextEntityType;
//@description A cashtag text, beginning with "$" and consisting of capital english letters (i.e. "$USD")
//@description A cashtag text, beginning with "$" and consisting of capital english letters (e.g., "$USD")
textEntityTypeCashtag = TextEntityType;
//@description A bot command, beginning with "/"
@ -1880,7 +1881,7 @@ textEntityTypePreCode language:string = TextEntityType;
textEntityTypeTextUrl url:string = TextEntityType;
//@description A text shows instead of a raw mention of the user (e.g., when the user has no username) @user_id Identifier of the mentioned user
textEntityTypeMentionName user_id:int32 = TextEntityType;
textEntityTypeMentionName user_id:int53 = TextEntityType;
//@description A media timestamp @media_timestamp Timestamp from which a video/audio/video note/voice note playing should start, in seconds. The media can be in the content or the web page preview of the current message, or in the same places in the replied message
textEntityTypeMediaTimestamp media_timestamp:int32 = TextEntityType;
@ -1963,7 +1964,7 @@ inputMessageContact contact:contact = InputMessageContent;
inputMessageDice emoji:string clear_draft:Bool = InputMessageContent;
//@description A message with a game; not supported for channels or secret chats @bot_user_id User identifier of the bot that owns the game @game_short_name Short name of the game
inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent;
inputMessageGame bot_user_id:int53 game_short_name:string = InputMessageContent;
//@description A message with an invoice; can be used only by bots @invoice Invoice @title Product title; 1-32 characters @param_description Product description; 0-255 characters
//@photo_url Product photo URL; optional @photo_size Product photo size @photo_width Product photo width @photo_height Product photo height
@ -2082,6 +2083,9 @@ chatActionRecordingVideoNote = ChatAction;
//@description The user is uploading a video note @progress Upload progress, as a percentage
chatActionUploadingVideoNote progress:int32 = ChatAction;
//@description The user is watching animations sent by the other party by clicking on an animated emoji @emoji The animated emoji
chatActionWatchingAnimations emoji:string = ChatAction;
//@description The user has canceled the previous action
chatActionCancel = ChatAction;
@ -2232,11 +2236,11 @@ groupCallRecentSpeaker participant_id:MessageSender is_speaking:Bool = GroupCall
//@is_my_video_paused True, if the current user's video is paused
//@can_enable_video True, if the current user can broadcast video or share screen
//@mute_new_participants True, if only group call administrators can unmute new participants
//@can_change_mute_new_participants True, if the current user can enable or disable mute_new_participants setting
//@can_toggle_mute_new_participants True, if the current user can enable or disable mute_new_participants setting
//@record_duration Duration of the ongoing group call recording, in seconds; 0 if none. An updateGroupCall update is not triggered when value of this field changes, but the same recording goes on
//@is_video_recorded True, if a video file is being recorded for the call
//@duration Call duration, in seconds; for ended calls only
groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector<groupCallRecentSpeaker> is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_change_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall;
groupCall id:int32 title:string scheduled_start_date:int32 enabled_start_notification:Bool is_active:Bool is_joined:Bool need_rejoin:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector<groupCallRecentSpeaker> is_my_video_enabled:Bool is_my_video_paused:Bool can_enable_video:Bool mute_new_participants:Bool can_toggle_mute_new_participants:Bool record_duration:int32 is_video_recorded:Bool duration:int32 = GroupCall;
//@description Describes a group of video synchronization source identifiers @semantics The semantics of sources, one of "SIM" or "FID" @source_ids The list of synchronization source identifiers
groupCallVideoSourceGroup semantics:string source_ids:vector<int32> = GroupCallVideoSourceGroup;
@ -2298,7 +2302,7 @@ callProblemPixelatedVideo = CallProblem;
//@description Describes a call @id Call identifier, not persistent @user_id Peer user identifier @is_outgoing True, if the call is outgoing @is_video True, if the call is a video call @state Call state
call id:int32 user_id:int32 is_outgoing:Bool is_video:Bool state:CallState = Call;
call id:int32 user_id:int53 is_outgoing:Bool is_video:Bool state:CallState = Call;
//@description Contains settings for the authentication of the user's phone number
@ -2328,7 +2332,7 @@ diceStickersSlotMachine background:sticker lever:sticker left_reel:sticker cente
//@description Represents the result of an ImportContacts request @user_ids User identifiers of the imported contacts in the same order as they were specified in the request; 0 if the contact is not yet a registered user
//@importer_count The number of users that imported the corresponding contact; 0 for already registered users or if unavailable
importedContacts user_ids:vector<int32> importer_count:vector<int32> = ImportedContacts;
importedContacts user_ids:vector<int53> importer_count:vector<int32> = ImportedContacts;
//@description Contains an HTTP URL @url The URL
@ -2337,7 +2341,7 @@ httpUrl url:string = HttpUrl;
//@class InputInlineQueryResult @description Represents a single result of an inline query; for bots only
//@description Represents a link to an animated GIF or an animated (i.e. without sound) H.264/MPEG-4 AVC video
//@description Represents a link to an animated GIF or an animated (i.e., without sound) H.264/MPEG-4 AVC video
//@id Unique identifier of the query result @title Title of the query result
//@thumbnail_url URL of the result thumbnail (JPEG, GIF, or MPEG4), if it exists @thumbnail_mime_type MIME type of the video thumbnail. If non-empty, must be one of "image/jpeg", "image/gif" and "video/mp4"
//@video_url The URL of the video file (file size must not exceed 1MB) @video_mime_type MIME type of the video file. Must be one of "image/gif" and "video/mp4"
@ -2476,7 +2480,7 @@ customRequestResult result:string = CustomRequestResult;
//@description Contains one row of the game high score table @position Position in the high score table @user_id User identifier @score User score
gameHighScore position:int32 user_id:int32 score:int32 = GameHighScore;
gameHighScore position:int32 user_id:int53 score:int32 = GameHighScore;
//@description Contains a list of game high scores @scores A list of game high scores
gameHighScores scores:vector<gameHighScore> = GameHighScores;
@ -2509,10 +2513,10 @@ chatEventMemberJoinedByInviteLink invite_link:chatInviteLink = ChatEventAction;
chatEventMemberLeft = ChatEventAction;
//@description A new chat member was invited @user_id New member user identifier @status New member status
chatEventMemberInvited user_id:int32 status:ChatMemberStatus = ChatEventAction;
chatEventMemberInvited user_id:int53 status:ChatMemberStatus = ChatEventAction;
//@description A chat member has gained/lost administrator status, or the list of their administrator privileges has changed @user_id Affected chat member user identifier @old_status Previous status of the chat member @new_status New status of the chat member
chatEventMemberPromoted user_id:int32 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction;
chatEventMemberPromoted user_id:int53 old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction;
//@description A chat member was restricted/unrestricted or banned/unbanned, or the list of their restrictions has changed @member_id Affected chat member identifier @old_status Previous status of the chat member @new_status New status of the chat member
chatEventMemberRestricted member_id:MessageSender old_status:ChatMemberStatus new_status:ChatMemberStatus = ChatEventAction;
@ -2532,9 +2536,6 @@ chatEventUsernameChanged old_username:string new_username:string = ChatEventActi
//@description The chat photo was changed @old_photo Previous chat photo value; may be null @new_photo New chat photo value; may be null
chatEventPhotoChanged old_photo:chatPhoto new_photo:chatPhoto = ChatEventAction;
//@description The chat theme was changed. This event shouldn't be received until chat themes would be supported in supergroups @old_theme_name Previous chat theme name; empty if the previous theme was default one @new_theme_name New chat theme name; empty if the new theme is default one
chatEventThemeChanged old_theme_name:string new_theme_name:string = ChatEventAction;
//@description The can_invite_users permission of a supergroup chat was toggled @can_invite_users New value of can_invite_users permission
chatEventInvitesToggled can_invite_users:Bool = ChatEventAction;
@ -2584,7 +2585,7 @@ chatEventVoiceChatParticipantVolumeLevelChanged participant_id:MessageSender vol
chatEventVoiceChatMuteNewParticipantsToggled mute_new_participants:Bool = ChatEventAction;
//@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @user_id Identifier of the user who performed the action that triggered the event @action Action performed by the user
chatEvent id:int64 date:int32 user_id:int32 action:ChatEventAction = ChatEvent;
chatEvent id:int64 date:int32 user_id:int53 action:ChatEventAction = ChatEvent;
//@description Contains a list of chat events @events List of events
chatEvents events:vector<chatEvent> = ChatEvents;
@ -2737,9 +2738,10 @@ inputBackgroundRemote background_id:int64 = InputBackground;
//@description Describes theme settings
//@accent_color Theme accent color in ARGB format
//@background The background to be used in chats; may be null
//@message_fill The fill to be used as a background for outgoing messages
//@animate_message_fill If true, the freeform gradient fill needs to be animated on every sent message
themeSettings accent_color:int32 background:background message_fill:BackgroundFill animate_message_fill:Bool = ThemeSettings;
//@outgoing_message_fill The fill to be used as a background for outgoing messages
//@animate_outgoing_message_fill If true, the freeform gradient fill needs to be animated on every sent message
//@outgoing_message_accent_color Accent color of outgoing messages in ARGB format
themeSettings accent_color:int32 background:background outgoing_message_fill:BackgroundFill animate_outgoing_message_fill:Bool outgoing_message_accent_color:int32 = ThemeSettings;
//@description Describes a chat theme
@ -2891,8 +2893,8 @@ pushMessageContentChatChangePhoto = PushMessageContent;
//@description A chat title was edited @title New chat title
pushMessageContentChatChangeTitle title:string = PushMessageContent;
//@description A chat theme was edited @theme_name If non-empty, name of a new theme set for the chat. Otherwise chat theme was reset to the default one
pushMessageContentChatChangeTheme theme_name:string = PushMessageContent;
//@description A chat theme was edited @theme_name If non-empty, name of a new theme, set for the chat. Otherwise chat theme was reset to the default one
pushMessageContentChatSetTheme theme_name:string = PushMessageContent;
//@description A chat member was deleted @member_name Name of the deleted member @is_current_user True, if the current user was deleted from the group
//@is_left True, if the user has left the group themselves
@ -3002,7 +3004,7 @@ userPrivacySettingRuleAllowAll = UserPrivacySettingRule;
userPrivacySettingRuleAllowContacts = UserPrivacySettingRule;
//@description A rule to allow certain specified users to do something @user_ids The user identifiers, total number of users in all rules must not exceed 1000
userPrivacySettingRuleAllowUsers user_ids:vector<int32> = UserPrivacySettingRule;
userPrivacySettingRuleAllowUsers user_ids:vector<int53> = UserPrivacySettingRule;
//@description A rule to allow all members of certain specified basic groups and supergroups to doing something @chat_ids The chat identifiers, total number of chats in all rules must not exceed 20
userPrivacySettingRuleAllowChatMembers chat_ids:vector<int53> = UserPrivacySettingRule;
@ -3014,7 +3016,7 @@ userPrivacySettingRuleRestrictAll = UserPrivacySettingRule;
userPrivacySettingRuleRestrictContacts = UserPrivacySettingRule;
//@description A rule to restrict all specified users from doing something @user_ids The user identifiers, total number of users in all rules must not exceed 1000
userPrivacySettingRuleRestrictUsers user_ids:vector<int32> = UserPrivacySettingRule;
userPrivacySettingRuleRestrictUsers user_ids:vector<int53> = UserPrivacySettingRule;
//@description A rule to restrict all members of specified basic groups and supergroups from doing something @chat_ids The chat identifiers, total number of chats in all rules must not exceed 20
userPrivacySettingRuleRestrictChatMembers chat_ids:vector<int53> = UserPrivacySettingRule;
@ -3078,7 +3080,7 @@ sessions sessions:vector<session> = Sessions;
//@last_active_date Point in time (Unix timestamp) when obtained authorization was last used
//@ip IP address from which the user was logged in, in human-readable format
//@location Human-readable description of a country and a region, from which the user was logged in, based on the IP address
connectedWebsite id:int64 domain_name:string bot_user_id:int32 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite;
connectedWebsite id:int64 domain_name:string bot_user_id:int53 browser:string platform:string log_in_date:int32 last_active_date:int32 ip:string location:string = ConnectedWebsite;
//@description Contains a list of websites the current user is logged in with Telegram @websites List of connected websites
connectedWebsites websites:vector<connectedWebsite> = ConnectedWebsites;
@ -3158,7 +3160,7 @@ internalLinkTypeMessageDraft text:formattedText contains_link:Bool = InternalLin
//@description The link contains a request of Telegram passport data. Call getPassportAuthorizationForm with the given parameters to process the link if the link was received from outside of the app, otherwise ignore it
//@bot_user_id User identifier of the service's bot @scope Telegram Passport element types requested by the service @public_key Service's public key @nonce Unique request identifier provided by the service
//@callback_url An HTTP URL to open once the request is finished or canceled with the parameter tg_passport=success or tg_passport=cancel respectively. If empty, then the link tgbot{bot_user_id}://passport/success or tgbot{bot_user_id}://passport/cancel needs to be opened instead
internalLinkTypePassportDataRequest bot_user_id:int32 scope:string public_key:string nonce:string callback_url:string = InternalLinkType;
internalLinkTypePassportDataRequest bot_user_id:int53 scope:string public_key:string nonce:string callback_url:string = InternalLinkType;
//@description The link can be used to confirm ownership of a phone number to prevent account deletion. Call sendPhoneNumberConfirmationCode with the given hash and phone number to process the link
//@hash Hash value from the link @phone_number Phone number value from the link
@ -3381,7 +3383,7 @@ topChatCategoryForwardChats = TopChatCategory;
//@class TMeUrlType @description Describes the type of a URL linking to an internal Telegram entity
//@description A URL linking to a user @user_id Identifier of the user
tMeUrlTypeUser user_id:int32 = TMeUrlType;
tMeUrlTypeUser user_id:int53 = TMeUrlType;
//@description A URL linking to a public supergroup or channel @supergroup_id Identifier of the supergroup or channel
tMeUrlTypeSupergroup supergroup_id:int53 = TMeUrlType;
@ -3414,7 +3416,7 @@ suggestedActionCheckPhoneNumber = SuggestedAction;
suggestedActionSeeTicksHint = SuggestedAction;
//@description Suggests the user to convert specified supergroup to a broadcast group @supergroup_id Supergroup identifier
suggestedActionConvertToBroadcastGroup supergroup_id:int32 = SuggestedAction;
suggestedActionConvertToBroadcastGroup supergroup_id:int53 = SuggestedAction;
//@description Contains a counter @count Count
@ -3503,20 +3505,20 @@ chatStatisticsMessageInteractionInfo message_id:int53 view_count:int32 forward_c
//@description Contains statistics about messages sent by a user
//@user_id User identifier
//@sent_message_count Number of sent messages
//@average_character_count Average number of characters in sent messages
chatStatisticsMessageSenderInfo user_id:int32 sent_message_count:int32 average_character_count:int32 = ChatStatisticsMessageSenderInfo;
//@average_character_count Average number of characters in sent messages; 0 if unknown
chatStatisticsMessageSenderInfo user_id:int53 sent_message_count:int32 average_character_count:int32 = ChatStatisticsMessageSenderInfo;
//@description Contains statistics about administrator actions done by a user
//@user_id Administrator user identifier
//@deleted_message_count Number of messages deleted by the administrator
//@banned_user_count Number of users banned by the administrator
//@restricted_user_count Number of users restricted by the administrator
chatStatisticsAdministratorActionsInfo user_id:int32 deleted_message_count:int32 banned_user_count:int32 restricted_user_count:int32 = ChatStatisticsAdministratorActionsInfo;
chatStatisticsAdministratorActionsInfo user_id:int53 deleted_message_count:int32 banned_user_count:int32 restricted_user_count:int32 = ChatStatisticsAdministratorActionsInfo;
//@description Contains statistics about number of new members invited by a user
//@user_id User identifier
//@added_member_count Number of new members invited by the user
chatStatisticsInviterInfo user_id:int32 added_member_count:int32 = ChatStatisticsInviterInfo;
chatStatisticsInviterInfo user_id:int53 added_member_count:int32 = ChatStatisticsInviterInfo;
//@class ChatStatistics @description Contains a detailed statistics about a chat
@ -3597,7 +3599,7 @@ botCommandScopeChat chat_id:int53 = BotCommandScope;
botCommandScopeChatAdministrators chat_id:int53 = BotCommandScope;
//@description A scope covering a member of a chat @chat_id Chat identifier @user_id User identifier
botCommandScopeChatMember chat_id:int53 user_id:int32 = BotCommandScope;
botCommandScopeChatMember chat_id:int53 user_id:int53 = BotCommandScope;
//@class Update @description Contains notifications about data changes
@ -3741,10 +3743,10 @@ updateHavePendingNotifications have_delayed_notifications:Bool have_unreceived_n
updateDeleteMessages chat_id:int53 message_ids:vector<int53> is_permanent:Bool from_cache:Bool = Update;
//@description User activity in the chat has changed @chat_id Chat identifier @message_thread_id If not 0, a message thread identifier in which the action was performed @user_id Identifier of a user performing an action @action The action description
updateUserChatAction chat_id:int53 message_thread_id:int53 user_id:int32 action:ChatAction = Update;
updateUserChatAction chat_id:int53 message_thread_id:int53 user_id:int53 action:ChatAction = Update;
//@description The user went online or offline @user_id User identifier @status New status of the user
updateUserStatus user_id:int32 status:UserStatus = Update;
updateUserStatus user_id:int53 status:UserStatus = Update;
//@description Some data of a user has changed. This update is guaranteed to come before the user identifier is returned to the application @user New data about the user
updateUser user:user = Update;
@ -3762,13 +3764,13 @@ updateSupergroup supergroup:supergroup = Update;
updateSecretChat secret_chat:secretChat = Update;
//@description Some data from userFullInfo has been changed @user_id User identifier @user_full_info New full information about the user
updateUserFullInfo user_id:int32 user_full_info:userFullInfo = Update;
updateUserFullInfo user_id:int53 user_full_info:userFullInfo = Update;
//@description Some data from basicGroupFullInfo has been changed @basic_group_id Identifier of a basic group @basic_group_full_info New full information about the group
updateBasicGroupFullInfo basic_group_id:int32 basic_group_full_info:basicGroupFullInfo = Update;
updateBasicGroupFullInfo basic_group_id:int53 basic_group_full_info:basicGroupFullInfo = Update;
//@description Some data from supergroupFullInfo has been changed @supergroup_id Identifier of the supergroup or channel @supergroup_full_info New full information about the supergroup
updateSupergroupFullInfo supergroup_id:int32 supergroup_full_info:supergroupFullInfo = Update;
updateSupergroupFullInfo supergroup_id:int53 supergroup_full_info:supergroupFullInfo = Update;
//@description Service notification from the server. Upon receiving this the application must show a popup with the content of the notification
//@type Notification type. If type begins with "AUTH_KEY_DROP_", then two buttons "Cancel" and "Log out" should be shown under notification; if user presses the second, all local data should be destroyed using Destroy method
@ -3857,6 +3859,10 @@ updateUsersNearby users_nearby:vector<chatNearby> = Update;
//@description The list of supported dice emojis has changed @emojis The new list of supported dice emojis
updateDiceEmojis emojis:vector<string> = Update;
//@description Some animated emoji message was clicked and a big animated sticker should be played if the message is visible on the screen. chatActionWatchingAnimations with the text of the message needs to be sent if the sticker is played
//@chat_id Chat identifier @message_id Message identifier @sticker The animated sticker to be played
updateAnimatedEmojiMessageClicked chat_id:int53 message_id:int53 sticker:sticker = Update;
//@description The parameters of animation search through GetOption("animation_search_bot_username") bot has changed @provider Name of the animation search provider @emojis The new list of emojis suggested for searching
updateAnimationSearchParameters provider:string emojis:vector<string> = Update;
@ -3865,27 +3871,27 @@ updateSuggestedActions added_actions:vector<SuggestedAction> removed_actions:vec
//@description A new incoming inline query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @user_location User location; may be null
//@chat_type Contains information about the type of the chat, from which the query originated; may be null if unknown @query Text of the query @offset Offset of the first entry to return
updateNewInlineQuery id:int64 sender_user_id:int32 user_location:location chat_type:ChatType query:string offset:string = Update;
updateNewInlineQuery id:int64 sender_user_id:int53 user_location:location chat_type:ChatType query:string offset:string = Update;
//@description The user has chosen a result of an inline query; for bots only @sender_user_id Identifier of the user who sent the query @user_location User location; may be null
//@query Text of the query @result_id Identifier of the chosen result @inline_message_id Identifier of the sent inline message, if known
updateNewChosenInlineResult sender_user_id:int32 user_location:location query:string result_id:string inline_message_id:string = Update;
updateNewChosenInlineResult sender_user_id:int53 user_location:location query:string result_id:string inline_message_id:string = Update;
//@description A new incoming callback query; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query
//@chat_id Identifier of the chat where the query was sent @message_id Identifier of the message, from which the query originated
//@chat_instance Identifier that uniquely corresponds to the chat to which the message was sent @payload Query payload
updateNewCallbackQuery id:int64 sender_user_id:int32 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update;
updateNewCallbackQuery id:int64 sender_user_id:int53 chat_id:int53 message_id:int53 chat_instance:int64 payload:CallbackQueryPayload = Update;
//@description A new incoming callback query from a message sent via a bot; for bots only @id Unique query identifier @sender_user_id Identifier of the user who sent the query @inline_message_id Identifier of the inline message, from which the query originated
//@chat_instance An identifier uniquely corresponding to the chat a message was sent to @payload Query payload
updateNewInlineCallbackQuery id:int64 sender_user_id:int32 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update;
updateNewInlineCallbackQuery id:int64 sender_user_id:int53 inline_message_id:string chat_instance:int64 payload:CallbackQueryPayload = Update;
//@description A new incoming shipping query; for bots only. Only for invoices with flexible price @id Unique query identifier @sender_user_id Identifier of the user who sent the query @invoice_payload Invoice payload @shipping_address User shipping address
updateNewShippingQuery id:int64 sender_user_id:int32 invoice_payload:string shipping_address:address = Update;
updateNewShippingQuery id:int64 sender_user_id:int53 invoice_payload:string shipping_address:address = Update;
//@description A new incoming pre-checkout query; for bots only. Contains full information about a checkout @id Unique query identifier @sender_user_id Identifier of the user who sent the query @currency Currency for the product price @total_amount Total price for the product, in the smallest units of the currency
//@invoice_payload Invoice payload @shipping_option_id Identifier of a shipping option chosen by the user; may be empty if not applicable @order_info Information about the order; may be null
updateNewPreCheckoutQuery id:int64 sender_user_id:int32 currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo = Update;
updateNewPreCheckoutQuery id:int64 sender_user_id:int53 currency:string total_amount:int53 invoice_payload:bytes shipping_option_id:string order_info:orderInfo = Update;
//@description A new incoming event; for bots only @event A JSON-serialized event
updateNewCustomEvent event:string = Update;
@ -3897,12 +3903,12 @@ updateNewCustomQuery id:int64 data:string timeout:int32 = Update;
updatePoll poll:poll = Update;
//@description A user changed the answer to a poll; for bots only @poll_id Unique poll identifier @user_id The user, who changed the answer to the poll @option_ids 0-based identifiers of answer options, chosen by the user
updatePollAnswer poll_id:int64 user_id:int32 option_ids:vector<int32> = Update;
updatePollAnswer poll_id:int64 user_id:int53 option_ids:vector<int32> = Update;
//@description User rights changed in a chat; for bots only @chat_id Chat identifier @actor_user_id Identifier of the user, changing the rights
//@date Point in time (Unix timestamp) when the user rights was changed @invite_link If user has joined the chat using an invite link, the invite link; may be null
//@old_chat_member Previous chat member @new_chat_member New chat member
updateChatMember chat_id:int53 actor_user_id:int32 date:int32 invite_link:chatInviteLink old_chat_member:chatMember new_chat_member:chatMember = Update;
updateChatMember chat_id:int53 actor_user_id:int53 date:int32 invite_link:chatInviteLink old_chat_member:chatMember new_chat_member:chatMember = Update;
//@description Contains a list of updates @updates List of updates
@ -3972,7 +3978,7 @@ checkAuthenticationCode code:string = Ok;
//@description Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current authorization state is authorizationStateWaitPhoneNumber,
//-or if there is no pending authentication query and the current authorization state is authorizationStateWaitCode, authorizationStateWaitRegistration, or authorizationStateWaitPassword
//@other_user_ids List of user identifiers of other users currently using the application
requestQrCodeAuthentication other_user_ids:vector<int32> = Ok;
requestQrCodeAuthentication other_user_ids:vector<int53> = Ok;
//@description Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration
//@first_name The first name of the user; 1-64 characters @last_name The last name of the user; 0-64 characters
@ -4063,22 +4069,22 @@ getTemporaryPasswordState = TemporaryPasswordState;
getMe = User;
//@description Returns information about a user by their identifier. This is an offline request if the current user is not a bot @user_id User identifier
getUser user_id:int32 = User;
getUser user_id:int53 = User;
//@description Returns full information about a user by their identifier @user_id User identifier
getUserFullInfo user_id:int32 = UserFullInfo;
getUserFullInfo user_id:int53 = UserFullInfo;
//@description Returns information about a basic group by its identifier. This is an offline request if the current user is not a bot @basic_group_id Basic group identifier
getBasicGroup basic_group_id:int32 = BasicGroup;
getBasicGroup basic_group_id:int53 = BasicGroup;
//@description Returns full information about a basic group by its identifier @basic_group_id Basic group identifier
getBasicGroupFullInfo basic_group_id:int32 = BasicGroupFullInfo;
getBasicGroupFullInfo basic_group_id:int53 = BasicGroupFullInfo;
//@description Returns information about a supergroup or a channel by its identifier. This is an offline request if the current user is not a bot @supergroup_id Supergroup or channel identifier
getSupergroup supergroup_id:int32 = Supergroup;
getSupergroup supergroup_id:int53 = Supergroup;
//@description Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute @supergroup_id Supergroup or channel identifier
getSupergroupFullInfo supergroup_id:int32 = SupergroupFullInfo;
getSupergroupFullInfo supergroup_id:int53 = SupergroupFullInfo;
//@description Returns information about a secret chat by its identifier. This is an offline request @secret_chat_id Secret chat identifier
getSecretChat secret_chat_id:int32 = SecretChat;
@ -4108,12 +4114,12 @@ getMessages chat_id:int53 message_ids:vector<int53> = Messages;
//@description Returns information about a message thread. Can be used only if message.can_get_message_thread == true @chat_id Chat identifier @message_id Identifier of the message
getMessageThread chat_id:int53 message_id:int53 = MessageThreadInfo;
//@description Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only users, opened content of the message, are returned. The method can be called if message.can_get_viewers == true @chat_id Chat identifier @message_id Identifier of the message
getMessageViewers chat_id:int53 message_id:int53 = Users;
//@description Returns information about a file; this is an offline request @file_id Identifier of the file to get
getFile file_id:int32 = File;
//@description Execute a channel difference @channel_difference_id Identifier of the channel difference to execute
getChannelDifference channel_difference_id:int64 = Ok;
//@description Returns information about a file by its remote ID; this is an offline request. Can be used to register a URL as a file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still accessible to the user.
//-For example, if the file is from a message, then the message must be not deleted and accessible to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the application
//@remote_file_id Remote identifier of the file to get @file_type File type, if known
@ -4177,7 +4183,7 @@ getInactiveSupergroupChats = Chats;
//@description Returns a list of common group chats with a given user. Chats are sorted by their type and creation date @user_id User identifier @offset_chat_id Chat identifier starting from which to return chats; use 0 for the first request @limit The maximum number of chats to be returned; up to 100
getGroupsInCommon user_id:int32 offset_chat_id:int53 limit:int32 = Chats;
getGroupsInCommon user_id:int53 offset_chat_id:int53 limit:int32 = Chats;
//@description Returns messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id).
@ -4198,7 +4204,7 @@ getChatHistory chat_id:int53 from_message_id:int53 offset:int32 limit:int32 only
//@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. If the offset is negative, the limit must be greater than or equal to -offset. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit
getMessageThreadHistory chat_id:int53 message_id:int53 from_message_id:int53 offset:int32 limit:int32 = Messages;
//@description Deletes all messages in the chat. Use Chat.can_be_deleted_only_for_self and Chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat
//@description Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to find whether and how the method can be applied to the chat
//@chat_id Chat identifier @remove_from_chat_list Pass true if the chat should be removed from the chat list @revoke Pass true to try to delete chat history for all users
deleteChatHistory chat_id:int53 remove_from_chat_list:Bool revoke:Bool = Ok;
@ -4318,7 +4324,7 @@ sendMessageAlbum chat_id:int53 message_thread_id:int53 reply_to_message_id:int53
//@description Invites a bot to a chat (if it is not yet a member) and sends it the /start command. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels (although they can be added as admins) and secret chats. Returns the sent message
//@bot_user_id Identifier of the bot @chat_id Identifier of the target chat @parameter A hidden parameter sent to the bot for deep linking purposes (https://core.telegram.org/bots#deep-linking)
sendBotStartMessage bot_user_id:int32 chat_id:int53 parameter:string = Message;
sendBotStartMessage bot_user_id:int53 chat_id:int53 parameter:string = Message;
//@description Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message
//@chat_id Target chat
@ -4359,7 +4365,7 @@ addLocalMessage chat_id:int53 sender:MessageSender reply_to_message_id:int53 dis
deleteMessages chat_id:int53 message_ids:vector<int53> revoke:Bool = Ok;
//@description Deletes all messages sent by the specified user to a chat. Supported only for supergroups; requires can_delete_messages administrator privileges @chat_id Chat identifier @user_id User identifier
deleteChatMessagesFromUser chat_id:int53 user_id:int32 = Ok;
deleteChatMessagesFromUser chat_id:int53 user_id:int53 = Ok;
//@description Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the server side
@ -4464,18 +4470,18 @@ hideSuggestedAction action:SuggestedAction = Ok;
//@description Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user presses the button
//@chat_id Chat identifier of the message with the button @message_id Message identifier of the message with the button @button_id Button identifier
getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int32 = LoginUrlInfo;
getLoginUrlInfo chat_id:int53 message_id:int53 button_id:int53 = LoginUrlInfo;
//@description Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button of type inlineKeyboardButtonTypeLoginUrl.
//-Use the method getLoginUrlInfo to find whether a prior user confirmation is needed. If an error is returned, then the button must be handled as an ordinary URL button
//@chat_id Chat identifier of the message with the button @message_id Message identifier of the message with the button @button_id Button identifier
//@allow_write_access True, if the user allowed the bot to send them messages
getLoginUrl chat_id:int53 message_id:int53 button_id:int32 allow_write_access:Bool = HttpUrl;
getLoginUrl chat_id:int53 message_id:int53 button_id:int53 allow_write_access:Bool = HttpUrl;
//@description Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the query before the query timeout expires @bot_user_id The identifier of the target bot
//@chat_id Identifier of the chat where the query was sent @user_location Location of the user, only if needed @query Text of the query @offset Offset of the first entry to return
getInlineQueryResults bot_user_id:int32 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults;
getInlineQueryResults bot_user_id:int53 chat_id:int53 user_location:location query:string offset:string = InlineQueryResults;
//@description Sets the result of an inline query; for bots only @inline_query_id Identifier of the inline query @is_personal True, if the result of the query can be cached for the specified user
//@results The results of the query @cache_time Allowed time to cache the results of the query, in seconds @next_offset Offset for the next inline query; pass an empty string if there are no more results
@ -4499,17 +4505,17 @@ answerPreCheckoutQuery pre_checkout_query_id:int64 error_message:string = Ok;
//@description Updates the game score of the specified user in the game; for bots only @chat_id The chat to which the message with the game belongs @message_id Identifier of the message @edit_message True, if the message should be edited @user_id User identifier @score The new score
//@force Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table
setGameScore chat_id:int53 message_id:int53 edit_message:Bool user_id:int32 score:int32 force:Bool = Message;
setGameScore chat_id:int53 message_id:int53 edit_message:Bool user_id:int53 score:int32 force:Bool = Message;
//@description Updates the game score of the specified user in a game; for bots only @inline_message_id Inline message identifier @edit_message True, if the message should be edited @user_id User identifier @score The new score
//@force Pass true to update the score even if it decreases. If the score is 0, the user will be deleted from the high score table
setInlineGameScore inline_message_id:string edit_message:Bool user_id:int32 score:int32 force:Bool = Ok;
setInlineGameScore inline_message_id:string edit_message:Bool user_id:int53 score:int32 force:Bool = Ok;
//@description Returns the high scores for a game and some part of the high score table in the range of the specified user; for bots only @chat_id The chat that contains the message with the game @message_id Identifier of the message @user_id User identifier
getGameHighScores chat_id:int53 message_id:int53 user_id:int32 = GameHighScores;
getGameHighScores chat_id:int53 message_id:int53 user_id:int53 = GameHighScores;
//@description Returns game high scores and some part of the high score table in the range of the specified user; for bots only @inline_message_id Inline message identifier @user_id User identifier
getInlineGameHighScores inline_message_id:string user_id:int32 = GameHighScores;
getInlineGameHighScores inline_message_id:string user_id:int53 = GameHighScores;
//@description Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a ForceReply reply markup has been used. UpdateChatReplyMarkup will be sent if the reply markup will be changed @chat_id Chat identifier
@ -4537,6 +4543,9 @@ viewMessages chat_id:int53 message_thread_id:int53 message_ids:vector<int53> for
//@description Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated if something has changed @chat_id Chat identifier of the message @message_id Identifier of the message with the opened content
openMessageContent chat_id:int53 message_id:int53 = Ok;
//@description Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played or a 404 error if usual animation needs to be played @chat_id Chat identifier of the message @message_id Identifier of the clicked message
clickAnimatedEmojiMessage chat_id:int53 message_id:int53 = Sticker;
//@description Returns information about the type of an internal link. Returns a 404 error if the link is not internal. Can be called before authorization @link The link
getInternalLinkType link:string = InternalLinkType;
@ -4553,19 +4562,19 @@ readAllChatMentions chat_id:int53 = Ok;
//@description Returns an existing chat corresponding to a given user @user_id User identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect
createPrivateChat user_id:int32 force:Bool = Chat;
createPrivateChat user_id:int53 force:Bool = Chat;
//@description Returns an existing chat corresponding to a known basic group @basic_group_id Basic group identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect
createBasicGroupChat basic_group_id:int32 force:Bool = Chat;
createBasicGroupChat basic_group_id:int53 force:Bool = Chat;
//@description Returns an existing chat corresponding to a known supergroup or channel @supergroup_id Supergroup or channel identifier @force If true, the chat will be created without network request. In this case all information about the chat except its type, title and photo can be incorrect
createSupergroupChat supergroup_id:int32 force:Bool = Chat;
createSupergroupChat supergroup_id:int53 force:Bool = Chat;
//@description Returns an existing chat corresponding to a known secret chat @secret_chat_id Secret chat identifier
createSecretChat secret_chat_id:int32 = Chat;
//@description Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns the newly created chat @user_ids Identifiers of users to be added to the basic group @title Title of the new basic group; 1-128 characters
createNewBasicGroupChat user_ids:vector<int32> title:string = Chat;
createNewBasicGroupChat user_ids:vector<int53> title:string = Chat;
//@description Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat
//@title Title of the new chat; 1-128 characters
@ -4576,7 +4585,7 @@ createNewBasicGroupChat user_ids:vector<int32> title:string = Chat;
createNewSupergroupChat title:string is_channel:Bool description:string location:chatLocation for_import:Bool = Chat;
//@description Creates a new secret chat. Returns the newly created chat @user_id Identifier of the target user
createNewSecretChat user_id:int32 = Chat;
createNewSecretChat user_id:int53 = Chat;
//@description Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and messageChatUpgradeFrom; requires creator privileges. Deactivates the original basic group @chat_id Identifier of the chat to upgrade
upgradeBasicGroupChatToSupergroupChat chat_id:int53 = Chat;
@ -4682,13 +4691,13 @@ leaveChat chat_id:int53 = Ok;
//@description Adds a new member to a chat. Members can't be added to private or secret chats
//@chat_id Chat identifier @user_id Identifier of the user @forward_limit The number of earlier messages from the chat to be forwarded to the new member; up to 100. Ignored for supergroups and channels
addChatMember chat_id:int53 user_id:int32 forward_limit:int32 = Ok;
addChatMember chat_id:int53 user_id:int53 forward_limit:int32 = Ok;
//@description Adds multiple new members to a chat. Currently this method is only available for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has more than 200 members
//@chat_id Chat identifier @user_ids Identifiers of the users to be added to the chat. The maximum number of added users is 20 for supergroups and 100 for channels
addChatMembers chat_id:int53 user_ids:vector<int32> = Ok;
addChatMembers chat_id:int53 user_ids:vector<int53> = Ok;
//@description Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for adding new members to the chat and transferring chat ownership; instead, use addChatMember or transferChatOwnership
//@description Changes the status of a chat member, needs appropriate privileges. This function is currently not suitable for transferring chat ownership; use transferChatOwnership instead. Use addChatMember or banChatMember if you need to pass some additional parameters
//@chat_id Chat identifier @member_id Member identifier. Chats can be only banned and unbanned in supergroups and channels @status The new status of the member in the chat
setChatMemberStatus chat_id:int53 member_id:MessageSender status:ChatMemberStatus = Ok;
@ -4704,7 +4713,7 @@ canTransferOwnership = CanTransferOwnershipResult;
//@description Changes the owner of a chat. The current user must be a current owner of the chat. Use the method canTransferOwnership to check whether the ownership can be transferred from the current session. Available only for supergroups and channel chats
//@chat_id Chat identifier @user_id Identifier of the user to which transfer the ownership. The ownership can't be transferred to a bot or to a deleted user @password The password of the current user
transferChatOwnership chat_id:int53 user_id:int32 password:string = Ok;
transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok;
//@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier
getChatMember chat_id:int53 member_id:MessageSender = ChatMember;
@ -4836,7 +4845,7 @@ getChatInviteLinkCounts chat_id:int53 = ChatInviteLinkCounts;
//@offset_date Creation date of an invite link starting after which to return invite links; use 0 to get results from the beginning
//@offset_invite_link Invite link starting after which to return invite links; use empty string to get results from the beginning
//@limit The maximum number of invite links to return
getChatInviteLinks chat_id:int53 creator_user_id:int32 is_revoked:Bool offset_date:int32 offset_invite_link:string limit:int32 = ChatInviteLinks;
getChatInviteLinks chat_id:int53 creator_user_id:int53 is_revoked:Bool offset_date:int32 offset_invite_link:string limit:int32 = ChatInviteLinks;
//@description Returns chat members joined a chat by an invite link. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links @chat_id Chat identifier @invite_link Invite link for which to return chat members
//@offset_member A chat member from which to return next chat members; use null to get results from the beginning @limit The maximum number of chat members to return
@ -4854,7 +4863,7 @@ deleteRevokedChatInviteLink chat_id:int53 invite_link:string = Ok;
//@description Deletes all revoked chat invite links created by a given chat administrator. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links
//@chat_id Chat identifier
//@creator_user_id User identifier of a chat administrator, which links will be deleted. Must be an identifier of the current user for non-owner
deleteAllRevokedChatInviteLinks chat_id:int53 creator_user_id:int32 = Ok;
deleteAllRevokedChatInviteLinks chat_id:int53 creator_user_id:int53 = Ok;
//@description Checks the validity of an invite link for a chat and returns information about the corresponding chat @invite_link Invite link to be checked
checkChatInviteLink invite_link:string = ChatInviteLinkInfo;
@ -4864,7 +4873,7 @@ joinChatByInviteLink invite_link:string = Chat;
//@description Creates a new call @user_id Identifier of the user to be called @protocol Description of the call protocols supported by the application @is_video True, if a video call needs to be created
createCall user_id:int32 protocol:callProtocol is_video:Bool = CallId;
createCall user_id:int53 protocol:callProtocol is_video:Bool = CallId;
//@description Accepts an incoming call @call_id Call identifier @protocol Description of the call protocols supported by the application
acceptCall call_id:int32 protocol:callProtocol = Ok;
@ -4929,7 +4938,7 @@ endGroupCallScreenSharing group_call_id:int32 = Ok;
//@description Sets group call title. Requires groupCall.can_be_managed group call flag @group_call_id Group call identifier @title New group call title; 1-64 characters
setGroupCallTitle group_call_id:int32 title:string = Ok;
//@description Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_change_mute_new_participants group call flag
//@description Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires groupCall.can_toggle_mute_new_participants group call flag
//@group_call_id Group call identifier @mute_new_participants New value of the mute_new_participants setting
toggleGroupCallMuteNewParticipants group_call_id:int32 mute_new_participants:Bool = Ok;
@ -4938,7 +4947,7 @@ revokeGroupCallInviteLink group_call_id:int32 = Ok;
//@description Invites users to an active group call. Sends a service message of type messageInviteToGroupCall for voice chats
//@group_call_id Group call identifier @user_ids User identifiers. At most 10 users can be invited simultaneously
inviteGroupCallParticipants group_call_id:int32 user_ids:vector<int32> = Ok;
inviteGroupCallParticipants group_call_id:int32 user_ids:vector<int53> = Ok;
//@description Returns invite link to a voice chat in a public chat
//@group_call_id Group call identifier
@ -5010,7 +5019,7 @@ getBlockedMessageSenders offset:int32 limit:int32 = MessageSenders;
//@description Adds a user to the contact list or edits an existing contact by their user identifier @contact The contact to add or edit; phone number can be empty and needs to be specified only if known, vCard is ignored
//@share_phone_number True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field UserFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number
//@share_phone_number True, if the new contact needs to be allowed to see current user's phone number. A corresponding rule to userPrivacySettingShowPhoneNumber will be added if needed. Use the field userFullInfo.need_phone_number_privacy_exception to check whether the current user needs to be asked to share their phone number
addContact contact:contact share_phone_number:Bool = Ok;
//@description Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored @contacts The list of contacts to import or edit; contacts' vCard are ignored and are not imported
@ -5023,7 +5032,7 @@ getContacts = Users;
searchContacts query:string limit:int32 = Users;
//@description Removes users from the contact list @user_ids Identifiers of users to be deleted
removeContacts user_ids:vector<int32> = Ok;
removeContacts user_ids:vector<int53> = Ok;
//@description Returns the total number of imported contacts
getImportedContactCount = Count;
@ -5037,11 +5046,11 @@ clearImportedContacts = Ok;
//@description Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on chatActionBarSharePhoneNumber @user_id Identifier of the user with whom to share the phone number. The user must be a mutual contact
sharePhoneNumber user_id:int32 = Ok;
sharePhoneNumber user_id:int53 = Ok;
//@description Returns the profile photos of a user. The result of this query may be outdated: some photos might have been deleted already @user_id User identifier @offset The number of photos to skip; must be non-negative @limit The maximum number of photos to be returned; up to 100
getUserProfilePhotos user_id:int32 offset:int32 limit:int32 = ChatPhotos;
getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos;
//@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is not empty, favorite and recently used stickers may also be returned @emoji String representation of emoji. If empty, returns all known installed stickers @limit The maximum number of stickers to be returned
@ -5122,7 +5131,7 @@ getEmojiSuggestionsUrl language_code:string = HttpUrl;
getSavedAnimations = Animations;
//@description Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list. If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type "video/mp4" can be added to the list
//@animation The animation file to be added. Only animations known to the server (i.e. successfully sent via a message) can be added to the list
//@animation The animation file to be added. Only animations known to the server (i.e., successfully sent via a message) can be added to the list
addSavedAnimation animation:InputFile = Ok;
//@description Removes an animation from the list of saved animations @animation Animation file to be removed
@ -5211,26 +5220,26 @@ disconnectAllWebsites = Ok;
//@description Changes the username of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel @username New value of the username. Use an empty string to remove the username
setSupergroupUsername supergroup_id:int32 username:string = Ok;
setSupergroupUsername supergroup_id:int53 username:string = Ok;
//@description Changes the sticker set of a supergroup; requires can_change_info administrator right @supergroup_id Identifier of the supergroup @sticker_set_id New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set
setSupergroupStickerSet supergroup_id:int32 sticker_set_id:int64 = Ok;
setSupergroupStickerSet supergroup_id:int53 sticker_set_id:int64 = Ok;
//@description Toggles sender signatures messages sent in a channel; requires can_change_info administrator right @supergroup_id Identifier of the channel @sign_messages New value of sign_messages
toggleSupergroupSignMessages supergroup_id:int32 sign_messages:Bool = Ok;
toggleSupergroupSignMessages supergroup_id:int53 sign_messages:Bool = Ok;
//@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available
toggleSupergroupIsAllHistoryAvailable supergroup_id:int32 is_all_history_available:Bool = Ok;
toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_available:Bool = Ok;
//@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup
toggleSupergroupIsBroadcastGroup supergroup_id:int32 = Ok;
toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok;
//@description Reports some messages from a user in a supergroup as spam; requires administrator rights in the supergroup @supergroup_id Supergroup identifier @user_id User identifier @message_ids Identifiers of messages sent in the supergroup by the user. This list must be non-empty
reportSupergroupSpam supergroup_id:int32 user_id:int32 message_ids:vector<int53> = Ok;
reportSupergroupSpam supergroup_id:int53 user_id:int53 message_ids:vector<int53> = Ok;
//@description Returns information about members or banned users in a supergroup or channel. Can be used only if SupergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters @supergroup_id Identifier of the supergroup or channel
//@description Returns information about members or banned users in a supergroup or channel. Can be used only if supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters @supergroup_id Identifier of the supergroup or channel
//@filter The type of users to return. By default, supergroupMembersFilterRecent @offset Number of users to skip @limit The maximum number of users be returned; up to 200
getSupergroupMembers supergroup_id:int32 filter:SupergroupMembersFilter offset:int32 limit:int32 = ChatMembers;
getSupergroupMembers supergroup_id:int53 filter:SupergroupMembersFilter offset:int32 limit:int32 = ChatMembers;
//@description Closes a secret chat, effectively transferring its state to secretChatStateClosed @secret_chat_id Secret chat identifier
@ -5240,7 +5249,7 @@ closeSecretChat secret_chat_id:int32 = Ok;
//@description Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i. e., in order of decreasing event_id)
//@chat_id Chat identifier @query Search query by which to filter events @from_event_id Identifier of an event from which to return results. Use 0 to get results from the latest events @limit The maximum number of events to return; up to 100
//@filters The types of events to return. By default, all types will be returned @user_ids User identifiers by which to filter events. By default, events relating to all users will be returned
getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector<int32> = ChatEvents;
getChatEventLog chat_id:int53 query:string from_event_id:int64 limit:int32 filters:chatEventLogFilters user_ids:vector<int53> = ChatEvents;
//@description Returns an invoice payment form. This method should be called when the user presses inlineKeyboardButtonBuy @chat_id Chat identifier of the Invoice message @message_id Message identifier @theme Preferred payment form theme
@ -5322,7 +5331,7 @@ deleteLanguagePack language_pack_id:string = Ok;
//@description Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push notification subscription @device_token Device token @other_user_ids List of user identifiers of other users currently using the application
registerDevice device_token:DeviceToken other_user_ids:vector<int32> = PushReceiverId;
registerDevice device_token:DeviceToken other_user_ids:vector<int53> = PushReceiverId;
//@description Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the server is required to fetch new data. Can be called before authorization
//@payload JSON-encoded push notification payload with all fields sent by the server, and "google.sent_time" and "google.notification.sound" fields added
@ -5376,10 +5385,10 @@ reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string
//@description Returns an HTTP URL with the chat statistics. Currently this method of getting the statistics are disabled and can be deleted in the future @chat_id Chat identifier @parameters Parameters for the request @is_dark Pass true if a URL with the dark theme must be returned
getChatStatisticsUrl chat_id:int53 parameters:string is_dark:Bool = HttpUrl;
//@description Returns detailed statistics about a chat. Currently this method can be used only for supergroups and channels. Can be used only if SupergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application
//@description Returns detailed statistics about a chat. Currently this method can be used only for supergroups and channels. Can be used only if supergroupFullInfo.can_get_statistics == true @chat_id Chat identifier @is_dark Pass true if a dark theme is used by the application
getChatStatistics chat_id:int53 is_dark:Bool = ChatStatistics;
//@description Returns detailed statistics about a message. Can be used only if Message.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application
//@description Returns detailed statistics about a message. Can be used only if message.can_get_statistics == true @chat_id Chat identifier @message_id Message identifier @is_dark Pass true if a dark theme is used by the application
getMessageStatistics chat_id:int53 message_id:int53 is_dark:Bool = MessageStatistics;
//@description Loads an asynchronous or a zoomed in statistical graph @chat_id Chat identifier @token The token for graph loading @x X-value for zoomed in graph or 0 otherwise
@ -5453,7 +5462,7 @@ setPassportElement element:InputPassportElement password:string = PassportElemen
deletePassportElement type:PassportElementType = Ok;
//@description Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not be able to resend the elements, until the errors are fixed @user_id User identifier @errors The errors
setPassportElementErrors user_id:int32 errors:vector<inputPassportElementError> = Ok;
setPassportElementErrors user_id:int53 errors:vector<inputPassportElementError> = Ok;
//@description Returns an IETF language tag of the language preferred in the country, which should be used to fill native fields in Telegram Passport personal details. Returns a 404 error if unknown @country_code A two-letter ISO 3166-1 alpha-2 country code
@ -5482,7 +5491,7 @@ checkEmailAddressVerificationCode code:string = Ok;
//@description Returns a Telegram Passport authorization form for sharing data with a service @bot_user_id User identifier of the service's bot @scope Telegram Passport element types requested by the service @public_key Service's public key @nonce Unique request identifier provided by the service
getPassportAuthorizationForm bot_user_id:int32 scope:string public_key:string nonce:string = PassportAuthorizationForm;
getPassportAuthorizationForm bot_user_id:int53 scope:string public_key:string nonce:string = PassportAuthorizationForm;
//@description Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form. Result can be received only once for each authorization form @autorization_form_id Authorization form identifier @password Password of the current user
getPassportAuthorizationFormAvailableElements autorization_form_id:int32 password:string = PassportElementsWithErrors;
@ -5507,7 +5516,7 @@ setBotUpdatesStatus pending_update_count:int32 error_message:string = Ok;
//@description Uploads a PNG image with a sticker; returns the uploaded file @user_id Sticker file owner; ignored for regular users @sticker Sticker file to upload
uploadStickerFile user_id:int32 sticker:InputSticker = File;
uploadStickerFile user_id:int53 sticker:InputSticker = File;
//@description Returns a suggested name for a new sticker set with a given title @title Sticker set title; 1-64 characters
getSuggestedStickerSetName title:string = Text;
@ -5522,16 +5531,16 @@ checkStickerSetName name:string = CheckStickerSetNameResult;
//@is_masks True, if stickers are masks. Animated stickers can't be masks
//@stickers List of stickers to be added to the set; must be non-empty. All stickers must be of the same type. For animated stickers, uploadStickerFile must be used before the sticker is shown
//@source Source of the sticker set; may be empty if unknown
createNewStickerSet user_id:int32 title:string name:string is_masks:Bool stickers:vector<InputSticker> source:string = StickerSet;
createNewStickerSet user_id:int53 title:string name:string is_masks:Bool stickers:vector<InputSticker> source:string = StickerSet;
//@description Adds a new sticker to a set; for bots only. Returns the sticker set
//@user_id Sticker set owner @name Sticker set name @sticker Sticker to add to the set
addStickerToSet user_id:int32 name:string sticker:InputSticker = StickerSet;
addStickerToSet user_id:int53 name:string sticker:InputSticker = StickerSet;
//@description Sets a sticker set thumbnail; for bots only. Returns the sticker set
//@user_id Sticker set owner @name Sticker set name
//@thumbnail Thumbnail to set in PNG or TGS format. Animated thumbnail must be set for animated sticker sets and only for them. Pass a zero InputFileId to delete the thumbnail
setStickerSetThumbnail user_id:int32 name:string thumbnail:InputFile = StickerSet;
setStickerSetThumbnail user_id:int53 name:string thumbnail:InputFile = StickerSet;
//@description Changes the position of a sticker in the set to which it belongs; for bots only. The sticker set must have been created by the bot
//@sticker Sticker @position New position of the sticker in the set, zero-based

View File

@ -31,16 +31,16 @@ test.useConfigSimple = help.ConfigSimple;
inputPeerEmpty#7f3b18ea = InputPeer;
inputPeerSelf#7da07ec9 = InputPeer;
inputPeerChat#179be863 chat_id:int = InputPeer;
inputPeerUser#7b8e7de6 user_id:int access_hash:long = InputPeer;
inputPeerChannel#20adaef8 channel_id:int access_hash:long = InputPeer;
inputPeerUserFromMessage#17bae2e6 peer:InputPeer msg_id:int user_id:int = InputPeer;
inputPeerChannelFromMessage#9c95f7bb peer:InputPeer msg_id:int channel_id:int = InputPeer;
inputPeerChat#35a95cb9 chat_id:long = InputPeer;
inputPeerUser#dde8a54c user_id:long access_hash:long = InputPeer;
inputPeerChannel#27bcbbfc channel_id:long access_hash:long = InputPeer;
inputPeerUserFromMessage#a87b0a1c peer:InputPeer msg_id:int user_id:long = InputPeer;
inputPeerChannelFromMessage#bd2a0840 peer:InputPeer msg_id:int channel_id:long = InputPeer;
inputUserEmpty#b98886cf = InputUser;
inputUserSelf#f7c1b13f = InputUser;
inputUser#d8292816 user_id:int access_hash:long = InputUser;
inputUserFromMessage#2d117597 peer:InputPeer msg_id:int user_id:int = InputUser;
inputUser#f21158c6 user_id:long access_hash:long = InputUser;
inputUserFromMessage#1da448e2 peer:InputPeer msg_id:int user_id:long = InputUser;
inputPhoneContact#f392b7f4 client_id:long phone:string first_name:string last_name:string = InputContact;
@ -84,9 +84,9 @@ inputPeerPhotoFileLocation#37257e99 flags:# big:flags.0?true peer:InputPeer phot
inputStickerSetThumb#9d84f3db stickerset:InputStickerSet thumb_version:int = InputFileLocation;
inputGroupCallStream#598a92a flags:# call:InputGroupCall time_ms:long scale:int video_channel:flags.0?int video_quality:flags.0?int = InputFileLocation;
peerUser#9db1bc6d user_id:int = Peer;
peerChat#bad0e5bb chat_id:int = Peer;
peerChannel#bddde532 channel_id:int = Peer;
peerUser#59511722 user_id:long = Peer;
peerChat#36c6019a chat_id:long = Peer;
peerChannel#a2a5371e channel_id:long = Peer;
storage.fileUnknown#aa963b05 = storage.FileType;
storage.filePartial#40bc6f52 = storage.FileType;
@ -99,8 +99,8 @@ storage.fileMov#4b09ebbc = storage.FileType;
storage.fileMp4#b3cea0e4 = storage.FileType;
storage.fileWebp#1081464c = storage.FileType;
userEmpty#200250ba id:int = User;
user#938458c1 flags:# 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 fake:flags.26?true id:int access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
userEmpty#d3bc4b7a id:long = User;
user#3ff6ecb0 flags:# 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 fake:flags.26?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector<RestrictionReason> bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
userProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto;
@ -112,33 +112,33 @@ userStatusRecently#e26f42f1 = UserStatus;
userStatusLastWeek#7bf09fc = UserStatus;
userStatusLastMonth#77ebc742 = UserStatus;
chatEmpty#9ba2d800 id:int = Chat;
chat#3bda1bde flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true id:int title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;
chatForbidden#7328bdb id:int title:string = Chat;
channel#d31a961e flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
channelForbidden#289da732 flags:# broadcast:flags.5?true megagroup:flags.8?true id:int access_hash:long title:string until_date:flags.16?int = Chat;
chatEmpty#29562865 id:long = Chat;
chat#41cbf256 flags:# creator:flags.0?true kicked:flags.1?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat;
chatForbidden#6592a1a7 id:long title:string = Chat;
channel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int restriction_reason:flags.9?Vector<RestrictionReason> admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = Chat;
channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat;
chatFull#49a0a5d9 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:int about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string = ChatFull;
channelFull#2f532f3c flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:int about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?int migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?int location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
chatFull#4dbdc099 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector<BotInfo> pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string = ChatFull;
channelFull#e9b27a17 flags:# can_view_participants:flags.3?true can_set_username:flags.6?true can_set_stickers:flags.7?true hidden_prehistory:flags.10?true can_set_location:flags.16?true has_scheduled:flags.19?true can_view_stats:flags.20?true blocked:flags.22?true id:long about:string participants_count:flags.0?int admins_count:flags.1?int kicked_count:flags.2?int banned_count:flags.2?int online_count:flags.13?int read_inbox_max_id:int read_outbox_max_id:int unread_count:int chat_photo:Photo notify_settings:PeerNotifySettings exported_invite:flags.23?ExportedChatInvite bot_info:Vector<BotInfo> migrated_from_chat_id:flags.4?long migrated_from_max_id:flags.4?int pinned_msg_id:flags.5?int stickerset:flags.8?StickerSet available_min_id:flags.9?int folder_id:flags.11?int linked_chat_id:flags.14?long location:flags.15?ChannelLocation slowmode_seconds:flags.17?int slowmode_next_send_date:flags.18?int stats_dc:flags.12?int pts:int call:flags.21?InputGroupCall ttl_period:flags.24?int pending_suggestions:flags.25?Vector<string> groupcall_default_join_as:flags.26?Peer theme_emoticon:flags.27?string = ChatFull;
chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
chatParticipantCreator#da13538a user_id:int = ChatParticipant;
chatParticipantAdmin#e2d6e436 user_id:int inviter_id:int date:int = ChatParticipant;
chatParticipant#c02d4007 user_id:long inviter_id:long date:int = ChatParticipant;
chatParticipantCreator#e46bcee4 user_id:long = ChatParticipant;
chatParticipantAdmin#a0933f5b user_id:long inviter_id:long date:int = ChatParticipant;
chatParticipantsForbidden#fc900c2b flags:# chat_id:int self_participant:flags.0?ChatParticipant = ChatParticipants;
chatParticipants#3f460fed chat_id:int participants:Vector<ChatParticipant> version:int = ChatParticipants;
chatParticipantsForbidden#8763d3e1 flags:# chat_id:long self_participant:flags.0?ChatParticipant = ChatParticipants;
chatParticipants#3cbc93f8 chat_id:long participants:Vector<ChatParticipant> version:int = ChatParticipants;
chatPhotoEmpty#37c1011c = ChatPhoto;
chatPhoto#1c6e1c11 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = ChatPhoto;
messageEmpty#90a6ca84 flags:# id:int peer_id:flags.0?Peer = Message;
message#bce383d2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
message#85d6cbe2 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true from_scheduled:flags.18?true legacy:flags.19?true edit_hide:flags.21?true pinned:flags.24?true id:int from_id:flags.8?Peer peer_id:Peer fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader date:int message:string media:flags.9?MessageMedia reply_markup:flags.6?ReplyMarkup entities:flags.7?Vector<MessageEntity> views:flags.10?int forwards:flags.10?int replies:flags.23?MessageReplies edit_date:flags.15?int post_author:flags.16?string grouped_id:flags.17?long restriction_reason:flags.22?Vector<RestrictionReason> ttl_period:flags.25?int = Message;
messageService#2b085862 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true post:flags.14?true legacy:flags.19?true id:int from_id:flags.8?Peer peer_id:Peer reply_to:flags.3?MessageReplyHeader date:int action:MessageAction ttl_period:flags.25?int = Message;
messageMediaEmpty#3ded6320 = MessageMedia;
messageMediaPhoto#695150d7 flags:# photo:flags.0?Photo ttl_seconds:flags.2?int = MessageMedia;
messageMediaGeo#56e0d474 geo:GeoPoint = MessageMedia;
messageMediaContact#cbf24940 phone_number:string first_name:string last_name:string vcard:string user_id:int = MessageMedia;
messageMediaContact#70322949 phone_number:string first_name:string last_name:string vcard:string user_id:long = MessageMedia;
messageMediaUnsupported#9f84f49e = MessageMedia;
messageMediaDocument#9cb070d7 flags:# document:flags.0?Document ttl_seconds:flags.2?int = MessageMedia;
messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia;
@ -150,16 +150,16 @@ messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia;
messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia;
messageActionEmpty#b6aef7b0 = MessageAction;
messageActionChatCreate#a6638b9a title:string users:Vector<int> = MessageAction;
messageActionChatCreate#bd47cbad title:string users:Vector<long> = MessageAction;
messageActionChatEditTitle#b5a1ce5a title:string = MessageAction;
messageActionChatEditPhoto#7fcb13a8 photo:Photo = MessageAction;
messageActionChatDeletePhoto#95e3fbef = MessageAction;
messageActionChatAddUser#488a7337 users:Vector<int> = MessageAction;
messageActionChatDeleteUser#b2ae9b0c user_id:int = MessageAction;
messageActionChatJoinedByLink#f89cf5e8 inviter_id:int = MessageAction;
messageActionChatAddUser#15cefd00 users:Vector<long> = MessageAction;
messageActionChatDeleteUser#a43f30cc user_id:long = MessageAction;
messageActionChatJoinedByLink#31224c3 inviter_id:long = MessageAction;
messageActionChannelCreate#95d2ac92 title:string = MessageAction;
messageActionChatMigrateTo#51bdb021 channel_id:int = MessageAction;
messageActionChannelMigrateFrom#b055eaee title:string chat_id:int = MessageAction;
messageActionChatMigrateTo#e1037f92 channel_id:long = MessageAction;
messageActionChannelMigrateFrom#ea3948e9 title:string chat_id:long = MessageAction;
messageActionPinMessage#94bd38ed = MessageAction;
messageActionHistoryClear#9fbab604 = MessageAction;
messageActionGameScore#92a72876 game_id:long score:int = MessageAction;
@ -174,7 +174,7 @@ messageActionSecureValuesSent#d95c6154 types:Vector<SecureValueType> = MessageAc
messageActionContactSignUp#f3f25f76 = MessageAction;
messageActionGeoProximityReached#98e0d697 from_id:Peer to_id:Peer distance:int = MessageAction;
messageActionGroupCall#7a0d7f42 flags:# call:InputGroupCall duration:flags.0?int = MessageAction;
messageActionInviteToGroupCall#76b9f11a call:InputGroupCall users:Vector<int> = MessageAction;
messageActionInviteToGroupCall#502f92f7 call:InputGroupCall users:Vector<long> = MessageAction;
messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;
messageActionGroupCallScheduled#b3a07661 call:InputGroupCall schedule_date:int = MessageAction;
messageActionSetChatTheme#aa786345 emoticon:string = MessageAction;
@ -200,7 +200,7 @@ auth.sentCode#5e002502 flags:# type:auth.SentCodeType phone_code_hash:string nex
auth.authorization#cd050916 flags:# tmp_sessions:flags.0?int user:User = auth.Authorization;
auth.authorizationSignUpRequired#44747e9a flags:# terms_of_service:flags.0?help.TermsOfService = auth.Authorization;
auth.exportedAuthorization#df969c2d id:int bytes:bytes = auth.ExportedAuthorization;
auth.exportedAuthorization#b434e2b8 id:long bytes:bytes = auth.ExportedAuthorization;
inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer;
inputNotifyUsers#193b4417 = InputNotifyPeer;
@ -227,11 +227,11 @@ inputReportReasonFake#f5ddd6e7 = ReportReason;
userFull#d697ff05 flags:# blocked:flags.0?true phone_calls_available:flags.4?true phone_calls_private:flags.5?true can_pin_message:flags.7?true has_scheduled:flags.12?true video_calls_available:flags.13?true user:User about:flags.1?string settings:PeerSettings profile_photo:flags.2?Photo notify_settings:PeerNotifySettings bot_info:flags.3?BotInfo pinned_msg_id:flags.6?int common_chats_count:int folder_id:flags.11?int ttl_period:flags.14?int theme_emoticon:flags.15?string = UserFull;
contact#f911c994 user_id:int mutual:Bool = Contact;
contact#145ade0b user_id:long mutual:Bool = Contact;
importedContact#d0028438 user_id:int client_id:long = ImportedContact;
importedContact#c13e3c50 user_id:long client_id:long = ImportedContact;
contactStatus#d3680c61 user_id:int status:UserStatus = ContactStatus;
contactStatus#16d9703b user_id:long status:UserStatus = ContactStatus;
contacts.contactsNotModified#b74ba9d2 = contacts.Contacts;
contacts.contacts#eae87e42 contacts:Vector<Contact> saved_count:int users:Vector<User> = contacts.Contacts;
@ -278,64 +278,64 @@ inputMessagesFilterPinned#1bb00451 = MessagesFilter;
updateNewMessage#1f2b0afd message:Message pts:int pts_count:int = Update;
updateMessageID#4e90bfd6 id:int random_id:long = Update;
updateDeleteMessages#a20db0e5 messages:Vector<int> pts:int pts_count:int = Update;
updateUserTyping#5c486927 user_id:int action:SendMessageAction = Update;
updateChatUserTyping#86cadb6c chat_id:int from_id:Peer action:SendMessageAction = Update;
updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update;
updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update;
updateChatParticipants#7761198 participants:ChatParticipants = Update;
updateUserStatus#1bfbd823 user_id:int status:UserStatus = Update;
updateUserName#a7332b73 user_id:int first_name:string last_name:string username:string = Update;
updateUserPhoto#95313b0c user_id:int date:int photo:UserProfilePhoto previous:Bool = Update;
updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update;
updateUserName#c3f202e0 user_id:long first_name:string last_name:string username:string = Update;
updateUserPhoto#f227868c user_id:long date:int photo:UserProfilePhoto previous:Bool = Update;
updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update;
updateEncryptedChatTyping#1710f156 chat_id:int = Update;
updateEncryption#b4a2e88d chat:EncryptedChat date:int = Update;
updateEncryptedMessagesRead#38fe25b7 chat_id:int max_date:int date:int = Update;
updateChatParticipantAdd#ea4b0e5c chat_id:int user_id:int inviter_id:int date:int version:int = Update;
updateChatParticipantDelete#6e5f8c22 chat_id:int user_id:int version:int = Update;
updateChatParticipantAdd#3dda5451 chat_id:long user_id:long inviter_id:long date:int version:int = Update;
updateChatParticipantDelete#e32f3d77 chat_id:long user_id:long version:int = Update;
updateDcOptions#8e5e9873 dc_options:Vector<DcOption> = Update;
updateNotifySettings#bec268ef peer:NotifyPeer notify_settings:PeerNotifySettings = Update;
updateServiceNotification#ebe46819 flags:# popup:flags.0?true inbox_date:flags.1?int type:string message:string media:MessageMedia entities:Vector<MessageEntity> = Update;
updatePrivacy#ee3b272a key:PrivacyKey rules:Vector<PrivacyRule> = Update;
updateUserPhone#12b9417b user_id:int phone:string = Update;
updateUserPhone#5492a13 user_id:long phone:string = Update;
updateReadHistoryInbox#9c974fdf flags:# folder_id:flags.0?int peer:Peer max_id:int still_unread_count:int pts:int pts_count:int = Update;
updateReadHistoryOutbox#2f2f21bf peer:Peer max_id:int pts:int pts_count:int = Update;
updateWebPage#7f891213 webpage:WebPage pts:int pts_count:int = Update;
updateReadMessagesContents#68c13933 messages:Vector<int> pts:int pts_count:int = Update;
updateChannelTooLong#eb0467fb flags:# channel_id:int pts:flags.0?int = Update;
updateChannel#b6d45656 channel_id:int = Update;
updateChannelTooLong#108d941f flags:# channel_id:long pts:flags.0?int = Update;
updateChannel#635b4c09 channel_id:long = Update;
updateNewChannelMessage#62ba04d9 message:Message pts:int pts_count:int = Update;
updateReadChannelInbox#330b5424 flags:# folder_id:flags.0?int channel_id:int max_id:int still_unread_count:int pts:int = Update;
updateDeleteChannelMessages#c37521c9 channel_id:int messages:Vector<int> pts:int pts_count:int = Update;
updateChannelMessageViews#98a12b4b channel_id:int id:int views:int = Update;
updateChatParticipantAdmin#b6901959 chat_id:int user_id:int is_admin:Bool version:int = Update;
updateReadChannelInbox#922e6e10 flags:# folder_id:flags.0?int channel_id:long max_id:int still_unread_count:int pts:int = Update;
updateDeleteChannelMessages#c32d5b12 channel_id:long messages:Vector<int> pts:int pts_count:int = Update;
updateChannelMessageViews#f226ac08 channel_id:long id:int views:int = Update;
updateChatParticipantAdmin#d7ca61a2 chat_id:long user_id:long is_admin:Bool version:int = Update;
updateNewStickerSet#688a30aa stickerset:messages.StickerSet = Update;
updateStickerSetsOrder#bb2d201 flags:# masks:flags.0?true order:Vector<long> = Update;
updateStickerSets#43ae3dec = Update;
updateSavedGifs#9375341e = Update;
updateBotInlineQuery#3f2038db flags:# query_id:long user_id:int query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;
updateBotInlineSend#e48f964 flags:# user_id:int query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;
updateBotInlineQuery#496f379c flags:# query_id:long user_id:long query:string geo:flags.0?GeoPoint peer_type:flags.1?InlineQueryPeerType offset:string = Update;
updateBotInlineSend#12f12a07 flags:# user_id:long query:string geo:flags.0?GeoPoint id:string msg_id:flags.1?InputBotInlineMessageID = Update;
updateEditChannelMessage#1b3f4df7 message:Message pts:int pts_count:int = Update;
updateBotCallbackQuery#e73547e1 flags:# query_id:long user_id:int peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
updateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg_id:int chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
updateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update;
updateInlineBotCallbackQuery#f9d27a5a flags:# query_id:long user_id:int msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
updateReadChannelOutbox#25d6c9c7 channel_id:int max_id:int = Update;
updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update;
updateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update;
updateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update;
updateReadFeaturedStickers#571d2742 = Update;
updateRecentStickers#9a422c20 = Update;
updateConfig#a229dd06 = Update;
updatePtsChanged#3354678f = Update;
updateChannelWebPage#40771900 channel_id:int webpage:WebPage pts:int pts_count:int = Update;
updateChannelWebPage#2f2ba99f channel_id:long webpage:WebPage pts:int pts_count:int = Update;
updateDialogPinned#6e6fe51c flags:# pinned:flags.0?true folder_id:flags.1?int peer:DialogPeer = Update;
updatePinnedDialogs#fa0f3ca2 flags:# folder_id:flags.1?int order:flags.0?Vector<DialogPeer> = Update;
updateBotWebhookJSON#8317c0c3 data:DataJSON = Update;
updateBotWebhookJSONQuery#9b9240a6 query_id:long data:DataJSON timeout:int = Update;
updateBotShippingQuery#e0cdc940 query_id:long user_id:int payload:bytes shipping_address:PostAddress = Update;
updateBotPrecheckoutQuery#5d2f3aa9 flags:# query_id:long user_id:int payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;
updateBotShippingQuery#b5aefd7d query_id:long user_id:long payload:bytes shipping_address:PostAddress = Update;
updateBotPrecheckoutQuery#8caa9a96 flags:# query_id:long user_id:long payload:bytes info:flags.0?PaymentRequestedInfo shipping_option_id:flags.1?string currency:string total_amount:long = Update;
updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update;
updateLangPackTooLong#46560264 lang_code:string = Update;
updateLangPack#56022f4d difference:LangPackDifference = Update;
updateFavedStickers#e511996d = Update;
updateChannelReadMessagesContents#89893b45 channel_id:int messages:Vector<int> = Update;
updateChannelReadMessagesContents#44bdd535 channel_id:long messages:Vector<int> = Update;
updateContactsReset#7084a7be = Update;
updateChannelAvailableMessages#70db6837 channel_id:int available_min_id:int = Update;
updateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update;
updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update;
updateMessagePoll#aca1657b flags:# poll_id:long poll:flags.0?Poll results:PollResults = Update;
updateChatDefaultBannedRights#54c01850 peer:Peer default_banned_rights:ChatBannedRights version:int = Update;
@ -347,27 +347,27 @@ updateDeleteScheduledMessages#90866cee peer:Peer messages:Vector<int> = Update;
updateTheme#8216fba3 theme:Theme = Update;
updateGeoLiveViewed#871fb939 peer:Peer msg_id:int = Update;
updateLoginToken#564fe691 = Update;
updateMessagePollVote#37f69f0b poll_id:long user_id:int options:Vector<bytes> qts:int = Update;
updateMessagePollVote#106395c9 poll_id:long user_id:long options:Vector<bytes> qts:int = Update;
updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
updateDialogFilterOrder#a5d72105 order:Vector<int> = Update;
updateDialogFilters#3504914f = Update;
updatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;
updateChannelMessageForwards#6e8a84df channel_id:int id:int forwards:int = Update;
updateReadChannelDiscussionInbox#1cc7de54 flags:# channel_id:int top_msg_id:int read_max_id:int broadcast_id:flags.0?int broadcast_post:flags.0?int = Update;
updateReadChannelDiscussionOutbox#4638a26c channel_id:int top_msg_id:int read_max_id:int = Update;
updateChannelMessageForwards#d29a27f4 channel_id:long id:int forwards:int = Update;
updateReadChannelDiscussionInbox#d6b19546 flags:# channel_id:long top_msg_id:int read_max_id:int broadcast_id:flags.0?long broadcast_post:flags.0?int = Update;
updateReadChannelDiscussionOutbox#695c9e7c channel_id:long top_msg_id:int read_max_id:int = Update;
updatePeerBlocked#246a4b22 peer_id:Peer blocked:Bool = Update;
updateChannelUserTyping#6b171718 flags:# channel_id:int top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;
updateChannelUserTyping#8c88c923 flags:# channel_id:long top_msg_id:flags.0?int from_id:Peer action:SendMessageAction = Update;
updatePinnedMessages#ed85eab5 flags:# pinned:flags.0?true peer:Peer messages:Vector<int> pts:int pts_count:int = Update;
updatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int messages:Vector<int> pts:int pts_count:int = Update;
updateChat#1330a196 chat_id:int = Update;
updatePinnedChannelMessages#5bb98608 flags:# pinned:flags.0?true channel_id:long messages:Vector<int> pts:int pts_count:int = Update;
updateChat#f89a6a4e chat_id:long = Update;
updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector<GroupCallParticipant> version:int = Update;
updateGroupCall#a45eb99b chat_id:int call:GroupCall = Update;
updateGroupCall#14b24500 chat_id:long call:GroupCall = Update;
updatePeerHistoryTTL#bb9bb9a5 flags:# peer:Peer ttl_period:flags.0?int = Update;
updateChatParticipant#f3b3781f flags:# chat_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
updateChannelParticipant#7fecb1ec flags:# channel_id:int date:int actor_id:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
updateBotStopped#7f9488a user_id:int date:int stopped:Bool qts:int = Update;
updateChatParticipant#d087663a flags:# chat_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChatParticipant new_participant:flags.1?ChatParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
updateChannelParticipant#985d3abb flags:# channel_id:long date:int actor_id:long user_id:long prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant invite:flags.2?ExportedChatInvite qts:int = Update;
updateBotStopped#c4870a49 user_id:long date:int stopped:Bool qts:int = Update;
updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJSON = Update;
updateBotCommands#cf7e0873 peer:Peer bot_id:int commands:Vector<BotCommand> = Update;
updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector<BotCommand> = Update;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@ -377,8 +377,8 @@ updates.differenceSlice#a8fb1981 new_messages:Vector<Message> new_encrypted_mess
updates.differenceTooLong#4afe8f6d pts:int = updates.Difference;
updatesTooLong#e317af7e = Updates;
updateShortMessage#faeff833 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShortChatMessage#1157b858 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:int chat_id:int message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?int reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShortMessage#313bc7f8 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int user_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShortChatMessage#4d6deea5 flags:# out:flags.1?true mentioned:flags.4?true media_unread:flags.5?true silent:flags.13?true id:int from_id:long chat_id:long message:string pts:int pts_count:int date:int fwd_from:flags.2?MessageFwdHeader via_bot_id:flags.11?long reply_to:flags.3?MessageReplyHeader entities:flags.7?Vector<MessageEntity> ttl_period:flags.25?int = Updates;
updateShort#78d4dec1 update:Update date:int = Updates;
updatesCombined#725b04c3 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq_start:int seq:int = Updates;
updates#74ae4240 updates:Vector<Update> users:Vector<User> chats:Vector<Chat> date:int seq:int = Updates;
@ -404,9 +404,9 @@ help.noAppUpdate#c45a6536 = help.AppUpdate;
help.inviteText#18cb9f78 message:string = help.InviteText;
encryptedChatEmpty#ab7ec0a0 id:int = EncryptedChat;
encryptedChatWaiting#3bf703dc id:int access_hash:long date:int admin_id:int participant_id:int = EncryptedChat;
encryptedChatRequested#62718a82 flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:int participant_id:int g_a:bytes = EncryptedChat;
encryptedChat#fa56ce36 id:int access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
encryptedChatWaiting#66b25953 id:int access_hash:long date:int admin_id:long participant_id:long = EncryptedChat;
encryptedChatRequested#48f1d94c flags:# folder_id:flags.0?int id:int access_hash:long date:int admin_id:long participant_id:long g_a:bytes = EncryptedChat;
encryptedChat#61f0d4c7 id:int access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long = EncryptedChat;
encryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;
inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
@ -457,6 +457,8 @@ sendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;
speakingInGroupCallAction#d92c2285 = SendMessageAction;
sendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;
sendMessageChooseStickerAction#b05ac6b1 = SendMessageAction;
sendMessageEmojiInteraction#25972bcb emoticon:string msg_id:int interaction:DataJSON = SendMessageAction;
sendMessageEmojiInteractionSeen#b665902e emoticon:string = SendMessageAction;
contacts.found#b3134d9d my_results:Vector<Peer> results:Vector<Peer> chats:Vector<Chat> users:Vector<User> = contacts.Found;
@ -484,17 +486,17 @@ inputPrivacyValueAllowUsers#131cc67f users:Vector<InputUser> = InputPrivacyRule;
inputPrivacyValueDisallowContacts#ba52007 = InputPrivacyRule;
inputPrivacyValueDisallowAll#d66b66c9 = InputPrivacyRule;
inputPrivacyValueDisallowUsers#90110467 users:Vector<InputUser> = InputPrivacyRule;
inputPrivacyValueAllowChatParticipants#4c81c1ba chats:Vector<int> = InputPrivacyRule;
inputPrivacyValueDisallowChatParticipants#d82363af chats:Vector<int> = InputPrivacyRule;
inputPrivacyValueAllowChatParticipants#840649cf chats:Vector<long> = InputPrivacyRule;
inputPrivacyValueDisallowChatParticipants#e94f0f86 chats:Vector<long> = InputPrivacyRule;
privacyValueAllowContacts#fffe1bac = PrivacyRule;
privacyValueAllowAll#65427b82 = PrivacyRule;
privacyValueAllowUsers#4d5bbe0c users:Vector<int> = PrivacyRule;
privacyValueAllowUsers#b8905fb2 users:Vector<long> = PrivacyRule;
privacyValueDisallowContacts#f888fa1a = PrivacyRule;
privacyValueDisallowAll#8b73e763 = PrivacyRule;
privacyValueDisallowUsers#c7f49b7 users:Vector<int> = PrivacyRule;
privacyValueAllowChatParticipants#18be796b chats:Vector<int> = PrivacyRule;
privacyValueDisallowChatParticipants#acae0690 chats:Vector<int> = PrivacyRule;
privacyValueDisallowUsers#e4621141 users:Vector<long> = PrivacyRule;
privacyValueAllowChatParticipants#6b134e8e chats:Vector<long> = PrivacyRule;
privacyValueDisallowChatParticipants#41c87565 chats:Vector<long> = PrivacyRule;
account.privacyRules#50a04e45 rules:Vector<PrivacyRule> chats:Vector<Chat> users:Vector<User> = account.PrivacyRules;
@ -509,12 +511,12 @@ documentAttributeFilename#15590068 file_name:string = DocumentAttribute;
documentAttributeHasStickers#9801d2f7 = DocumentAttribute;
messages.stickersNotModified#f1749a22 = messages.Stickers;
messages.stickers#e4599bbd hash:int stickers:Vector<Document> = messages.Stickers;
messages.stickers#30a6ec7e hash:long stickers:Vector<Document> = messages.Stickers;
stickerPack#12b299d4 emoticon:string documents:Vector<long> = StickerPack;
messages.allStickersNotModified#e86602c3 = messages.AllStickers;
messages.allStickers#edfd405f hash:int sets:Vector<StickerSet> = messages.AllStickers;
messages.allStickers#cdbbcebb hash:long sets:Vector<StickerSet> = messages.AllStickers;
messages.affectedMessages#84d19185 pts:int pts_count:int = messages.AffectedMessages;
@ -537,7 +539,7 @@ auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
chatInviteExported#6e24fc9d flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:int date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;
chatInviteExported#b18105e8 flags:# revoked:flags.0?true permanent:flags.5?true link:string admin_id:long date:int start_date:flags.4?int expire_date:flags.1?int usage_limit:flags.2?int usage:flags.3?int = ExportedChatInvite;
chatInviteAlready#5a686d7c chat:Chat = ChatInvite;
chatInvite#dfc2f58e flags:# channel:flags.0?true broadcast:flags.1?true public:flags.2?true megagroup:flags.3?true title:string photo:Photo participants_count:int participants:flags.4?Vector<User> = ChatInvite;
@ -548,6 +550,7 @@ inputStickerSetID#9de7a269 id:long access_hash:long = InputStickerSet;
inputStickerSetShortName#861cc8a0 short_name:string = InputStickerSet;
inputStickerSetAnimatedEmoji#28703c8 = InputStickerSet;
inputStickerSetDice#e67f520e emoticon:string = InputStickerSet;
inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet;
stickerSet#d7df217a flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector<PhotoSize> thumb_dc_id:flags.4?int thumb_version:flags.4?int count:int hash:int = StickerSet;
@ -555,7 +558,7 @@ messages.stickerSet#b60a24a6 set:StickerSet packs:Vector<StickerPack> documents:
botCommand#c27ac8c7 command:string description:string = BotCommand;
botInfo#98e81d3a user_id:int description:string commands:Vector<BotCommand> = BotInfo;
botInfo#1b74b335 user_id:long description:string commands:Vector<BotCommand> = BotInfo;
keyboardButton#a2fa4880 text:string = KeyboardButton;
keyboardButtonUrl#258aff05 text:string url:string = KeyboardButton;
@ -587,7 +590,7 @@ messageEntityItalic#826f8b60 offset:int length:int = MessageEntity;
messageEntityCode#28a20571 offset:int length:int = MessageEntity;
messageEntityPre#73924be0 offset:int length:int language:string = MessageEntity;
messageEntityTextUrl#76a6d327 offset:int length:int url:string = MessageEntity;
messageEntityMentionName#352dca58 offset:int length:int user_id:int = MessageEntity;
messageEntityMentionName#dc7b1140 offset:int length:int user_id:long = MessageEntity;
inputMessageEntityMentionName#208e68c9 offset:int length:int user_id:InputUser = MessageEntity;
messageEntityPhone#9b69e34b offset:int length:int = MessageEntity;
messageEntityCashtag#4c4e743f offset:int length:int = MessageEntity;
@ -597,8 +600,8 @@ messageEntityBlockquote#20df5d0 offset:int length:int = MessageEntity;
messageEntityBankCard#761e6af4 offset:int length:int = MessageEntity;
inputChannelEmpty#ee8c1e86 = InputChannel;
inputChannel#afeb712e channel_id:int access_hash:long = InputChannel;
inputChannelFromMessage#2a286531 peer:InputPeer msg_id:int channel_id:int = InputChannel;
inputChannel#f35aec28 channel_id:long access_hash:long = InputChannel;
inputChannelFromMessage#5b934f9d peer:InputPeer msg_id:int channel_id:long = InputChannel;
contacts.resolvedPeer#7f077ad9 peer:Peer chats:Vector<Chat> users:Vector<User> = contacts.ResolvedPeer;
@ -611,11 +614,11 @@ updates.channelDifference#2064674e flags:# final:flags.0?true pts:int timeout:fl
channelMessagesFilterEmpty#94d42ee7 = ChannelMessagesFilter;
channelMessagesFilter#cd77d957 flags:# exclude_new_messages:flags.1?true ranges:Vector<MessageRange> = ChannelMessagesFilter;
channelParticipant#15ebac1d user_id:int date:int = ChannelParticipant;
channelParticipantSelf#a3289a6d user_id:int inviter_id:int date:int = ChannelParticipant;
channelParticipantCreator#447dca4b flags:# user_id:int admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;
channelParticipantAdmin#ccbebbaf flags:# can_edit:flags.0?true self:flags.1?true user_id:int inviter_id:flags.1?int promoted_by:int date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;
channelParticipantBanned#50a1dfd6 flags:# left:flags.0?true peer:Peer kicked_by:int date:int banned_rights:ChatBannedRights = ChannelParticipant;
channelParticipant#c00c07c0 user_id:long date:int = ChannelParticipant;
channelParticipantSelf#28a8bc67 user_id:long inviter_id:long date:int = ChannelParticipant;
channelParticipantCreator#2fe601d3 flags:# user_id:long admin_rights:ChatAdminRights rank:flags.0?string = ChannelParticipant;
channelParticipantAdmin#34c3bb53 flags:# can_edit:flags.0?true self:flags.1?true user_id:long inviter_id:flags.1?long promoted_by:long date:int admin_rights:ChatAdminRights rank:flags.2?string = ChannelParticipant;
channelParticipantBanned#6df8014e flags:# left:flags.0?true peer:Peer kicked_by:long date:int banned_rights:ChatBannedRights = ChannelParticipant;
channelParticipantLeft#1b03f006 peer:Peer = ChannelParticipant;
channelParticipantsRecent#de3f3c79 = ChannelParticipantsFilter;
@ -635,7 +638,7 @@ channels.channelParticipant#dfb80317 participant:ChannelParticipant chats:Vector
help.termsOfService#780a0310 flags:# popup:flags.0?true id:DataJSON text:string entities:Vector<MessageEntity> min_age_confirm:flags.1?int = help.TermsOfService;
messages.savedGifsNotModified#e8025ca2 = messages.SavedGifs;
messages.savedGifs#2e0709a5 hash:int gifs:Vector<Document> = messages.SavedGifs;
messages.savedGifs#84a02a0d hash:long gifs:Vector<Document> = messages.SavedGifs;
inputBotInlineMessageMediaAuto#3380c786 flags:# message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
inputBotInlineMessageText#3dcd7a87 flags:# no_webpage:flags.0?true message:string entities:flags.1?Vector<MessageEntity> reply_markup:flags.2?ReplyMarkup = InputBotInlineMessage;
@ -680,6 +683,7 @@ messages.botCallbackAnswer#36585ea4 flags:# alert:flags.1?true has_url:flags.3?t
messages.messageEditData#26b5dde6 flags:# caption:flags.0?true = messages.MessageEditData;
inputBotInlineMessageID#890c3d89 dc_id:int id:long access_hash:long = InputBotInlineMessageID;
inputBotInlineMessageID64#b6d915d7 dc_id:int owner_id:long id:int access_hash:long = InputBotInlineMessageID;
inlineBotSwitchPM#3c20629f text:string start_param:string = InlineBotSwitchPM;
@ -706,10 +710,10 @@ draftMessageEmpty#1b0c841a flags:# date:flags.0?int = DraftMessage;
draftMessage#fd8e711f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int message:string entities:flags.3?Vector<MessageEntity> date:int = DraftMessage;
messages.featuredStickersNotModified#c6dc0c66 count:int = messages.FeaturedStickers;
messages.featuredStickers#b6abc341 hash:int count:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;
messages.featuredStickers#84c02310 hash:long count:int sets:Vector<StickerSetCovered> unread:Vector<long> = messages.FeaturedStickers;
messages.recentStickersNotModified#b17f890 = messages.RecentStickers;
messages.recentStickers#22f3afb3 hash:int packs:Vector<StickerPack> stickers:Vector<Document> dates:Vector<int> = messages.RecentStickers;
messages.recentStickers#88d37c56 hash:long packs:Vector<StickerPack> stickers:Vector<Document> dates:Vector<int> = messages.RecentStickers;
messages.archivedStickers#4fcba9c8 count:int sets:Vector<StickerSetCovered> = messages.ArchivedStickers;
@ -729,7 +733,7 @@ game#bdf9653b flags:# id:long access_hash:long short_name:string title:string de
inputGameID#32c3e77 id:long access_hash:long = InputGame;
inputGameShortName#c331e80a bot_id:InputUser short_name:string = InputGame;
highScore#58fffcd0 pos:int user_id:int score:int = HighScore;
highScore#73a379eb pos:int user_id:long score:int = HighScore;
messages.highScores#9a3bfd99 scores:Vector<HighScore> users:Vector<User> = messages.HighScores;
@ -809,14 +813,14 @@ inputWebFileGeoPointLocation#9f2221c9 geo_point:InputGeoPoint access_hash:long w
upload.webFile#21e753bc size:int mime_type:string file_type:storage.FileType mtime:int bytes:bytes = upload.WebFile;
payments.paymentForm#8d0b2415 flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:int invoice:Invoice provider_id:int url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
payments.paymentForm#1694761b flags:# can_save_credentials:flags.2?true password_missing:flags.3?true form_id:long bot_id:long invoice:Invoice provider_id:long url:string native_provider:flags.4?string native_params:flags.4?DataJSON saved_info:flags.0?PaymentRequestedInfo saved_credentials:flags.1?PaymentSavedCredentials users:Vector<User> = payments.PaymentForm;
payments.validatedRequestedInfo#d1451883 flags:# id:flags.0?string shipping_options:flags.1?Vector<ShippingOption> = payments.ValidatedRequestedInfo;
payments.paymentResult#4e5f810d updates:Updates = payments.PaymentResult;
payments.paymentVerificationNeeded#d8411139 url:string = payments.PaymentResult;
payments.paymentReceipt#10b555d0 flags:# date:int bot_id:int provider_id:int title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
payments.paymentReceipt#70c4fe03 flags:# date:int bot_id:long provider_id:long title:string description:string photo:flags.2?WebDocument invoice:Invoice info:flags.0?PaymentRequestedInfo shipping:flags.1?ShippingOption tip_amount:flags.3?long currency:string total_amount:long credentials_title:string users:Vector<User> = payments.PaymentReceipt;
payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_info:flags.0?PaymentRequestedInfo = payments.SavedInfo;
@ -834,10 +838,10 @@ inputStickerSetItem#ffa0a496 flags:# document:InputDocument emoji:string mask_co
inputPhoneCall#1e36fded id:long access_hash:long = InputPhoneCall;
phoneCallEmpty#5366c915 id:long = PhoneCall;
phoneCallWaiting#1b8f4ad1 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;
phoneCallRequested#87eabb53 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCallAccepted#997c454a flags:# video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_b:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCall#8742ae7f flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:int participant_id:int g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall;
phoneCallWaiting#c5226f17 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long protocol:PhoneCallProtocol receive_date:flags.0?int = PhoneCall;
phoneCallRequested#14b0ed0c flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_hash:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCallAccepted#3660c311 flags:# video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_b:bytes protocol:PhoneCallProtocol = PhoneCall;
phoneCall#967f7c67 flags:# p2p_allowed:flags.5?true video:flags.6?true id:long access_hash:long date:int admin_id:long participant_id:long g_a_or_b:bytes key_fingerprint:long protocol:PhoneCallProtocol connections:Vector<PhoneConnection> start_date:int = PhoneCall;
phoneCallDiscarded#50ca4de1 flags:# need_rating:flags.2?true need_debug:flags.3?true video:flags.6?true id:long reason:flags.0?PhoneCallDiscardReason duration:flags.1?int = PhoneCall;
phoneConnection#9d4c17c0 id:long ip:string ipv6:string port:int peer_tag:bytes = PhoneConnection;
@ -880,7 +884,7 @@ channelAdminLogEventActionChangeStickerSet#b1c3caa7 prev_stickerset:InputSticker
channelAdminLogEventActionTogglePreHistoryHidden#5f5c95f1 new_value:Bool = ChannelAdminLogEventAction;
channelAdminLogEventActionDefaultBannedRights#2df5fc0a prev_banned_rights:ChatBannedRights new_banned_rights:ChatBannedRights = ChannelAdminLogEventAction;
channelAdminLogEventActionStopPoll#8f079643 message:Message = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeLinkedChat#a26f881b prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeLinkedChat#50c7ac8 prev_value:long new_value:long = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeLocation#e6b76ae prev_value:ChannelLocation new_value:ChannelLocation = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleSlowMode#53909779 prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEventActionStartGroupCall#23209745 call:InputGroupCall = ChannelAdminLogEventAction;
@ -894,9 +898,8 @@ channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvit
channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEventActionChangeTheme#fe69018d prev_value:string new_value:string = ChannelAdminLogEventAction;
channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
channelAdminLogEvent#1fad68cd id:long date:int user_id:long action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
channels.adminLogResults#ed8af74d events:Vector<ChannelAdminLogEvent> chats:Vector<Chat> users:Vector<User> = channels.AdminLogResults;
@ -905,11 +908,11 @@ channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?tru
popularContact#5ce14175 client_id:long importers:int = PopularContact;
messages.favedStickersNotModified#9e8fa6d3 = messages.FavedStickers;
messages.favedStickers#f37f2f16 hash:int packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;
messages.favedStickers#2cb51097 hash:long packs:Vector<StickerPack> stickers:Vector<Document> = messages.FavedStickers;
recentMeUrlUnknown#46e1d13d url:string = RecentMeUrl;
recentMeUrlUser#8dbc3336 url:string user_id:int = RecentMeUrl;
recentMeUrlChat#a01b22f9 url:string chat_id:int = RecentMeUrl;
recentMeUrlUser#b92c09e2 url:string user_id:long = RecentMeUrl;
recentMeUrlChat#b2da71d2 url:string chat_id:long = RecentMeUrl;
recentMeUrlChatInvite#eb49081d url:string chat_invite:ChatInvite = RecentMeUrl;
recentMeUrlStickerSet#bc0a57dc url:string set:StickerSetCovered = RecentMeUrl;
@ -917,7 +920,7 @@ help.recentMeUrls#e0310d7 urls:Vector<RecentMeUrl> chats:Vector<Chat> users:Vect
inputSingleMedia#1cc6e91f flags:# media:InputMedia random_id:long message:string entities:flags.0?Vector<MessageEntity> = InputSingleMedia;
webAuthorization#cac943f2 hash:long bot_id:int domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;
webAuthorization#a6f8f452 hash:long bot_id:long domain:string browser:string platform:string date_created:int date_active:int ip:string region:string = WebAuthorization;
account.webAuthorizations#ed56c9fc authorizations:Vector<WebAuthorization> users:Vector<User> = account.WebAuthorizations;
@ -933,7 +936,7 @@ dialogPeer#e56dbf05 peer:Peer = DialogPeer;
dialogPeerFolder#514519e2 folder_id:int = DialogPeer;
messages.foundStickerSetsNotModified#d54b65d = messages.FoundStickerSets;
messages.foundStickerSets#5108d648 hash:int sets:Vector<StickerSetCovered> = messages.FoundStickerSets;
messages.foundStickerSets#8af09dd2 hash:long sets:Vector<StickerSetCovered> = messages.FoundStickerSets;
fileHash#6242c773 offset:int limit:int hash:bytes = FileHash;
@ -1052,7 +1055,7 @@ poll#86e18161 id:long flags:# closed:flags.0?true public_voters:flags.1?true mul
pollAnswerVoters#3b6ddad2 flags:# chosen:flags.0?true correct:flags.1?true option:bytes voters:int = PollAnswerVoters;
pollResults#badcc1a3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<int> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
pollResults#dcb82ea3 flags:# min:flags.0?true results:flags.1?Vector<PollAnswerVoters> total_voters:flags.2?int recent_voters:flags.3?Vector<long> solution:flags.4?string solution_entities:flags.4?Vector<MessageEntity> = PollResults;
chatOnlines#f041e250 onlines:int = ChatOnlines;
@ -1067,7 +1070,7 @@ inputWallPaperSlug#72091c80 slug:string = InputWallPaper;
inputWallPaperNoFile#967a462e id:long = InputWallPaper;
account.wallPapersNotModified#1c199183 = account.WallPapers;
account.wallPapers#702b65a9 hash:int wallpapers:Vector<WallPaper> = account.WallPapers;
account.wallPapers#cdc3858c hash:long wallpapers:Vector<WallPaper> = account.WallPapers;
codeSettings#debebe83 flags:# allow_flashcall:flags.0?true current_number:flags.1?true allow_app_hash:flags.4?true = CodeSettings;
@ -1112,7 +1115,7 @@ inputThemeSlug#f5890df1 slug:string = InputTheme;
theme#e802b8dc flags:# creator:flags.0?true default:flags.1?true for_chat:flags.5?true id:long access_hash:long slug:string title:string document:flags.2?Document settings:flags.3?ThemeSettings installs_count:flags.4?int = Theme;
account.themesNotModified#f41eb622 = account.Themes;
account.themes#7f676421 hash:int themes:Vector<Theme> = account.Themes;
account.themes#9a3d8c6d hash:long themes:Vector<Theme> = account.Themes;
auth.loginToken#629f1980 expires:int token:bytes = auth.LoginToken;
auth.loginTokenMigrateTo#68e9916 dc_id:int token:bytes = auth.LoginToken;
@ -1128,15 +1131,15 @@ baseThemeNight#b7b31ea8 = BaseTheme;
baseThemeTinted#6d5f77ee = BaseTheme;
baseThemeArctic#5b11125a = BaseTheme;
inputThemeSettings#ff38f912 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int message_colors:flags.0?Vector<int> wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;
inputThemeSettings#8fde504f flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?InputWallPaper wallpaper_settings:flags.1?WallPaperSettings = InputThemeSettings;
themeSettings#8db4e76c flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int message_colors:flags.0?Vector<int> wallpaper:flags.1?WallPaper = ThemeSettings;
themeSettings#fa58b6d4 flags:# message_colors_animated:flags.2?true base_theme:BaseTheme accent_color:int outbox_accent_color:flags.3?int message_colors:flags.0?Vector<int> wallpaper:flags.1?WallPaper = ThemeSettings;
webPageAttributeTheme#54b56617 flags:# documents:flags.0?Vector<Document> settings:flags.1?ThemeSettings = WebPageAttribute;
messageUserVote#a28e5559 user_id:int option:bytes date:int = MessageUserVote;
messageUserVoteInputOption#36377430 user_id:int date:int = MessageUserVote;
messageUserVoteMultiple#e8fe0de user_id:int options:Vector<bytes> date:int = MessageUserVote;
messageUserVote#34d247b4 user_id:long option:bytes date:int = MessageUserVote;
messageUserVoteInputOption#3ca5b0ec user_id:long date:int = MessageUserVote;
messageUserVoteMultiple#8a65e557 user_id:long options:Vector<bytes> date:int = MessageUserVote;
messages.votesList#823f649 flags:# count:int votes:Vector<MessageUserVote> users:Vector<User> next_offset:flags.0?string = messages.VotesList;
@ -1167,11 +1170,11 @@ help.promoData#8c39793f flags:# proxy:flags.0?true expires:int peer:Peer chats:V
videoSize#de33b094 flags:# type:string w:int h:int size:int video_start_ts:flags.0?double = VideoSize;
statsGroupTopPoster#18f3d0f7 user_id:int messages:int avg_chars:int = StatsGroupTopPoster;
statsGroupTopPoster#9d04af9b user_id:long messages:int avg_chars:int = StatsGroupTopPoster;
statsGroupTopAdmin#6014f412 user_id:int deleted:int kicked:int banned:int = StatsGroupTopAdmin;
statsGroupTopAdmin#d7584c87 user_id:long deleted:int kicked:int banned:int = StatsGroupTopAdmin;
statsGroupTopInviter#31962a4c user_id:int invitations:int = StatsGroupTopInviter;
statsGroupTopInviter#535f779d user_id:long invitations:int = StatsGroupTopInviter;
stats.megagroupStats#ef7ff916 period:StatsDateRangeDays members:StatsAbsValueAndPrev messages:StatsAbsValueAndPrev viewers:StatsAbsValueAndPrev posters:StatsAbsValueAndPrev growth_graph:StatsGraph members_graph:StatsGraph new_members_by_source_graph:StatsGraph languages_graph:StatsGraph messages_graph:StatsGraph actions_graph:StatsGraph top_hours_graph:StatsGraph weekdays_graph:StatsGraph top_posters:Vector<StatsGroupTopPoster> top_admins:Vector<StatsGroupTopAdmin> top_inviters:Vector<StatsGroupTopInviter> users:Vector<User> = stats.MegagroupStats;
@ -1192,7 +1195,7 @@ messages.discussionMessage#a6341782 flags:# messages:Vector<Message> max_id:flag
messageReplyHeader#a6d57763 flags:# reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader;
messageReplies#4128faac flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?int max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector<Peer> channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies;
peerBlocked#e8fd8014 peer_id:Peer date:int = PeerBlocked;
@ -1221,7 +1224,7 @@ messages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true
messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector<int> = messages.AffectedFoundMessages;
chatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter;
chatInviteImporter#b5cd5f4 user_id:long date:int = ChatInviteImporter;
messages.exportedChatInvites#bdc62dcc count:int invites:Vector<ExportedChatInvite> users:Vector<User> = messages.ExportedChatInvites;
@ -1230,7 +1233,7 @@ messages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invit
messages.chatInviteImporters#81b6b00a count:int importers:Vector<ChatInviteImporter> users:Vector<User> = messages.ChatInviteImporters;
chatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites;
chatAdminWithInvites#f2ecef23 admin_id:long invites_count:int revoked_invites_count:int = ChatAdminWithInvites;
messages.chatAdminsWithInvites#b69b72d7 admins:Vector<ChatAdminWithInvites> users:Vector<User> = messages.ChatAdminsWithInvites;
@ -1283,7 +1286,7 @@ auth.signIn#bcd51581 phone_number:string phone_code_hash:string phone_code:strin
auth.logOut#5717da40 = Bool;
auth.resetAuthorizations#9fab0d1a = Bool;
auth.exportAuthorization#e5bfffcd dc_id:int = auth.ExportedAuthorization;
auth.importAuthorization#e3ef9613 id:int bytes:bytes = auth.Authorization;
auth.importAuthorization#a57a7dad id:long bytes:bytes = auth.Authorization;
auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:long nonce:long expires_at:int encrypted_message:bytes = Bool;
auth.importBotAuthorization#67a3ff2c flags:int api_id:int api_hash:string bot_auth_token:string = auth.Authorization;
auth.checkPassword#d18b4d16 password:InputCheckPasswordSRP = auth.Authorization;
@ -1292,19 +1295,19 @@ auth.recoverPassword#37096c70 flags:# code:string new_settings:flags.0?account.P
auth.resendCode#3ef1a9bf phone_number:string phone_code_hash:string = auth.SentCode;
auth.cancelCode#1f040578 phone_number:string phone_code_hash:string = Bool;
auth.dropTempAuthKeys#8e48a188 except_auth_keys:Vector<long> = Bool;
auth.exportLoginToken#b1b41517 api_id:int api_hash:string except_ids:Vector<int> = auth.LoginToken;
auth.exportLoginToken#b7e085fe api_id:int api_hash:string except_ids:Vector<long> = auth.LoginToken;
auth.importLoginToken#95ac5ce4 token:bytes = auth.LoginToken;
auth.acceptLoginToken#e894ad4d token:bytes = Authorization;
auth.checkRecoveryPassword#d36bf79 code:string = Bool;
account.registerDevice#68976c6f flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<int> = Bool;
account.unregisterDevice#3076c4bf token_type:int token:string other_uids:Vector<int> = Bool;
account.registerDevice#ec86017a flags:# no_muted:flags.0?true token_type:int token:string app_sandbox:Bool secret:bytes other_uids:Vector<long> = Bool;
account.unregisterDevice#6a0d3206 token_type:int token:string other_uids:Vector<long> = Bool;
account.updateNotifySettings#84be5b93 peer:InputNotifyPeer settings:InputPeerNotifySettings = Bool;
account.getNotifySettings#12b3ad31 peer:InputNotifyPeer = PeerNotifySettings;
account.resetNotifySettings#db7e1747 = Bool;
account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;
account.updateStatus#6628562c offline:Bool = Bool;
account.getWallPapers#aabb1763 hash:int = account.WallPapers;
account.getWallPapers#7967d36 hash:long = account.WallPapers;
account.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool;
account.checkUsername#2714d86c username:string = Bool;
account.updateUsername#3e0bdd7c username:string = User;
@ -1331,8 +1334,8 @@ account.getAllSecureValues#b288bc7d = Vector<SecureValue>;
account.getSecureValue#73665bc2 types:Vector<SecureValueType> = Vector<SecureValue>;
account.saveSecureValue#899fe31d value:InputSecureValue secure_secret_id:long = SecureValue;
account.deleteSecureValue#b880bc4b types:Vector<SecureValueType> = Bool;
account.getAuthorizationForm#b86ba8e1 bot_id:int scope:string public_key:string = account.AuthorizationForm;
account.acceptAuthorization#e7027c94 bot_id:int scope:string public_key:string value_hashes:Vector<SecureValueHash> credentials:SecureCredentialsEncrypted = Bool;
account.getAuthorizationForm#a929597a bot_id:long scope:string public_key:string = account.AuthorizationForm;
account.acceptAuthorization#f3ed4c73 bot_id:long scope:string public_key:string value_hashes:Vector<SecureValueHash> credentials:SecureCredentialsEncrypted = Bool;
account.sendVerifyPhoneCode#a5a356f9 phone_number:string settings:CodeSettings = auth.SentCode;
account.verifyPhone#4dd3a7f6 phone_number:string phone_code_hash:string phone_code:string = Bool;
account.sendVerifyEmailCode#7011509f email:string = account.SentEmailCode;
@ -1358,7 +1361,7 @@ account.updateTheme#5cb367d5 flags:# format:string theme:InputTheme slug:flags.0
account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool;
account.installTheme#7ae43737 flags:# dark:flags.0?true format:flags.1?string theme:flags.1?InputTheme = Bool;
account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme;
account.getThemes#285946f8 format:string hash:int = account.Themes;
account.getThemes#7206e458 format:string hash:long = account.Themes;
account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool;
account.getContentSettings#8b9b4dae = account.ContentSettings;
account.getMultiWallPapers#65ad71dc wallpapers:Vector<InputWallPaper> = Vector<WallPaper>;
@ -1373,9 +1376,9 @@ users.getUsers#d91a548 id:Vector<InputUser> = Vector<User>;
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
users.setSecureValueErrors#90c894b5 id:InputUser errors:Vector<SecureValueError> = Bool;
contacts.getContactIDs#2caa4a42 hash:int = Vector<int>;
contacts.getContactIDs#7adc669d hash:long = Vector<int>;
contacts.getStatuses#c4a353ee = Vector<ContactStatus>;
contacts.getContacts#c023849f hash:int = contacts.Contacts;
contacts.getContacts#5dd69e12 hash:long = contacts.Contacts;
contacts.importContacts#2c800be5 contacts:Vector<InputContact> = contacts.ImportedContacts;
contacts.deleteContacts#96a0e00 id:Vector<InputUser> = Updates;
contacts.deleteByPhones#1013fd9e phones:Vector<string> = Bool;
@ -1384,7 +1387,7 @@ contacts.unblock#bea65d50 id:InputPeer = Bool;
contacts.getBlocked#f57c350f offset:int limit:int = contacts.Blocked;
contacts.search#11f812d8 q:string limit:int = contacts.Found;
contacts.resolveUsername#f93ccba3 username:string = contacts.ResolvedPeer;
contacts.getTopPeers#d4982db5 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:int = contacts.TopPeers;
contacts.getTopPeers#973478b6 flags:# correspondents:flags.0?true bots_pm:flags.1?true bots_inline:flags.2?true phone_calls:flags.3?true forward_users:flags.4?true forward_chats:flags.5?true groups:flags.10?true channels:flags.15?true offset:int limit:int hash:long = contacts.TopPeers;
contacts.resetTopPeerRating#1ae373ac category:TopPeerCategory peer:InputPeer = Bool;
contacts.resetSaved#879537f1 = Bool;
contacts.getSaved#82f1e39f = Vector<SavedContact>;
@ -1395,9 +1398,9 @@ contacts.getLocated#d348bc44 flags:# background:flags.1?true geo_point:InputGeoP
contacts.blockFromReplies#29a8962c flags:# delete_message:flags.0?true delete_history:flags.1?true report_spam:flags.2?true msg_id:int = Updates;
messages.getMessages#63c66506 id:Vector<InputMessage> = messages.Messages;
messages.getDialogs#a0ee3b73 flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:int = messages.Dialogs;
messages.getHistory#dcbb8260 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
messages.search#c352eec flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
messages.getDialogs#a0f4cb4f flags:# exclude_pinned:flags.0?true folder_id:flags.1?int offset_date:int offset_id:int offset_peer:InputPeer limit:int hash:long = messages.Dialogs;
messages.getHistory#4423e6c5 peer:InputPeer offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.search#a0fda762 flags:# peer:InputPeer q:string from_id:flags.0?InputPeer top_msg_id:flags.1?int filter:MessagesFilter min_date:int max_date:int offset_id:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.readHistory#e306d3a peer:InputPeer max_id:int = messages.AffectedMessages;
messages.deleteHistory#1c015b09 flags:# just_clear:flags.0?true revoke:flags.1?true peer:InputPeer max_id:int = messages.AffectedHistory;
messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector<int> = messages.AffectedMessages;
@ -1409,12 +1412,12 @@ messages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings;
messages.report#8953ab4e peer:InputPeer id:Vector<int> reason:ReportReason message:string = Bool;
messages.getChats#3c6aa187 id:Vector<int> = messages.Chats;
messages.getFullChat#3b831c66 chat_id:int = messages.ChatFull;
messages.editChatTitle#dc452855 chat_id:int title:string = Updates;
messages.editChatPhoto#ca4c79d8 chat_id:int photo:InputChatPhoto = Updates;
messages.addChatUser#f9a0aa09 chat_id:int user_id:InputUser fwd_limit:int = Updates;
messages.deleteChatUser#c534459a flags:# revoke_history:flags.0?true chat_id:int user_id:InputUser = Updates;
messages.getChats#49e9528f id:Vector<long> = messages.Chats;
messages.getFullChat#aeb00b34 chat_id:long = messages.ChatFull;
messages.editChatTitle#73783ffd chat_id:long title:string = Updates;
messages.editChatPhoto#35ddd674 chat_id:long photo:InputChatPhoto = Updates;
messages.addChatUser#f24753e3 chat_id:long user_id:InputUser fwd_limit:int = Updates;
messages.deleteChatUser#a2185cab flags:# revoke_history:flags.0?true chat_id:long user_id:InputUser = Updates;
messages.createChat#9cb126e users:Vector<InputUser> title:string = Updates;
messages.getDhConfig#26cf8950 version:int random_length:int = messages.DhConfig;
messages.requestEncryption#f64daf43 user_id:InputUser random_id:int g_a:bytes = EncryptedChat;
@ -1428,8 +1431,8 @@ messages.sendEncryptedService#32d439a4 peer:InputEncryptedChat random_id:long da
messages.receivedQueue#55a5bb66 max_qts:int = Vector<long>;
messages.reportEncryptedSpam#4b0c8c0f peer:InputEncryptedChat = Bool;
messages.readMessageContents#36a73f77 id:Vector<int> = messages.AffectedMessages;
messages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers;
messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;
messages.getStickers#d5a5d3a1 emoticon:string hash:long = messages.Stickers;
messages.getAllStickers#b8a0a1a8 hash:long = messages.AllStickers;
messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector<MessageEntity> = MessageMedia;
messages.exportChatInvite#14b9bcd7 flags:# legacy_revoke_permanent:flags.2?true peer:InputPeer expire_date:flags.0?int usage_limit:flags.1?int = ExportedChatInvite;
messages.checkChatInvite#3eadb1bb hash:string = ChatInvite;
@ -1439,12 +1442,12 @@ messages.installStickerSet#c78fe460 stickerset:InputStickerSet archived:Bool = m
messages.uninstallStickerSet#f96e55de stickerset:InputStickerSet = Bool;
messages.startBot#e6df7378 bot:InputUser peer:InputPeer random_id:long start_param:string = Updates;
messages.getMessagesViews#5784d3e1 peer:InputPeer id:Vector<int> increment:Bool = messages.MessageViews;
messages.editChatAdmin#a9e69f2e chat_id:int user_id:InputUser is_admin:Bool = Bool;
messages.migrateChat#15a3b8e3 chat_id:int = Updates;
messages.editChatAdmin#a85bd1c2 chat_id:long user_id:InputUser is_admin:Bool = Bool;
messages.migrateChat#a2875319 chat_id:long = Updates;
messages.searchGlobal#4bc6589a flags:# folder_id:flags.0?int q:string filter:MessagesFilter min_date:int max_date:int offset_rate:int offset_peer:InputPeer offset_id:int limit:int = messages.Messages;
messages.reorderStickerSets#78337739 flags:# masks:flags.0?true order:Vector<long> = Bool;
messages.getDocumentByHash#338e2464 sha256:bytes size:int mime_type:string = Document;
messages.getSavedGifs#83bf3d52 hash:int = messages.SavedGifs;
messages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs;
messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool;
messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults;
messages.setInlineBotResults#eb5ea206 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector<InputBotInlineResult> cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM = Bool;
@ -1457,20 +1460,20 @@ messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long
messages.getPeerDialogs#e470bcfd peers:Vector<InputDialogPeer> = messages.PeerDialogs;
messages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector<MessageEntity> = Bool;
messages.getAllDrafts#6a3f8d65 = Updates;
messages.getFeaturedStickers#2dacca4f hash:int = messages.FeaturedStickers;
messages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers;
messages.readFeaturedStickers#5b118126 id:Vector<long> = Bool;
messages.getRecentStickers#5ea192c9 flags:# attached:flags.0?true hash:int = messages.RecentStickers;
messages.getRecentStickers#9da9403b flags:# attached:flags.0?true hash:long = messages.RecentStickers;
messages.saveRecentSticker#392718f8 flags:# attached:flags.0?true id:InputDocument unsave:Bool = Bool;
messages.clearRecentStickers#8999602d flags:# attached:flags.0?true = Bool;
messages.getArchivedStickers#57f17692 flags:# masks:flags.0?true offset_id:long limit:int = messages.ArchivedStickers;
messages.getMaskStickers#65b8c79f hash:int = messages.AllStickers;
messages.getMaskStickers#640f82b8 hash:long = messages.AllStickers;
messages.getAttachedStickers#cc5b67cc media:InputStickeredMedia = Vector<StickerSetCovered>;
messages.setGameScore#8ef8ecc0 flags:# edit_message:flags.0?true force:flags.1?true peer:InputPeer id:int user_id:InputUser score:int = Updates;
messages.setInlineGameScore#15ad9f64 flags:# edit_message:flags.0?true force:flags.1?true id:InputBotInlineMessageID user_id:InputUser score:int = Bool;
messages.getGameHighScores#e822649d peer:InputPeer id:int user_id:InputUser = messages.HighScores;
messages.getInlineGameHighScores#f635e1b id:InputBotInlineMessageID user_id:InputUser = messages.HighScores;
messages.getCommonChats#d0a48c4 user_id:InputUser max_id:int limit:int = messages.Chats;
messages.getAllChats#eba80ff0 except_ids:Vector<int> = messages.Chats;
messages.getCommonChats#e40ca104 user_id:InputUser max_id:long limit:int = messages.Chats;
messages.getAllChats#875f74be except_ids:Vector<long> = messages.Chats;
messages.getWebPage#32ca8f91 url:string hash:int = WebPage;
messages.toggleDialogPin#a731e257 flags:# pinned:flags.0?true peer:InputDialogPeer = Bool;
messages.reorderPinnedDialogs#3b1adf37 flags:# force:flags.0?true folder_id:int order:Vector<InputDialogPeer> = Bool;
@ -1479,14 +1482,14 @@ messages.setBotShippingResults#e5f672fa flags:# query_id:long error:flags.0?stri
messages.setBotPrecheckoutResults#9c2dd95 flags:# success:flags.1?true query_id:long error:flags.0?string = Bool;
messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia;
messages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates;
messages.getFavedStickers#21ce0b0e hash:int = messages.FavedStickers;
messages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers;
messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool;
messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages;
messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory;
messages.getRecentLocations#bbc45b09 peer:InputPeer limit:int hash:int = messages.Messages;
messages.getRecentLocations#702a40e0 peer:InputPeer limit:int hash:long = messages.Messages;
messages.sendMultiMedia#cc0110cb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector<InputSingleMedia> schedule_date:flags.10?int = Updates;
messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile;
messages.searchStickerSets#c2b7d08b flags:# exclude_featured:flags.0?true q:string hash:int = messages.FoundStickerSets;
messages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets;
messages.getSplitRanges#1cff7e08 = Vector<MessageRange>;
messages.markDialogUnread#c286d98f flags:# unread:flags.0?true peer:InputDialogPeer = Bool;
messages.getDialogUnreadMarks#22e24e22 = Vector<DialogPeer>;
@ -1506,7 +1509,7 @@ messages.getSearchCounters#732eef00 peer:InputPeer filters:Vector<MessagesFilter
messages.requestUrlAuth#198fb446 flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;
messages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult;
messages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool;
messages.getScheduledHistory#e2c2685b peer:InputPeer hash:int = messages.Messages;
messages.getScheduledHistory#f516760b peer:InputPeer hash:long = messages.Messages;
messages.getScheduledMessages#bdbb0464 peer:InputPeer id:Vector<int> = messages.Messages;
messages.sendScheduledMessages#bd38850a peer:InputPeer id:Vector<int> = Updates;
messages.deleteScheduledMessages#59ae2b16 peer:InputPeer id:Vector<int> = Updates;
@ -1516,12 +1519,12 @@ messages.getDialogFilters#f19ed96d = Vector<DialogFilter>;
messages.getSuggestedDialogFilters#a29cd42c = Vector<DialogFilterSuggested>;
messages.updateDialogFilter#1ad4a04a flags:# id:int filter:flags.0?DialogFilter = Bool;
messages.updateDialogFiltersOrder#c563c1e4 order:Vector<int> = Bool;
messages.getOldFeaturedStickers#5fe7025b offset:int limit:int hash:int = messages.FeaturedStickers;
messages.getReplies#24b581ba peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:int = messages.Messages;
messages.getOldFeaturedStickers#7ed094a1 offset:int limit:int hash:long = messages.FeaturedStickers;
messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages;
messages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage;
messages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool;
messages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory;
messages.deleteChat#83247d11 chat_id:int = Bool;
messages.deleteChat#5bd0ee50 chat_id:long = Bool;
messages.deletePhoneCallHistory#f9cbe409 flags:# revoke:flags.0?true = messages.AffectedFoundMessages;
messages.checkHistoryImport#43fe19f3 import_head:string = messages.HistoryImportParsed;
messages.initHistoryImport#34090c3b peer:InputPeer file:InputFile media_count:int = messages.HistoryImport;
@ -1537,6 +1540,7 @@ messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date:
messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
messages.setChatTheme#e63be13f peer:InputPeer emoticon:string = Updates;
messages.getMessageReadParticipants#2c6f97b7 peer:InputPeer msg_id:int = Vector<long>;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
@ -1584,7 +1588,7 @@ channels.deleteMessages#84c1fd4e channel:InputChannel id:Vector<int> = messages.
channels.deleteUserHistory#d10dd71b channel:InputChannel user_id:InputUser = messages.AffectedHistory;
channels.reportSpam#fe087810 channel:InputChannel user_id:InputUser id:Vector<int> = Bool;
channels.getMessages#ad8c9a23 channel:InputChannel id:Vector<InputMessage> = messages.Messages;
channels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:int = channels.ChannelParticipants;
channels.getParticipants#77ced9d0 channel:InputChannel filter:ChannelParticipantsFilter offset:int limit:int hash:long = channels.ChannelParticipants;
channels.getParticipant#a0ab6cc6 channel:InputChannel participant:InputPeer = channels.ChannelParticipant;
channels.getChannels#a7f6bbb id:Vector<InputChannel> = messages.Chats;
channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;

View File

@ -1 +0,0 @@
build/

View File

@ -1 +0,0 @@
Parse tl scheme to tlo file. Formely part of telegram-cli

View File

@ -0,0 +1,37 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/mtproto/ConnectionManager.h"
namespace td {
namespace mtproto {
void ConnectionManager::inc_connect() {
auto &cnt = get_link_token() == 1 ? connect_cnt_ : connect_proxy_cnt_;
cnt++;
if (cnt == 1) {
loop();
}
}
void ConnectionManager::dec_connect() {
auto &cnt = get_link_token() == 1 ? connect_cnt_ : connect_proxy_cnt_;
CHECK(cnt > 0);
cnt--;
if (cnt == 0) {
loop();
}
}
ConnectionManager::ConnectionToken ConnectionManager::connection_impl(ActorId<ConnectionManager> connection_manager,
int mode) {
auto actor = ActorShared<ConnectionManager>(connection_manager, mode);
send_closure(actor, &ConnectionManager::inc_connect);
return ConnectionToken(std::move(actor));
}
} // namespace mtproto
} // namespace td

View File

@ -0,0 +1,70 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/actor/actor.h"
#include "td/utils/common.h"
namespace td {
namespace mtproto {
class ConnectionManager : public Actor {
public:
class ConnectionToken {
public:
ConnectionToken() = default;
explicit ConnectionToken(ActorShared<ConnectionManager> connection_manager)
: connection_manager_(std::move(connection_manager)) {
}
ConnectionToken(const ConnectionToken &) = delete;
ConnectionToken &operator=(const ConnectionToken &) = delete;
ConnectionToken(ConnectionToken &&) = default;
ConnectionToken &operator=(ConnectionToken &&other) {
reset();
connection_manager_ = std::move(other.connection_manager_);
return *this;
}
~ConnectionToken() {
reset();
}
void reset() {
if (!connection_manager_.empty()) {
send_closure(connection_manager_, &ConnectionManager::dec_connect);
connection_manager_.reset();
}
}
bool empty() const {
return connection_manager_.empty();
}
private:
ActorShared<ConnectionManager> connection_manager_;
};
static ConnectionToken connection(ActorId<ConnectionManager> connection_manager) {
return connection_impl(connection_manager, 1);
}
static ConnectionToken connection_proxy(ActorId<ConnectionManager> connection_manager) {
return connection_impl(connection_manager, 2);
}
protected:
uint32 connect_cnt_ = 0;
uint32 connect_proxy_cnt_ = 0;
private:
void inc_connect();
void dec_connect();
static ConnectionToken connection_impl(ActorId<ConnectionManager> connection_manager, int mode);
};
} // namespace mtproto
} // namespace td

View File

@ -11,7 +11,7 @@
#include "td/mtproto/ProxySecret.h"
#include "td/mtproto/Transport.h"
#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
#include "td/net/DarwinHttp.h"
#endif
@ -42,7 +42,7 @@ class RawConnectionDefault final : public RawConnection {
transport_->init(&socket_fd_.input_buffer(), &socket_fd_.output_buffer());
}
void set_connection_token(StateManager::ConnectionToken connection_token) final {
void set_connection_token(ConnectionManager::ConnectionToken connection_token) final {
connection_token_ = std::move(connection_token);
}
@ -135,7 +135,7 @@ class RawConnectionDefault final : public RawConnection {
unique_ptr<StatsCallback> stats_callback_;
StateManager::ConnectionToken connection_token_;
ConnectionManager::ConnectionToken connection_token_;
Status flush_read(const AuthKey &auth_key, Callback &callback) {
auto r = socket_fd_.flush_read();
@ -259,7 +259,7 @@ class RawConnectionDefault final : public RawConnection {
}
};
#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
class RawConnectionHttp final : public RawConnection {
public:
RawConnectionHttp(IPAddress ip_address, unique_ptr<StatsCallback> stats_callback)
@ -268,7 +268,7 @@ class RawConnectionHttp final : public RawConnection {
answers_->init();
}
void set_connection_token(StateManager::ConnectionToken connection_token) final {
void set_connection_token(ConnectionManager::ConnectionToken connection_token) final {
connection_token_ = std::move(connection_token);
}
@ -348,7 +348,7 @@ class RawConnectionHttp final : public RawConnection {
unique_ptr<StatsCallback> stats_callback_;
StateManager::ConnectionToken connection_token_;
ConnectionManager::ConnectionToken connection_token_;
std::shared_ptr<MpscPollableQueue<Result<BufferSlice>>> answers_;
std::vector<BufferSlice> to_send_;
@ -452,7 +452,7 @@ class RawConnectionHttp final : public RawConnection {
unique_ptr<RawConnection> RawConnection::create(IPAddress ip_address, SocketFd socket_fd, TransportType transport_type,
unique_ptr<StatsCallback> stats_callback) {
#if TD_EXPERIMENTAL_WATCH_OS
#if TD_DARWIN_WATCH_OS
return td::make_unique<RawConnectionHttp>(ip_address, std::move(stats_callback));
#else
return td::make_unique<RawConnectionDefault>(std::move(socket_fd), transport_type, std::move(stats_callback));

View File

@ -6,8 +6,7 @@
//
#pragma once
#include "td/telegram/StateManager.h"
#include "td/mtproto/ConnectionManager.h"
#include "td/mtproto/PacketInfo.h"
#include "td/mtproto/TransportType.h"
@ -44,7 +43,7 @@ class RawConnection {
static unique_ptr<RawConnection> create(IPAddress ip_address, SocketFd socket_fd, TransportType transport_type,
unique_ptr<StatsCallback> stats_callback);
virtual void set_connection_token(StateManager::ConnectionToken connection_token) = 0;
virtual void set_connection_token(ConnectionManager::ConnectionToken connection_token) = 0;
virtual bool can_send() const = 0;
virtual TransportType get_transport_type() const = 0;

View File

@ -9,6 +9,8 @@
#include "td/mtproto/AuthData.h"
#include "td/mtproto/AuthKey.h"
#include "td/mtproto/CryptoStorer.h"
#include "td/mtproto/mtproto_api.h"
#include "td/mtproto/mtproto_api.hpp"
#include "td/mtproto/PacketStorer.h"
#include "td/mtproto/Transport.h"
#include "td/mtproto/utils.h"
@ -27,9 +29,6 @@
#include "td/utils/tl_parsers.h"
#include "td/utils/TlDowncastHelper.h"
#include "td/mtproto/mtproto_api.h"
#include "td/mtproto/mtproto_api.hpp"
#include <algorithm>
#include <iterator>
#include <type_traits>
@ -662,6 +661,7 @@ bool SessionConnection::must_flush_packet() {
}
Status SessionConnection::before_write() {
CHECK(raw_connection_);
while (must_flush_packet()) {
flush_packet();
}
@ -715,12 +715,14 @@ void SessionConnection::on_read(size_t size) {
SessionConnection::SessionConnection(Mode mode, unique_ptr<RawConnection> raw_connection, AuthData *auth_data)
: raw_connection_(std::move(raw_connection)), auth_data_(auth_data) {
CHECK(raw_connection_);
state_ = Init;
mode_ = mode;
created_at_ = Time::now();
}
PollableFdInfo &SessionConnection::get_poll_info() {
CHECK(raw_connection_);
return raw_connection_->get_poll_info();
}

View File

@ -22,12 +22,13 @@
#include "td/telegram/Td.h"
#include "td/telegram/td_api.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/TdParameters.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/PromiseFuture.h"
#include "td/db/SqliteKeyValueAsync.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/algorithm.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
@ -43,7 +44,7 @@ class GetSavedGifsQuery final : public Td::ResultHandler {
bool is_repair_ = false;
public:
void send(bool is_repair, int32 hash) {
void send(bool is_repair, int64 hash) {
is_repair_ = is_repair;
LOG(INFO) << "Send get saved animations request with hash = " << hash;
send_query(G()->net_query_creator().create(telegram_api::messages_getSavedGifs(hash)));
@ -691,9 +692,9 @@ void AnimationsManager::on_get_saved_animations_failed(bool is_repair, Status er
}
}
int32 AnimationsManager::get_saved_animations_hash(const char *source) const {
vector<uint32> numbers;
numbers.reserve(saved_animation_ids_.size() * 2);
int64 AnimationsManager::get_saved_animations_hash(const char *source) const {
vector<uint64> numbers;
numbers.reserve(saved_animation_ids_.size());
for (auto animation_id : saved_animation_ids_) {
auto animation = get_animation(animation_id);
if (animation == nullptr) {
@ -705,18 +706,13 @@ int32 AnimationsManager::get_saved_animations_hash(const char *source) const {
LOG(ERROR) << "Saved animation remote location is not document: " << source << " " << file_view.remote_location();
continue;
}
auto id = static_cast<uint64>(file_view.remote_location().get_id());
numbers.push_back(static_cast<uint32>(id >> 32));
numbers.push_back(static_cast<uint32>(id & 0xFFFFFFFF));
numbers.push_back(file_view.remote_location().get_id());
}
return get_vector_hash(numbers);
}
void AnimationsManager::add_saved_animation(const tl_object_ptr<td_api::InputFile> &input_file,
Promise<Unit> &&promise) {
if (td_->auth_manager_->is_bot()) {
return promise.set_error(Status::Error(7, "Method is not available for bots"));
}
if (!are_saved_animations_loaded_) {
load_saved_animations(std::move(promise));
return;
@ -724,7 +720,7 @@ void AnimationsManager::add_saved_animation(const tl_object_ptr<td_api::InputFil
auto r_file_id = td_->file_manager_->get_input_file_id(FileType::Animation, input_file, DialogId(), false, false);
if (r_file_id.is_error()) {
return promise.set_error(Status::Error(7, r_file_id.error().message())); // TODO do not drop error code
return promise.set_error(Status::Error(400, r_file_id.error().message())); // TODO do not drop error code
}
add_saved_animation_impl(r_file_id.ok(), true, std::move(promise));
@ -763,7 +759,7 @@ void AnimationsManager::add_saved_animation_impl(FileId animation_id, bool add_o
auto file_view = td_->file_manager_->get_file_view(animation_id);
if (file_view.empty()) {
return promise.set_error(Status::Error(7, "Animation file not found"));
return promise.set_error(Status::Error(400, "Animation file not found"));
}
LOG(INFO) << "Add saved animation " << animation_id << " with main file " << file_view.file_id();
@ -797,20 +793,20 @@ void AnimationsManager::add_saved_animation_impl(FileId animation_id, bool add_o
auto animation = get_animation(animation_id);
if (animation == nullptr) {
return promise.set_error(Status::Error(7, "Animation not found"));
return promise.set_error(Status::Error(400, "Animation not found"));
}
if (animation->mime_type != "video/mp4") {
return promise.set_error(Status::Error(7, "Only MPEG4 animations can be saved"));
return promise.set_error(Status::Error(400, "Only MPEG4 animations can be saved"));
}
if (!file_view.has_remote_location()) {
return promise.set_error(Status::Error(7, "Can save only sent animations"));
return promise.set_error(Status::Error(400, "Can save only sent animations"));
}
if (file_view.remote_location().is_web()) {
return promise.set_error(Status::Error(7, "Can't save web animations"));
return promise.set_error(Status::Error(400, "Can't save web animations"));
}
if (!file_view.remote_location().is_document()) {
return promise.set_error(Status::Error(7, "Can't save encrypted animations"));
return promise.set_error(Status::Error(400, "Can't save encrypted animations"));
}
auto it = std::find_if(saved_animation_ids_.begin(), saved_animation_ids_.end(), is_equal);
@ -836,9 +832,6 @@ void AnimationsManager::add_saved_animation_impl(FileId animation_id, bool add_o
void AnimationsManager::remove_saved_animation(const tl_object_ptr<td_api::InputFile> &input_file,
Promise<Unit> &&promise) {
if (td_->auth_manager_->is_bot()) {
return promise.set_error(Status::Error(7, "Method is not available for bots"));
}
if (!are_saved_animations_loaded_) {
load_saved_animations(std::move(promise));
return;
@ -846,7 +839,7 @@ void AnimationsManager::remove_saved_animation(const tl_object_ptr<td_api::Input
auto r_file_id = td_->file_manager_->get_input_file_id(FileType::Animation, input_file, DialogId(), false, false);
if (r_file_id.is_error()) {
return promise.set_error(Status::Error(7, r_file_id.error().message())); // TODO do not drop error code
return promise.set_error(Status::Error(400, r_file_id.error().message())); // TODO do not drop error code
}
FileId file_id = r_file_id.ok();
@ -856,7 +849,7 @@ void AnimationsManager::remove_saved_animation(const tl_object_ptr<td_api::Input
auto animation = get_animation(file_id);
if (animation == nullptr) {
return promise.set_error(Status::Error(7, "Animation not found"));
return promise.set_error(Status::Error(400, "Animation not found"));
}
send_save_gif_query(file_id, true, std::move(promise));

View File

@ -6,17 +6,16 @@
//
#pragma once
#include "td/telegram/files/FileId.h"
#include "td/telegram/files/FileSourceId.h"
#include "td/telegram/Photo.h"
#include "td/telegram/SecretInputMedia.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/files/FileId.h"
#include "td/telegram/files/FileSourceId.h"
#include "td/telegram/Photo.h"
#include "td/telegram/SecretInputMedia.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
@ -122,7 +121,7 @@ class AnimationsManager final : public Actor {
FileId on_get_animation(unique_ptr<Animation> new_animation, bool replace);
int32 get_saved_animations_hash(const char *source) const;
int64 get_saved_animations_hash(const char *source) const;
void add_saved_animation_impl(FileId animation_id, bool add_on_server, Promise<Unit> &&promise);

View File

@ -158,7 +158,7 @@ void AuthManager::check_bot_token(uint64 query_id, string bot_token) {
query_id, Status::Error(400, "Cannot set bot token after authentication began. You need to log out first"));
}
if (was_check_bot_token_ && bot_token_ != bot_token) {
return on_query_error(query_id, Status::Error(8, "Cannot change bot token. You need to log out first"));
return on_query_error(query_id, Status::Error(400, "Cannot change bot token. You need to log out first"));
}
on_new_query(query_id);
@ -175,13 +175,13 @@ void AuthManager::request_qr_code_authentication(uint64 query_id, vector<UserId>
net_query_id_ == 0) {
// ok
} else {
return on_query_error(query_id, Status::Error(8, "Call to requestQrCodeAuthentication unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to requestQrCodeAuthentication unexpected"));
}
}
if (was_check_bot_token_) {
return on_query_error(
query_id,
Status::Error(8,
Status::Error(400,
"Cannot request QR code authentication after bot token was entered. You need to log out first"));
}
for (auto &other_user_id : other_user_ids) {
@ -237,15 +237,15 @@ void AuthManager::set_phone_number(uint64 query_id, string phone_number,
net_query_id_ == 0) {
// ok
} else {
return on_query_error(query_id, Status::Error(8, "Call to setAuthenticationPhoneNumber unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to setAuthenticationPhoneNumber unexpected"));
}
}
if (was_check_bot_token_) {
return on_query_error(
query_id, Status::Error(8, "Cannot set phone number after bot token was entered. You need to log out first"));
query_id, Status::Error(400, "Cannot set phone number after bot token was entered. You need to log out first"));
}
if (phone_number.empty()) {
return on_query_error(query_id, Status::Error(8, "Phone number can't be empty"));
return on_query_error(query_id, Status::Error(400, "Phone number can't be empty"));
}
other_user_ids_.clear();
@ -264,7 +264,7 @@ void AuthManager::set_phone_number(uint64 query_id, string phone_number,
void AuthManager::resend_authentication_code(uint64 query_id) {
if (state_ != State::WaitCode) {
return on_query_error(query_id, Status::Error(8, "Call to resendAuthenticationCode unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to resendAuthenticationCode unexpected"));
}
auto r_resend_code = send_code_helper_.resend_code();
@ -279,7 +279,7 @@ void AuthManager::resend_authentication_code(uint64 query_id) {
void AuthManager::check_code(uint64 query_id, string code) {
if (state_ != State::WaitCode) {
return on_query_error(query_id, Status::Error(8, "Call to checkAuthenticationCode unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to checkAuthenticationCode unexpected"));
}
code_ = std::move(code);
@ -291,13 +291,13 @@ void AuthManager::check_code(uint64 query_id, string code) {
void AuthManager::register_user(uint64 query_id, string first_name, string last_name) {
if (state_ != State::WaitRegistration) {
return on_query_error(query_id, Status::Error(8, "Call to registerUser unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to registerUser unexpected"));
}
on_new_query(query_id);
first_name = clean_name(first_name, MAX_NAME_LENGTH);
if (first_name.empty()) {
return on_query_error(Status::Error(8, "First name can't be empty"));
return on_query_error(Status::Error(400, "First name can't be empty"));
}
last_name = clean_name(last_name, MAX_NAME_LENGTH);
@ -308,7 +308,7 @@ void AuthManager::register_user(uint64 query_id, string first_name, string last_
void AuthManager::check_password(uint64 query_id, string password) {
if (state_ != State::WaitPassword) {
return on_query_error(query_id, Status::Error(8, "Call to checkAuthenticationPassword unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to checkAuthenticationPassword unexpected"));
}
LOG(INFO) << "Have SRP ID " << wait_password_state_.srp_id_;
@ -323,7 +323,7 @@ void AuthManager::check_password(uint64 query_id, string password) {
void AuthManager::request_password_recovery(uint64 query_id) {
if (state_ != State::WaitPassword) {
return on_query_error(query_id, Status::Error(8, "Call to requestAuthenticationPasswordRecovery unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to requestAuthenticationPasswordRecovery unexpected"));
}
on_new_query(query_id);
@ -333,7 +333,7 @@ void AuthManager::request_password_recovery(uint64 query_id) {
void AuthManager::check_password_recovery_code(uint64 query_id, string code) {
if (state_ != State::WaitPassword) {
return on_query_error(query_id, Status::Error(8, "Call to checkAuthenticationPasswordRecoveryCode unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to checkAuthenticationPasswordRecoveryCode unexpected"));
}
on_new_query(query_id);
@ -343,7 +343,7 @@ void AuthManager::check_password_recovery_code(uint64 query_id, string code) {
void AuthManager::recover_password(uint64 query_id, string code, string new_password, string new_hint) {
if (state_ != State::WaitPassword) {
return on_query_error(query_id, Status::Error(8, "Call to recoverAuthenticationPassword unexpected"));
return on_query_error(query_id, Status::Error(400, "Call to recoverAuthenticationPassword unexpected"));
}
on_new_query(query_id);
@ -362,10 +362,10 @@ void AuthManager::recover_password(uint64 query_id, string code, string new_pass
void AuthManager::log_out(uint64 query_id) {
if (state_ == State::Closing) {
return on_query_error(query_id, Status::Error(8, "Already logged out"));
return on_query_error(query_id, Status::Error(400, "Already logged out"));
}
if (state_ == State::LoggingOut || state_ == State::DestroyingKeys) {
return on_query_error(query_id, Status::Error(8, "Already logging out"));
return on_query_error(query_id, Status::Error(400, "Already logging out"));
}
on_new_query(query_id);
if (state_ != State::Ok) {
@ -390,7 +390,7 @@ void AuthManager::send_log_out_query() {
void AuthManager::delete_account(uint64 query_id, const string &reason) {
if (state_ != State::Ok && state_ != State::WaitPassword) {
return on_query_error(query_id, Status::Error(8, "Need to log in first"));
return on_query_error(query_id, Status::Error(400, "Need to log in first"));
}
on_new_query(query_id);
LOG(INFO) << "Deleting account";
@ -408,7 +408,7 @@ void AuthManager::on_closing(bool destroy_flag) {
void AuthManager::on_new_query(uint64 query_id) {
if (query_id_ != 0) {
on_query_error(Status::Error(9, "Another authorization query has started"));
on_query_error(Status::Error(400, "Another authorization query has started"));
}
net_query_id_ = 0;
net_query_type_ = NetQueryType::None;

View File

@ -20,10 +20,10 @@
#include "td/telegram/files/FileManager.h"
#include "td/telegram/files/FileType.h"
#include "td/telegram/Global.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/Photo.h"
#include "td/telegram/Td.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/TdParameters.h"
#include "td/db/SqliteKeyValueAsync.h"
@ -413,6 +413,34 @@ void BackgroundManager::tear_down() {
parent_.reset();
}
void BackgroundManager::store_background(BackgroundId background_id, LogEventStorerCalcLength &storer) {
const auto *background = get_background(background_id);
CHECK(background != nullptr);
store(*background, storer);
}
void BackgroundManager::store_background(BackgroundId background_id, LogEventStorerUnsafe &storer) {
const auto *background = get_background(background_id);
CHECK(background != nullptr);
store(*background, storer);
}
void BackgroundManager::parse_background(BackgroundId &background_id, LogEventParser &parser) {
Background background;
parse(background, parser);
CHECK(background.has_new_local_id);
if (background.file_id.is_valid() != background.type.has_file() || !background.id.is_valid()) {
parser.set_error(PSTRING() << "Failed to load " << background.id);
background_id = BackgroundId();
return;
}
if (background.id.is_local() && !background.type.has_file() && background.id.get() > max_local_background_id_.get()) {
set_max_local_background_id(background.id);
}
background_id = background.id;
add_background(background, false);
}
void BackgroundManager::get_backgrounds(bool for_dark_theme,
Promise<td_api::object_ptr<td_api::backgrounds>> &&promise) {
pending_get_backgrounds_queries_.emplace_back(for_dark_theme, std::move(promise));
@ -1003,8 +1031,8 @@ void BackgroundManager::add_background(const Background &background, bool replac
if (result->file_id != background.file_id) {
if (result->file_id.is_valid()) {
if (td_->file_manager_->get_file_view(result->file_id).file_id() !=
td_->file_manager_->get_file_view(background.file_id).file_id()) {
if (!background.file_id.is_valid() || td_->file_manager_->get_file_view(result->file_id).file_id() !=
td_->file_manager_->get_file_view(background.file_id).file_id()) {
LOG(ERROR) << "Background file has changed from " << result->file_id << " to " << background.file_id;
file_id_to_background_id_.erase(result->file_id);
result->file_source_id = FileSourceId();

View File

@ -10,6 +10,7 @@
#include "td/telegram/BackgroundType.h"
#include "td/telegram/files/FileId.h"
#include "td/telegram/files/FileSourceId.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/Photo.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
@ -69,6 +70,12 @@ class BackgroundManager final : public Actor {
void get_current_state(vector<td_api::object_ptr<td_api::Update>> &updates) const;
void store_background(BackgroundId background_id, LogEventStorerCalcLength &storer);
void store_background(BackgroundId background_id, LogEventStorerUnsafe &storer);
void parse_background(BackgroundId &background_id, LogEventParser &parser);
private:
struct Background {
BackgroundId id;

View File

@ -6,17 +6,16 @@
//
#pragma once
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/mtproto/DhHandshake.h"
#include "td/telegram/CallDiscardReason.h"
#include "td/telegram/CallId.h"
#include "td/telegram/DhConfig.h"
#include "td/telegram/net/NetQuery.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/mtproto/DhHandshake.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"

View File

@ -6,14 +6,14 @@
//
#include "td/telegram/CallManager.h"
#include "td/telegram/telegram_api.hpp"
#include "td/utils/common.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/SliceBuilder.h"
#include "td/telegram/telegram_api.hpp"
#include <limits>
namespace td {

View File

@ -6,12 +6,6 @@
//
#include "td/telegram/CallbackQueriesManager.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/AuthManager.h"
#include "td/telegram/ContactsManager.h"
@ -20,6 +14,11 @@
#include "td/telegram/MessagesManager.h"
#include "td/telegram/PasswordManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
@ -204,7 +203,7 @@ void CallbackQueriesManager::on_new_query(int32 flags, int64 callback_query_id,
void CallbackQueriesManager::on_new_inline_query(
int32 flags, int64 callback_query_id, UserId sender_user_id,
tl_object_ptr<telegram_api::inputBotInlineMessageID> &&inline_message_id, BufferSlice &&data, int64 chat_instance,
tl_object_ptr<telegram_api::InputBotInlineMessageID> &&inline_message_id, BufferSlice &&data, int64 chat_instance,
string &&game_short_name) {
if (!sender_user_id.is_valid()) {
LOG(ERROR) << "Receive new callback query from invalid " << sender_user_id;
@ -233,32 +232,32 @@ int64 CallbackQueriesManager::send_callback_query(FullMessageId full_message_id,
tl_object_ptr<td_api::CallbackQueryPayload> &&payload,
Promise<Unit> &&promise) {
if (td_->auth_manager_->is_bot()) {
promise.set_error(Status::Error(5, "Bot can't send callback queries to other bot"));
promise.set_error(Status::Error(400, "Bot can't send callback queries to other bot"));
return 0;
}
if (payload == nullptr) {
promise.set_error(Status::Error(5, "Payload must be non-empty"));
promise.set_error(Status::Error(400, "Payload must be non-empty"));
return 0;
}
auto dialog_id = full_message_id.get_dialog_id();
td_->messages_manager_->have_dialog_force(dialog_id, "send_callback_query");
if (!td_->messages_manager_->have_input_peer(dialog_id, AccessRights::Read)) {
promise.set_error(Status::Error(5, "Can't access the chat"));
promise.set_error(Status::Error(400, "Can't access the chat"));
return 0;
}
if (!td_->messages_manager_->have_message_force(full_message_id, "send_callback_query")) {
promise.set_error(Status::Error(5, "Message not found"));
promise.set_error(Status::Error(400, "Message not found"));
return 0;
}
if (full_message_id.get_message_id().is_valid_scheduled()) {
promise.set_error(Status::Error(5, "Can't send callback queries from scheduled messages"));
promise.set_error(Status::Error(400, "Can't send callback queries from scheduled messages"));
return 0;
}
if (!full_message_id.get_message_id().is_server()) {
promise.set_error(Status::Error(5, "Bad message identifier"));
promise.set_error(Status::Error(400, "Bad message identifier"));
return 0;
}
@ -299,7 +298,7 @@ void CallbackQueriesManager::send_get_callback_answer_query(
return promise.set_error(Status::Error(400, "Can't access the chat"));
}
if (!td_->messages_manager_->have_message_force(full_message_id, "send_callback_query")) {
return promise.set_error(Status::Error(5, "Message not found"));
return promise.set_error(Status::Error(400, "Message not found"));
}
td_->create_handler<GetBotCallbackAnswerQuery>(std::move(promise))

View File

@ -36,7 +36,7 @@ class CallbackQueriesManager {
MessageId message_id, BufferSlice &&data, int64 chat_instance, string &&game_short_name);
void on_new_inline_query(int32 flags, int64 callback_query_id, UserId sender_user_id,
tl_object_ptr<telegram_api::inputBotInlineMessageID> &&inline_message_id, BufferSlice &&data,
tl_object_ptr<telegram_api::InputBotInlineMessageID> &&inline_message_id, BufferSlice &&data,
int64 chat_instance, string &&game_short_name);
int64 send_callback_query(FullMessageId full_message_id, tl_object_ptr<td_api::CallbackQueryPayload> &&payload,

View File

@ -6,6 +6,8 @@
//
#pragma once
#include "td/telegram/Version.h"
#include "td/utils/common.h"
#include "td/utils/StringBuilder.h"
@ -16,22 +18,25 @@
namespace td {
class ChannelId {
int32 id = 0;
int64 id = 0;
int64 time_ = INT64_MAX;
public:
// the last (1 << 31) - 1 identifiers will be used for secret chat dialog identifiers
static constexpr int64 MAX_CHANNEL_ID = 1000000000000ll - (1ll << 31);
ChannelId() = default;
explicit ChannelId(int32 channel_id) : id(channel_id) {
explicit ChannelId(int64 channel_id) : id(channel_id) {
}
template <class T, typename = std::enable_if_t<std::is_convertible<T, int32>::value>>
template <class T, typename = std::enable_if_t<std::is_convertible<T, int64>::value>>
ChannelId(T channel_id) = delete;
bool is_valid() const {
return id > 0; // TODO better is_valid
return 0 < id && id < MAX_CHANNEL_ID;
}
int32 get() const {
int64 get() const {
return id;
}
@ -57,18 +62,22 @@ class ChannelId {
template <class StorerT>
void store(StorerT &storer) const {
storer.store_int(id);
storer.store_long(id);
}
template <class ParserT>
void parse(ParserT &parser) {
id = parser.fetch_int();
if (parser.version() >= static_cast<int32>(Version::Support64BitIds)) {
id = parser.fetch_long();
} else {
id = parser.fetch_int();
}
}
};
struct ChannelIdHash {
std::size_t operator()(ChannelId channel_id) const {
return std::hash<int32>()(channel_id.get());
return std::hash<int64>()(channel_id.get());
}
};

View File

@ -6,6 +6,8 @@
//
#pragma once
#include "td/telegram/Version.h"
#include "td/utils/common.h"
#include "td/utils/StringBuilder.h"
@ -16,25 +18,27 @@
namespace td {
class ChatId {
int32 id = 0;
int64 id = 0;
int64 time_ = INT64_MAX;
public:
static constexpr int64 MAX_CHAT_ID = 999999999999ll;
explicit ChatId() {
set_time();
};
explicit ChatId(int32 chat_id) : id(chat_id) {
explicit ChatId(int64 chat_id) : id(chat_id) {
set_time();
}
template <class T, typename = std::enable_if_t<std::is_convertible<T, int32>::value>>
template <class T, typename = std::enable_if_t<std::is_convertible<T, int64>::value>>
ChatId(T chat_id) = delete;
bool is_valid() const {
return id > 0;
return 0 < id && id <= MAX_CHAT_ID;
}
int32 get() const {
int64 get() const {
return id;
}
@ -60,18 +64,22 @@ class ChatId {
template <class StorerT>
void store(StorerT &storer) const {
storer.store_int(id);
storer.store_long(id);
}
template <class ParserT>
void parse(ParserT &parser) {
id = parser.fetch_int();
if (parser.version() >= static_cast<int32>(Version::Support64BitIds)) {
id = parser.fetch_long();
} else {
id = parser.fetch_int();
}
}
};
struct ChatIdHash {
std::size_t operator()(ChatId chat_id) const {
return std::hash<int32>()(chat_id.get());
return std::hash<int64>()(chat_id.get());
}
};

View File

@ -8,6 +8,7 @@
#include "td/telegram/AuthManager.h"
#include "td/telegram/ConfigShared.h"
#include "td/telegram/ConnectionState.h"
#include "td/telegram/Global.h"
#include "td/telegram/JsonValue.h"
#include "td/telegram/LinkManager.h"
@ -850,8 +851,8 @@ class ConfigRecoverer final : public Actor {
public:
explicit StateCallback(ActorId<ConfigRecoverer> parent) : parent_(std::move(parent)) {
}
bool on_state(StateManager::State state) final {
send_closure(parent_, &ConfigRecoverer::on_connecting, state == StateManager::State::Connecting);
bool on_state(ConnectionState state) final {
send_closure(parent_, &ConfigRecoverer::on_connecting, state == ConnectionState::Connecting);
return parent_.is_alive();
}
bool on_network(NetType network_type, uint32 network_generation) final {
@ -1487,6 +1488,8 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
string animation_search_emojis;
vector<SuggestedAction> suggested_actions;
bool can_archive_and_mute_new_chats_from_unknown_users = false;
int64 chat_read_mark_expire_period = 0;
int64 chat_read_mark_size_threshold = 0;
if (config->get_id() == telegram_api::jsonObject::ID) {
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
Slice key = key_value->key_;
@ -1676,6 +1679,15 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
}
continue;
}
if (key == "chat_read_mark_expire_period") {
chat_read_mark_expire_period = get_json_value_int(std::move(key_value->value_), "chat_read_mark_expire_period");
continue;
}
if (key == "chat_read_mark_size_threshold") {
chat_read_mark_size_threshold =
get_json_value_int(std::move(key_value->value_), "chat_read_mark_size_threshold");
continue;
}
new_values.push_back(std::move(key_value));
}
@ -1732,6 +1744,16 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
shared_config.set_option_boolean("can_archive_and_mute_new_chats_from_unknown_users",
can_archive_and_mute_new_chats_from_unknown_users);
}
if (chat_read_mark_expire_period <= 0) {
shared_config.set_option_empty("chat_read_mark_expire_period");
} else {
shared_config.set_option_integer("chat_read_mark_expire_period", chat_read_mark_expire_period);
}
if (chat_read_mark_size_threshold <= 0) {
shared_config.set_option_empty("chat_read_mark_size_threshold");
} else {
shared_config.set_option_integer("chat_read_mark_size_threshold", chat_read_mark_size_threshold);
}
shared_config.set_option_empty("default_ton_blockchain_config");
shared_config.set_option_empty("default_ton_blockchain_name");

View File

@ -0,0 +1,38 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#include "td/telegram/ConnectionState.h"
#include "td/utils/logging.h"
namespace td {
static td_api::object_ptr<td_api::ConnectionState> get_connection_state_object(ConnectionState state) {
switch (state) {
case ConnectionState::Empty:
UNREACHABLE();
return nullptr;
case ConnectionState::WaitingForNetwork:
return td_api::make_object<td_api::connectionStateWaitingForNetwork>();
case ConnectionState::ConnectingToProxy:
return td_api::make_object<td_api::connectionStateConnectingToProxy>();
case ConnectionState::Connecting:
return td_api::make_object<td_api::connectionStateConnecting>();
case ConnectionState::Updating:
return td_api::make_object<td_api::connectionStateUpdating>();
case ConnectionState::Ready:
return td_api::make_object<td_api::connectionStateReady>();
default:
LOG(FATAL) << "State = " << static_cast<int32>(state);
return nullptr;
}
}
td_api::object_ptr<td_api::updateConnectionState> get_update_connection_state_object(ConnectionState state) {
return td_api::make_object<td_api::updateConnectionState>(get_connection_state_object(state));
}
} // namespace td

View File

@ -0,0 +1,19 @@
//
// Copyright Aliaksei Levin (levlam@telegram.org), Arseny Smirnov (arseny30@gmail.com) 2014-2021
//
// Distributed under the Boost Software License, Version 1.0. (See accompanying
// file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
//
#pragma once
#include "td/telegram/td_api.h"
#include "td/utils/common.h"
namespace td {
enum class ConnectionState : int32 { WaitingForNetwork, ConnectingToProxy, Connecting, Updating, Ready, Empty };
td_api::object_ptr<td_api::updateConnectionState> get_update_connection_state_object(ConnectionState state);
} // namespace td

View File

@ -50,7 +50,7 @@ tl_object_ptr<telegram_api::inputMediaContact> Contact::get_input_media_contact(
SecretInputMedia Contact::get_secret_input_media_contact() const {
return SecretInputMedia{nullptr, make_tl_object<secret_api::decryptedMessageMediaContact>(
phone_number_, first_name_, last_name_, user_id_.get())};
phone_number_, first_name_, last_name_, static_cast<int32>(0))};
}
tl_object_ptr<telegram_api::inputPhoneContact> Contact::get_input_phone_contact(int64 client_id) const {

File diff suppressed because it is too large Load Diff

View File

@ -6,9 +6,6 @@
//
#pragma once
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/BotCommand.h"
#include "td/telegram/ChannelId.h"
@ -33,6 +30,8 @@
#include "td/telegram/SecretChatId.h"
#include "td/telegram/StickerSetId.h"
#include "td/telegram/SuggestedAction.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/actor/actor.h"
@ -175,7 +174,7 @@ class ContactsManager final : public Actor {
void on_update_user_common_chat_count(UserId user_id, int32 common_chat_count);
void on_update_user_need_phone_number_privacy_exception(UserId user_id, bool need_phone_number_privacy_exception);
void on_change_profile_photo(tl_object_ptr<telegram_api::photos_photo> &&photo, int64 old_photo_id);
void on_set_profile_photo(tl_object_ptr<telegram_api::photos_photo> &&photo, int64 old_photo_id);
void on_delete_profile_photo(int64 profile_photo_id, Promise<Unit> promise);
void on_ignored_restriction_reasons_changed();
@ -362,6 +361,8 @@ class ContactsManager final : public Actor {
void delete_dialog(DialogId dialog_id, Promise<Unit> &&promise);
void get_channel_statistics_dc_id(DialogId dialog_id, bool for_full_statistics, Promise<DcId> &&promise);
void get_channel_statistics(DialogId dialog_id, bool is_dark,
Promise<td_api::object_ptr<td_api::ChatStatistics>> &&promise);
@ -463,7 +464,7 @@ class ContactsManager final : public Actor {
UserId get_me(Promise<Unit> &&promise);
bool get_user(UserId user_id, int left_tries, Promise<Unit> &&promise);
void reload_user(UserId user_id, Promise<Unit> &&promise);
bool load_user_full(UserId user_id, bool force, Promise<Unit> &&promise, const char *source);
void load_user_full(UserId user_id, bool force, Promise<Unit> &&promise, const char *source);
void reload_user_full(UserId user_id);
std::pair<int32, vector<const Photo *>> get_user_profile_photos(UserId user_id, int32 offset, int32 limit,
@ -475,10 +476,11 @@ class ContactsManager final : public Actor {
bool have_chat_force(ChatId chat_id);
bool get_chat(ChatId chat_id, int left_tries, Promise<Unit> &&promise);
void reload_chat(ChatId chat_id, Promise<Unit> &&promise);
bool load_chat_full(ChatId chat_id, bool force, Promise<Unit> &&promise, const char *source);
void load_chat_full(ChatId chat_id, bool force, Promise<Unit> &&promise, const char *source);
FileSourceId get_chat_full_file_source_id(ChatId chat_id);
void reload_chat_full(ChatId chat_id, Promise<Unit> &&promise);
int32 get_chat_participant_count(ChatId channel_id) const;
bool get_chat_is_active(ChatId chat_id) const;
ChannelId get_chat_migrated_to_channel_id(ChatId chat_id) const;
DialogParticipantStatus get_chat_status(ChatId chat_id) const;
@ -490,7 +492,7 @@ class ContactsManager final : public Actor {
bool have_channel_force(ChannelId channel_id);
bool get_channel(ChannelId channel_id, int left_tries, Promise<Unit> &&promise);
void reload_channel(ChannelId chnanel_id, Promise<Unit> &&promise);
bool load_channel_full(ChannelId channel_id, bool force, Promise<Unit> &&promise, const char *source);
void load_channel_full(ChannelId channel_id, bool force, Promise<Unit> &&promise, const char *source);
FileSourceId get_channel_full_file_source_id(ChannelId channel_id);
void reload_channel_full(ChannelId channel_id, Promise<Unit> &&promise, const char *source);
@ -536,23 +538,23 @@ class ContactsManager final : public Actor {
string additional_query, int32 offset, int32 limit, int32 additional_limit,
Promise<DialogParticipants> &&promise);
int32 get_user_id_object(UserId user_id, const char *source) const;
int64 get_user_id_object(UserId user_id, const char *source) const;
tl_object_ptr<td_api::user> get_user_object(UserId user_id) const;
vector<int32> get_user_ids_object(const vector<UserId> &user_ids, const char *source) const;
vector<int64> get_user_ids_object(const vector<UserId> &user_ids, const char *source) const;
tl_object_ptr<td_api::users> get_users_object(int32 total_count, const vector<UserId> &user_ids) const;
tl_object_ptr<td_api::userFullInfo> get_user_full_info_object(UserId user_id) const;
int32 get_basic_group_id_object(ChatId chat_id, const char *source) const;
int64 get_basic_group_id_object(ChatId chat_id, const char *source) const;
tl_object_ptr<td_api::basicGroup> get_basic_group_object(ChatId chat_id);
tl_object_ptr<td_api::basicGroupFullInfo> get_basic_group_full_info_object(ChatId chat_id) const;
int32 get_supergroup_id_object(ChannelId channel_id, const char *source) const;
int64 get_supergroup_id_object(ChannelId channel_id, const char *source) const;
tl_object_ptr<td_api::supergroup> get_supergroup_object(ChannelId channel_id) const;
@ -1341,7 +1343,7 @@ class ContactsManager final : public Actor {
int32 get_user_was_online(const User *u, UserId user_id) const;
int32 get_contacts_hash();
int64 get_contacts_hash();
void update_contacts_hints(const User *u, UserId user_id, bool from_database);
@ -1441,7 +1443,7 @@ class ContactsManager final : public Actor {
void on_load_administrator_users_finished(DialogId dialog_id, vector<DialogAdministrator> administrators,
Result<> result, Promise<Unit> promise);
void reload_dialog_administrators(DialogId dialog_id, int32 hash, Promise<Unit> &&promise);
void reload_dialog_administrators(DialogId dialog_id, int64 hash, Promise<Unit> &&promise);
void remove_dialog_suggested_action(SuggestedAction action);
@ -1476,7 +1478,8 @@ class ContactsManager final : public Actor {
static tl_object_ptr<td_api::SecretChatState> get_secret_chat_state_object(SecretChatState state);
static td_api::object_ptr<td_api::updateSecretChat> get_update_unknown_secret_chat_object(SecretChatId user_id);
static td_api::object_ptr<td_api::updateSecretChat> get_update_unknown_secret_chat_object(
SecretChatId secret_chat_id);
tl_object_ptr<td_api::secretChat> get_secret_chat_object(SecretChatId secret_chat_id, const SecretChat *secret_chat);
@ -1489,11 +1492,13 @@ class ContactsManager final : public Actor {
void update_dialogs_for_discussion(DialogId dialog_id, bool is_suitable);
void change_chat_participant_status(ChatId chat_id, UserId user_id, DialogParticipantStatus status,
Promise<Unit> &&promise);
void set_chat_participant_status(ChatId chat_id, UserId user_id, DialogParticipantStatus status,
Promise<Unit> &&promise);
void change_channel_participant_status(ChannelId channel_id, DialogId participant_dialog_id,
DialogParticipantStatus status, Promise<Unit> &&promise);
void set_channel_participant_status(ChannelId channel_id, DialogId participant_dialog_id,
DialogParticipantStatus status, Promise<Unit> &&promise);
void send_edit_chat_admin_query(ChatId chat_id, UserId user_id, bool is_administrator, Promise<Unit> &&promise);
void delete_chat_participant(ChatId chat_id, UserId user_id, bool revoke_messages, Promise<Unit> &&promise);
@ -1515,9 +1520,9 @@ class ContactsManager final : public Actor {
const DialogParticipant *get_channel_participant_from_cache(ChannelId channel_id, DialogId participant_dialog_id);
void change_channel_participant_status_impl(ChannelId channel_id, DialogId participant_dialog_id,
DialogParticipantStatus status, DialogParticipantStatus old_status,
Promise<Unit> &&promise);
void set_channel_participant_status_impl(ChannelId channel_id, DialogId participant_dialog_id,
DialogParticipantStatus status, DialogParticipantStatus old_status,
Promise<Unit> &&promise);
void promote_channel_participant(ChannelId channel_id, UserId user_id, DialogParticipantStatus status,
DialogParticipantStatus old_status, Promise<Unit> &&promise);
@ -1534,8 +1539,6 @@ class ContactsManager final : public Actor {
void delete_channel(ChannelId channel_id, Promise<Unit> &&promise);
void get_channel_statistics_dc_id(DialogId dialog_id, bool for_full_statistics, Promise<DcId> &&promise);
void get_channel_statistics_dc_id_impl(ChannelId channel_id, bool for_full_statistics, Promise<DcId> &&promise);
void send_get_channel_stats_query(DcId dc_id, ChannelId channel_id, bool is_dark,

View File

@ -9,14 +9,14 @@
#include "td/telegram/Global.h"
#include "td/telegram/misc.h"
#include "td/telegram/net/NetQueryDispatcher.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/UserId.h"
#include "td/telegram/td_api.hpp"
#include "td/telegram/TdDb.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/mtproto/DhHandshake.h"
#include "td/utils/algorithm.h"
#include "td/utils/base64.h"
#include "td/utils/buffer.h"
#include "td/utils/format.h"
@ -40,12 +40,13 @@ void DeviceTokenManager::TokenInfo::store(StorerT &storer) const {
bool is_register = state == State::Register;
CHECK(state != State::Reregister);
BEGIN_STORE_FLAGS();
STORE_FLAG(has_other_user_ids);
STORE_FLAG(false);
STORE_FLAG(is_sync);
STORE_FLAG(is_unregister);
STORE_FLAG(is_register);
STORE_FLAG(is_app_sandbox);
STORE_FLAG(encrypt);
STORE_FLAG(has_other_user_ids);
END_STORE_FLAGS();
store(token, storer);
if (has_other_user_ids) {
@ -60,17 +61,19 @@ void DeviceTokenManager::TokenInfo::store(StorerT &storer) const {
template <class ParserT>
void DeviceTokenManager::TokenInfo::parse(ParserT &parser) {
using td::parse;
bool has_other_user_ids_legacy;
bool has_other_user_ids;
bool is_sync;
bool is_unregister;
bool is_register;
BEGIN_PARSE_FLAGS();
PARSE_FLAG(has_other_user_ids);
PARSE_FLAG(has_other_user_ids_legacy);
PARSE_FLAG(is_sync);
PARSE_FLAG(is_unregister);
PARSE_FLAG(is_register);
PARSE_FLAG(is_app_sandbox);
PARSE_FLAG(encrypt);
PARSE_FLAG(has_other_user_ids);
END_PARSE_FLAGS();
CHECK(is_sync + is_unregister + is_register == 1);
if (is_sync) {
@ -81,6 +84,11 @@ void DeviceTokenManager::TokenInfo::parse(ParserT &parser) {
state = State::Register;
}
parse(token, parser);
if (has_other_user_ids_legacy) {
vector<int32> other_user_ids_legacy;
parse(other_user_ids_legacy, parser);
other_user_ids = transform(other_user_ids_legacy, [](int32 user_id) { return static_cast<int64>(user_id); });
}
if (has_other_user_ids) {
parse(other_user_ids, parser);
}
@ -246,7 +254,7 @@ void DeviceTokenManager::register_device(tl_object_ptr<td_api::DeviceToken> devi
info.state = TokenInfo::State::Register;
info.token = std::move(token);
}
info.other_user_ids = std::move(other_user_ids);
info.other_user_ids = UserId::get_input_user_ids(other_user_ids);
info.is_app_sandbox = is_app_sandbox;
if (encrypt != info.encrypt) {
if (encrypt) {
@ -370,15 +378,14 @@ void DeviceTokenManager::loop() {
}
// have to send query
NetQueryPtr net_query;
auto other_user_ids = info.other_user_ids;
if (info.state == TokenInfo::State::Unregister) {
net_query = G()->net_query_creator().create(
telegram_api::account_unregisterDevice(token_type, info.token, UserId::get_input_user_ids(other_user_ids)));
telegram_api::account_unregisterDevice(token_type, info.token, vector<int64>(info.other_user_ids)));
} else {
int32 flags = telegram_api::account_registerDevice::NO_MUTED_MASK;
net_query = G()->net_query_creator().create(telegram_api::account_registerDevice(
flags, false /*ignored*/, token_type, info.token, info.is_app_sandbox, BufferSlice(info.encryption_key),
UserId::get_input_user_ids(other_user_ids)));
net_query = G()->net_query_creator().create(
telegram_api::account_registerDevice(flags, false /*ignored*/, token_type, info.token, info.is_app_sandbox,
BufferSlice(info.encryption_key), vector<int64>(info.other_user_ids)));
}
info.net_query_id = net_query->id();
G()->net_query_dispatcher().dispatch_with_callback(std::move(net_query), actor_shared(this, token_type));
@ -423,7 +430,7 @@ void DeviceTokenManager::on_result(NetQueryPtr net_query) {
}
info.promise.set_error(r_flag.move_as_error());
} else {
info.promise.set_error(Status::Error(5, "Got false as result of registerDevice server request"));
info.promise.set_error(Status::Error(400, "Got false as result of registerDevice server request"));
}
if (info.state == TokenInfo::State::Reregister) {
// keep trying to reregister the token

View File

@ -6,13 +6,13 @@
//
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/net/NetQuery.h"
#include "td/telegram/td_api.h"
#include "td/telegram/UserId.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/common.h"
#include "td/utils/Slice.h"
#include "td/utils/StringBuilder.h"
@ -55,7 +55,7 @@ class DeviceTokenManager final : public NetQueryCallback {
State state = State::Sync;
string token;
uint64 net_query_id = 0;
vector<UserId> other_user_ids;
vector<int64> other_user_ids;
bool is_app_sandbox = false;
bool encrypt = false;
string encryption_key;

View File

@ -6,18 +6,54 @@
//
#include "td/telegram/DialogAction.h"
#include "td/telegram/misc.h"
#include "td/telegram/ServerMessageId.h"
#include "td/utils/emoji.h"
#include "td/utils/misc.h"
#include "td/utils/Slice.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/utf8.h"
namespace td {
bool DialogAction::is_valid_emoji(string &emoji) {
if (!clean_input_string(emoji)) {
return false;
}
return is_emoji(emoji);
}
void DialogAction::init(Type type) {
type_ = type;
progress_ = 0;
emoji_.clear();
}
void DialogAction::init(Type type, int32 progress) {
type_ = type;
progress_ = clamp(progress, 0, 100);
emoji_.clear();
}
void DialogAction::init(Type type, string emoji) {
if (is_valid_emoji(emoji)) {
type_ = type;
progress_ = 0;
emoji_ = std::move(emoji);
} else {
init(Type::Cancel);
}
}
void DialogAction::init(Type type, int32 message_id, string emoji, string data) {
if (ServerMessageId(message_id).is_valid() && is_valid_emoji(emoji) && check_utf8(data)) {
type_ = type;
progress_ = message_id;
emoji_ = PSTRING() << emoji << '\xFF' << data;
} else {
init(Type::Cancel);
}
}
DialogAction::DialogAction(Type type, int32 progress) {
@ -82,6 +118,11 @@ DialogAction::DialogAction(tl_object_ptr<td_api::ChatAction> &&action) {
case td_api::chatActionChoosingSticker::ID:
init(Type::ChoosingSticker);
break;
case td_api::chatActionWatchingAnimations::ID: {
auto watching_animations_action = move_tl_object_as<td_api::chatActionWatchingAnimations>(action);
init(Type::WatchingAnimations, std::move(watching_animations_action->emoji_));
break;
}
default:
UNREACHABLE();
break;
@ -150,6 +191,17 @@ DialogAction::DialogAction(tl_object_ptr<telegram_api::SendMessageAction> &&acti
case telegram_api::sendMessageChooseStickerAction::ID:
init(Type::ChoosingSticker);
break;
case telegram_api::sendMessageEmojiInteractionSeen::ID: {
auto emoji_interaction_seen_action = move_tl_object_as<telegram_api::sendMessageEmojiInteractionSeen>(action);
init(Type::WatchingAnimations, std::move(emoji_interaction_seen_action->emoticon_));
break;
}
case telegram_api::sendMessageEmojiInteraction::ID: {
auto emoji_interaction_action = move_tl_object_as<telegram_api::sendMessageEmojiInteraction>(action);
init(Type::ClickingAnimatedEmoji, emoji_interaction_action->msg_id_,
std::move(emoji_interaction_action->emoticon_), std::move(emoji_interaction_action->interaction_->data_));
break;
}
default:
UNREACHABLE();
break;
@ -190,6 +242,9 @@ tl_object_ptr<telegram_api::SendMessageAction> DialogAction::get_input_send_mess
return make_tl_object<telegram_api::sendMessageHistoryImportAction>(progress_);
case Type::ChoosingSticker:
return make_tl_object<telegram_api::sendMessageChooseStickerAction>();
case Type::WatchingAnimations:
return make_tl_object<telegram_api::sendMessageEmojiInteractionSeen>(emoji_);
case Type::ClickingAnimatedEmoji:
default:
UNREACHABLE();
return nullptr;
@ -230,6 +285,9 @@ tl_object_ptr<secret_api::SendMessageAction> DialogAction::get_secret_input_send
return make_tl_object<secret_api::sendMessageTypingAction>();
case Type::ChoosingSticker:
return make_tl_object<secret_api::sendMessageTypingAction>();
case Type::WatchingAnimations:
return make_tl_object<secret_api::sendMessageTypingAction>();
case Type::ClickingAnimatedEmoji:
default:
UNREACHABLE();
return nullptr;
@ -266,8 +324,11 @@ tl_object_ptr<td_api::ChatAction> DialogAction::get_chat_action_object() const {
return td_api::make_object<td_api::chatActionUploadingVideoNote>(progress_);
case Type::ChoosingSticker:
return td_api::make_object<td_api::chatActionChoosingSticker>();
case Type::WatchingAnimations:
return td_api::make_object<td_api::chatActionWatchingAnimations>(emoji_);
case Type::ImportingMessages:
case Type::SpeakingInVoiceChat:
case Type::ClickingAnimatedEmoji:
default:
UNREACHABLE();
return td_api::make_object<td_api::chatActionCancel>();
@ -380,6 +441,25 @@ int32 DialogAction::get_importing_messages_action_progress() const {
return progress_;
}
string DialogAction::get_watching_animations_emoji() const {
if (type_ == Type::WatchingAnimations) {
return emoji_;
}
return string();
}
DialogAction::ClickingAnimateEmojiInfo DialogAction::get_clicking_animated_emoji_action_info() const {
ClickingAnimateEmojiInfo result;
if (type_ == Type::ClickingAnimatedEmoji) {
auto pos = emoji_.find('\xFF');
CHECK(pos < emoji_.size());
result.message_id = progress_;
result.emoji = emoji_.substr(0, pos);
result.data = emoji_.substr(pos + 1);
}
return result;
}
StringBuilder &operator<<(StringBuilder &string_builder, const DialogAction &action) {
string_builder << "ChatAction";
const char *type = [action_type = action.type_] {
@ -416,14 +496,28 @@ StringBuilder &operator<<(StringBuilder &string_builder, const DialogAction &act
return "ImportingMessages";
case DialogAction::Type::ChoosingSticker:
return "ChoosingSticker";
case DialogAction::Type::WatchingAnimations:
return "WatchingAnimations";
case DialogAction::Type::ClickingAnimatedEmoji:
return "ClickingAnimatedEmoji";
default:
UNREACHABLE();
return "Cancel";
}
}();
string_builder << type << "Action";
if (action.progress_ != 0) {
string_builder << '(' << action.progress_ << "%)";
if (action.type_ == DialogAction::Type::ClickingAnimatedEmoji) {
auto pos = action.emoji_.find('\xFF');
CHECK(pos < action.emoji_.size());
string_builder << '(' << action.progress_ << ")(" << Slice(action.emoji_).substr(0, pos) << ")("
<< Slice(action.emoji_).substr(pos + 1) << ')';
} else {
if (action.progress_ != 0) {
string_builder << '(' << action.progress_ << "%)";
}
if (!action.emoji_.empty()) {
string_builder << '(' << action.emoji_ << ')';
}
}
return string_builder;
}

View File

@ -33,10 +33,13 @@ class DialogAction {
UploadingVideoNote,
SpeakingInVoiceChat,
ImportingMessages,
ChoosingSticker
ChoosingSticker,
WatchingAnimations,
ClickingAnimatedEmoji
};
Type type_ = Type::Cancel;
int32 progress_ = 0;
string emoji_;
DialogAction(Type type, int32 progress);
@ -44,6 +47,12 @@ class DialogAction {
void init(Type type, int32 progress);
void init(Type type, string emoji);
void init(Type type, int32 message_id, string emoji, string data);
static bool is_valid_emoji(string &emoji);
public:
DialogAction() = default;
@ -67,8 +76,17 @@ class DialogAction {
int32 get_importing_messages_action_progress() const;
string get_watching_animations_emoji() const;
struct ClickingAnimateEmojiInfo {
int32 message_id;
string emoji;
string data;
};
ClickingAnimateEmojiInfo get_clicking_animated_emoji_action_info() const;
friend bool operator==(const DialogAction &lhs, const DialogAction &rhs) {
return lhs.type_ == rhs.type_ && lhs.progress_ == rhs.progress_;
return lhs.type_ == rhs.type_ && lhs.progress_ == rhs.progress_ && lhs.emoji_ == rhs.emoji_;
}
friend StringBuilder &operator<<(StringBuilder &string_builder, const DialogAction &action);

View File

@ -8,14 +8,14 @@
#include "td/telegram/Version.h"
#include "td/actor/actor.h"
#include "td/actor/SchedulerLocalStorage.h"
#include "td/db/SqliteConnectionSafe.h"
#include "td/db/SqliteDb.h"
#include "td/db/SqliteKeyValue.h"
#include "td/db/SqliteStatement.h"
#include "td/actor/actor.h"
#include "td/actor/SchedulerLocalStorage.h"
#include "td/utils/common.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"
@ -105,13 +105,17 @@ Status init_dialog_db(SqliteDb &db, int32 version, KeyValueSyncInterface &binlog
// NB: must happen inside a transaction
Status drop_dialog_db(SqliteDb &db, int version) {
if (version < static_cast<int32>(DbVersion::DialogDbCreated)) {
LOG(WARNING) << "Drop old pmc dialog_db";
if (version != 0) {
LOG(WARNING) << "Drop old pmc dialog_db";
}
SqliteKeyValue kv;
kv.init_with_connection(db.clone(), "common").ensure();
kv.erase_by_prefix("di");
}
LOG(WARNING) << "Drop dialog_db " << tag("version", version) << tag("current_db_version", current_db_version());
if (version != 0) {
LOG(WARNING) << "Drop dialog_db " << tag("version", version) << tag("current_db_version", current_db_version());
}
auto status = db.exec("DROP TABLE IF EXISTS dialogs");
TRY_STATUS(db.exec("DROP TABLE IF EXISTS notification_groups"));
return status;

View File

@ -11,10 +11,10 @@
#include "td/telegram/NotificationGroupId.h"
#include "td/telegram/NotificationGroupKey.h"
#include "td/actor/PromiseFuture.h"
#include "td/db/KeyValueSyncInterface.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"

View File

@ -7,9 +7,9 @@
#include "td/telegram/DialogFilter.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/misc.h"
#include "td/utils/algorithm.h"
#include "td/utils/emoji.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"
@ -401,8 +401,9 @@ void DialogFilter::init_icon_names() {
"Mask", "Party", "Sport", "Study", "Trade", "Travel", "Work"};
CHECK(emojis.size() == icon_names.size());
for (size_t i = 0; i < emojis.size(); i++) {
emoji_to_icon_name_[remove_emoji_modifiers(emojis[i])] = icon_names[i];
icon_name_to_emoji_[icon_names[i]] = remove_emoji_modifiers(emojis[i]);
remove_emoji_modifiers_in_place(emojis[i]);
emoji_to_icon_name_[emojis[i]] = icon_names[i];
icon_name_to_emoji_[icon_names[i]] = emojis[i];
}
return true;
}();

View File

@ -10,38 +10,31 @@
#include "td/utils/logging.h"
#include <limits>
namespace td {
bool DialogId::is_valid() const {
switch (get_type()) {
case DialogType::User:
return get_user_id().is_valid();
case DialogType::Chat:
return get_chat_id().is_valid();
case DialogType::Channel:
return get_channel_id().is_valid();
case DialogType::SecretChat:
return get_secret_chat_id().is_valid();
case DialogType::None:
return false;
default:
UNREACHABLE();
return false;
}
return get_type() != DialogType::None;
}
DialogType DialogId::get_type() const {
// check that valid ranges are continuous
static_assert(ZERO_CHANNEL_ID + 1 == -ChatId::MAX_CHAT_ID, "");
static_assert(
ZERO_SECRET_CHAT_ID + std::numeric_limits<int32>::max() + 1 == ZERO_CHANNEL_ID - ChannelId::MAX_CHANNEL_ID, "");
if (id < 0) {
if (MIN_CHAT_ID <= id) {
if (-ChatId::MAX_CHAT_ID <= id) {
return DialogType::Chat;
}
if (MIN_CHANNEL_ID <= id && id < MAX_CHANNEL_ID) {
if (ZERO_CHANNEL_ID - ChannelId::MAX_CHANNEL_ID <= id && id != ZERO_CHANNEL_ID) {
return DialogType::Channel;
}
if (MIN_SECRET_ID <= id && id < MAX_SECRET_ID) {
if (ZERO_SECRET_CHAT_ID + std::numeric_limits<int32>::min() <= id && id != ZERO_SECRET_CHAT_ID) {
return DialogType::SecretChat;
}
} else if (0 < id && id <= MAX_USER_ID) {
} else if (0 < id && id <= UserId::MAX_USER_ID) {
return DialogType::User;
}
return DialogType::None;
@ -49,27 +42,27 @@ DialogType DialogId::get_type() const {
UserId DialogId::get_user_id() const {
CHECK(get_type() == DialogType::User);
return UserId(static_cast<int32>(id));
return UserId(id);
}
ChatId DialogId::get_chat_id() const {
CHECK(get_type() == DialogType::Chat);
return ChatId(static_cast<int32>(-id));
return ChatId(-id);
}
ChannelId DialogId::get_channel_id() const {
CHECK(get_type() == DialogType::Channel);
return ChannelId(static_cast<int32>(MAX_CHANNEL_ID - id));
return ChannelId(ZERO_CHANNEL_ID - id);
}
SecretChatId DialogId::get_secret_chat_id() const {
CHECK(get_type() == DialogType::SecretChat);
return SecretChatId(static_cast<int32>(id - ZERO_SECRET_ID));
return SecretChatId(static_cast<int32>(id - ZERO_SECRET_CHAT_ID));
}
DialogId::DialogId(UserId user_id) {
if (user_id.is_valid()) {
id = static_cast<int64>(user_id.get());
id = user_id.get();
} else {
id = 0;
}
@ -77,7 +70,7 @@ DialogId::DialogId(UserId user_id) {
DialogId::DialogId(ChatId chat_id) {
if (chat_id.is_valid()) {
id = -static_cast<int64>(chat_id.get());
id = -chat_id.get();
} else {
id = 0;
}
@ -85,15 +78,15 @@ DialogId::DialogId(ChatId chat_id) {
DialogId::DialogId(ChannelId channel_id) {
if (channel_id.is_valid()) {
id = MAX_CHANNEL_ID - static_cast<int64>(channel_id.get());
id = ZERO_CHANNEL_ID - channel_id.get();
} else {
id = 0;
}
}
DialogId::DialogId(SecretChatId chat_id) {
if (chat_id.is_valid()) {
id = ZERO_SECRET_ID + static_cast<int64>(chat_id.get());
DialogId::DialogId(SecretChatId secret_chat_id) {
if (secret_chat_id.is_valid()) {
id = ZERO_SECRET_CHAT_ID + static_cast<int64>(secret_chat_id.get());
} else {
id = 0;
}
@ -130,7 +123,7 @@ int64 DialogId::get_peer_id(const tl_object_ptr<telegram_api::Peer> &peer) {
return 0;
}
return static_cast<int64>(user_id.get());
return user_id.get();
}
case telegram_api::peerChat::ID: {
auto peer_chat = static_cast<const telegram_api::peerChat *>(peer.get());
@ -140,7 +133,7 @@ int64 DialogId::get_peer_id(const tl_object_ptr<telegram_api::Peer> &peer) {
return 0;
}
return -static_cast<int64>(chat_id.get());
return -chat_id.get();
}
case telegram_api::peerChannel::ID: {
auto peer_channel = static_cast<const telegram_api::peerChannel *>(peer.get());
@ -150,7 +143,7 @@ int64 DialogId::get_peer_id(const tl_object_ptr<telegram_api::Peer> &peer) {
return 0;
}
return MAX_CHANNEL_ID - static_cast<int64>(channel_id.get());
return ZERO_CHANNEL_ID - channel_id.get();
}
default:
UNREACHABLE();

View File

@ -24,13 +24,8 @@ namespace td {
enum class DialogType : int32 { None, User, Chat, Channel, SecretChat };
class DialogId {
static constexpr int64 MIN_SECRET_ID = -2002147483648ll;
static constexpr int64 ZERO_SECRET_ID = -2000000000000ll;
static constexpr int64 MAX_SECRET_ID = -1997852516353ll;
static constexpr int64 MIN_CHANNEL_ID = -1002147483647ll;
static constexpr int64 MAX_CHANNEL_ID = -1000000000000ll;
static constexpr int64 MIN_CHAT_ID = -2147483647ll;
static constexpr int64 MAX_USER_ID = 2147483647ll;
static constexpr int64 ZERO_SECRET_CHAT_ID = -2000000000000ll;
static constexpr int64 ZERO_CHANNEL_ID = -1000000000000ll;
int64 id = 0;
@ -49,7 +44,7 @@ class DialogId {
explicit DialogId(UserId user_id);
explicit DialogId(ChatId chat_id);
explicit DialogId(ChannelId channel_id);
explicit DialogId(SecretChatId chat_id);
explicit DialogId(SecretChatId secret_chat_id);
int64 get() const {
return id;

View File

@ -6,9 +6,6 @@
//
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/BackgroundId.h"
#include "td/telegram/ChannelId.h"
#include "td/telegram/ChatId.h"
@ -19,6 +16,9 @@
#include "td/telegram/SetWithPosition.h"
#include "td/telegram/UserId.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"

View File

@ -10,15 +10,14 @@
#include "td/telegram/files/FileId.h"
#include "td/telegram/MessageEntity.h"
#include "td/telegram/Photo.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
#include "td/utils/StringBuilder.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
namespace td {
class ContactsManager;

View File

@ -92,7 +92,7 @@ class SetInlineGameScoreQuery final : public Td::ResultHandler {
explicit SetInlineGameScoreQuery(Promise<Unit> &&promise) : promise_(std::move(promise)) {
}
void send(tl_object_ptr<telegram_api::inputBotInlineMessageID> input_bot_inline_message_id, bool edit_message,
void send(tl_object_ptr<telegram_api::InputBotInlineMessageID> input_bot_inline_message_id, bool edit_message,
tl_object_ptr<telegram_api::InputUser> input_user, int32 score, bool force) {
CHECK(input_bot_inline_message_id != nullptr);
CHECK(input_user != nullptr);
@ -105,7 +105,7 @@ class SetInlineGameScoreQuery final : public Td::ResultHandler {
flags |= telegram_api::messages_setInlineGameScore::FORCE_MASK;
}
auto dc_id = DcId::internal(input_bot_inline_message_id->dc_id_);
auto dc_id = DcId::internal(InlineQueriesManager::get_inline_message_dc_id(input_bot_inline_message_id));
send_query(G()->net_query_creator().create(
telegram_api::messages_setInlineGameScore(flags, false /*ignored*/, false /*ignored*/,
std::move(input_bot_inline_message_id), std::move(input_user), score),
@ -172,12 +172,12 @@ class GetInlineGameHighScoresQuery final : public Td::ResultHandler {
: promise_(std::move(promise)) {
}
void send(tl_object_ptr<telegram_api::inputBotInlineMessageID> input_bot_inline_message_id,
void send(tl_object_ptr<telegram_api::InputBotInlineMessageID> input_bot_inline_message_id,
tl_object_ptr<telegram_api::InputUser> input_user) {
CHECK(input_bot_inline_message_id != nullptr);
CHECK(input_user != nullptr);
auto dc_id = DcId::internal(input_bot_inline_message_id->dc_id_);
auto dc_id = DcId::internal(InlineQueriesManager::get_inline_message_dc_id(input_bot_inline_message_id));
send_query(G()->net_query_creator().create(
telegram_api::messages_getInlineGameHighScores(std::move(input_bot_inline_message_id), std::move(input_user)),
dc_id));
@ -211,12 +211,12 @@ void GameManager::set_game_score(FullMessageId full_message_id, bool edit_messag
CHECK(td_->auth_manager_->is_bot());
if (!td_->messages_manager_->have_message_force(full_message_id, "set_game_score")) {
return promise.set_error(Status::Error(5, "Message not found"));
return promise.set_error(Status::Error(400, "Message not found"));
}
auto dialog_id = full_message_id.get_dialog_id();
if (!td_->messages_manager_->have_input_peer(dialog_id, AccessRights::Edit)) {
return promise.set_error(Status::Error(5, "Can't access the chat"));
return promise.set_error(Status::Error(400, "Can't access the chat"));
}
auto input_user = td_->contacts_manager_->get_input_user(user_id);
@ -225,7 +225,7 @@ void GameManager::set_game_score(FullMessageId full_message_id, bool edit_messag
}
if (!td_->messages_manager_->can_set_game_score(full_message_id)) {
return promise.set_error(Status::Error(5, "Game score can't be set"));
return promise.set_error(Status::Error(400, "Game score can't be set"));
}
auto query_promise = PromiseCreator::lambda(
@ -268,16 +268,16 @@ void GameManager::get_game_high_scores(FullMessageId full_message_id, UserId use
CHECK(td_->auth_manager_->is_bot());
if (!td_->messages_manager_->have_message_force(full_message_id, "get_game_high_scores")) {
return promise.set_error(Status::Error(5, "Message not found"));
return promise.set_error(Status::Error(400, "Message not found"));
}
auto dialog_id = full_message_id.get_dialog_id();
if (!td_->messages_manager_->have_input_peer(dialog_id, AccessRights::Read)) {
return promise.set_error(Status::Error(5, "Can't access the chat"));
return promise.set_error(Status::Error(400, "Can't access the chat"));
}
auto message_id = full_message_id.get_message_id();
if (message_id.is_scheduled() || !message_id.is_server()) {
return promise.set_error(Status::Error(5, "Wrong message identifier specified"));
return promise.set_error(Status::Error(400, "Wrong message identifier specified"));
}
auto input_user = td_->contacts_manager_->get_input_user(user_id);

View File

@ -137,8 +137,8 @@ Status Global::init(const TdParameters &parameters, ActorId<Td> td, unique_ptr<T
int32 Global::to_unix_time(double server_time) const {
LOG_CHECK(1.0 <= server_time && server_time <= 2140000000.0)
<< server_time << " " << Clocks::system() << " " << is_server_time_reliable() << " "
<< get_server_time_difference() << " " << Time::now() << saved_diff_ << " " << saved_system_time_;
<< server_time << ' ' << Clocks::system() << ' ' << is_server_time_reliable() << ' '
<< get_server_time_difference() << ' ' << Time::now() << ' ' << saved_diff_ << ' ' << saved_system_time_;
return static_cast<int32>(server_time);
}

View File

@ -11,12 +11,12 @@
#include "td/telegram/net/NetQueryCreator.h"
#include "td/telegram/TdParameters.h"
#include "td/net/NetStats.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/SchedulerLocalStorage.h"
#include "td/net/NetStats.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"
@ -346,10 +346,10 @@ class Global final : public ActorContext {
return parameters_;
}
int32 get_my_id() const {
int64 get_my_id() const {
return my_id_;
}
void set_my_id(int32 my_id) {
void set_my_id(int64 my_id) {
my_id_ = my_id;
}
@ -479,7 +479,7 @@ class Global final : public ActorContext {
unique_ptr<ConfigShared> shared_config_;
int32 my_id_ = 0; // hack
int64 my_id_ = 0; // hack
static int64 get_location_key(double latitude, double longitude);

View File

@ -842,7 +842,7 @@ struct GroupCallManager::GroupCall {
bool is_my_video_enabled = false;
bool is_my_presentation_paused = false;
bool mute_new_participants = false;
bool allowed_change_mute_new_participants = false;
bool allowed_toggle_mute_new_participants = false;
bool joined_date_asc = false;
bool is_video_recorded = false;
int32 scheduled_start_date = 0;
@ -3360,7 +3360,7 @@ void GroupCallManager::toggle_group_call_mute_new_participants(GroupCallId group
}));
return;
}
if (!group_call->is_active || !group_call->can_be_managed || !group_call->allowed_change_mute_new_participants) {
if (!group_call->is_active || !group_call->can_be_managed || !group_call->allowed_toggle_mute_new_participants) {
return promise.set_error(Status::Error(400, "Can't change mute_new_participants setting"));
}
@ -3405,7 +3405,7 @@ void GroupCallManager::on_toggle_group_call_mute_new_participants(InputGroupCall
if (result.is_error()) {
group_call->have_pending_mute_new_participants = false;
if (group_call->can_be_managed && group_call->allowed_change_mute_new_participants) {
if (group_call->can_be_managed && group_call->allowed_toggle_mute_new_participants) {
LOG(ERROR) << "Failed to set mute_new_participants to " << mute_new_participants << " in " << input_group_call_id
<< ": " << result.error();
}
@ -4210,7 +4210,7 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptr<telegra
call.start_subscribed = group_call->schedule_start_subscribed_;
call.mute_new_participants = group_call->join_muted_;
call.joined_date_asc = group_call->join_date_asc_;
call.allowed_change_mute_new_participants = group_call->can_change_join_muted_;
call.allowed_toggle_mute_new_participants = group_call->can_change_join_muted_;
call.participant_count = group_call->participants_count_;
call.unmuted_video_count = group_call->unmuted_video_count_;
call.unmuted_video_limit = group_call->unmuted_video_limit_;
@ -4350,13 +4350,13 @@ InputGroupCallId GroupCallManager::update_group_call(const tl_object_ptr<telegra
}
auto mute_flags_changed =
call.mute_new_participants != group_call->mute_new_participants ||
call.allowed_change_mute_new_participants != group_call->allowed_change_mute_new_participants;
call.allowed_toggle_mute_new_participants != group_call->allowed_toggle_mute_new_participants;
if (mute_flags_changed && call.mute_version >= group_call->mute_version) {
auto old_mute_new_participants = get_group_call_mute_new_participants(group_call);
need_update |= (call.allowed_change_mute_new_participants && call.can_be_managed) !=
(group_call->allowed_change_mute_new_participants && group_call->can_be_managed);
need_update |= (call.allowed_toggle_mute_new_participants && call.can_be_managed) !=
(group_call->allowed_toggle_mute_new_participants && group_call->can_be_managed);
group_call->mute_new_participants = call.mute_new_participants;
group_call->allowed_change_mute_new_participants = call.allowed_change_mute_new_participants;
group_call->allowed_toggle_mute_new_participants = call.allowed_toggle_mute_new_participants;
group_call->mute_version = call.mute_version;
if (old_mute_new_participants != get_group_call_mute_new_participants(group_call)) {
need_update = true;
@ -4792,8 +4792,8 @@ tl_object_ptr<td_api::groupCall> GroupCallManager::get_group_call_object(
bool is_my_video_enabled = get_group_call_is_my_video_enabled(group_call);
bool is_my_video_paused = is_my_video_enabled && get_group_call_is_my_video_paused(group_call);
bool mute_new_participants = get_group_call_mute_new_participants(group_call);
bool can_change_mute_new_participants =
group_call->is_active && group_call->can_be_managed && group_call->allowed_change_mute_new_participants;
bool can_toggle_mute_new_participants =
group_call->is_active && group_call->can_be_managed && group_call->allowed_toggle_mute_new_participants;
bool can_enable_video = get_group_call_can_enable_video(group_call);
int32 record_start_date = get_group_call_record_start_date(group_call);
int32 record_duration = record_start_date == 0 ? 0 : max(G()->unix_time() - record_start_date + 1, 1);
@ -4802,7 +4802,7 @@ tl_object_ptr<td_api::groupCall> GroupCallManager::get_group_call_object(
group_call->group_call_id.get(), get_group_call_title(group_call), scheduled_start_date, start_subscribed,
is_active, is_joined, group_call->need_rejoin, group_call->can_be_managed, group_call->participant_count,
group_call->loaded_all_participants, std::move(recent_speakers), is_my_video_enabled, is_my_video_paused,
can_enable_video, mute_new_participants, can_change_mute_new_participants, record_duration, is_video_recorded,
can_enable_video, mute_new_participants, can_toggle_mute_new_participants, record_duration, is_video_recorded,
group_call->duration);
}

View File

@ -8,6 +8,7 @@
#include "td/telegram/Global.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/TdParameters.h"
#include "td/db/SqliteKeyValueAsync.h"

View File

@ -37,6 +37,7 @@
#include "td/telegram/StickersManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/TdParameters.h"
#include "td/telegram/Venue.h"
#include "td/telegram/VideosManager.h"
#include "td/telegram/VoiceNotesManager.h"
@ -201,7 +202,21 @@ void InlineQueriesManager::after_get_difference() {
}
}
tl_object_ptr<telegram_api::inputBotInlineMessageID> InlineQueriesManager::get_input_bot_inline_message_id(
int32 InlineQueriesManager::get_inline_message_dc_id(
const tl_object_ptr<telegram_api::InputBotInlineMessageID> &inline_message_id) {
CHECK(inline_message_id != nullptr);
switch (inline_message_id->get_id()) {
case telegram_api::inputBotInlineMessageID::ID:
return static_cast<const telegram_api::inputBotInlineMessageID *>(inline_message_id.get())->dc_id_;
case telegram_api::inputBotInlineMessageID64::ID:
return static_cast<const telegram_api::inputBotInlineMessageID64 *>(inline_message_id.get())->dc_id_;
default:
UNREACHABLE();
return 0;
}
}
tl_object_ptr<telegram_api::InputBotInlineMessageID> InlineQueriesManager::get_input_bot_inline_message_id(
const string &inline_message_id) {
auto r_binary = base64url_decode(inline_message_id);
if (r_binary.is_error()) {
@ -209,12 +224,13 @@ tl_object_ptr<telegram_api::inputBotInlineMessageID> InlineQueriesManager::get_i
}
BufferSlice buffer_slice(r_binary.ok());
TlBufferParser parser(&buffer_slice);
auto result = telegram_api::inputBotInlineMessageID::fetch(parser);
auto result = buffer_slice.size() == 20 ? telegram_api::inputBotInlineMessageID::fetch(parser)
: telegram_api::inputBotInlineMessageID64::fetch(parser);
parser.fetch_end();
if (parser.get_error()) {
return nullptr;
}
if (!DcId::is_valid(result->dc_id_)) {
if (!DcId::is_valid(get_inline_message_dc_id(result))) {
return nullptr;
}
LOG(INFO) << "Have inline message identifier: " << to_string(result);
@ -222,7 +238,7 @@ tl_object_ptr<telegram_api::inputBotInlineMessageID> InlineQueriesManager::get_i
}
string InlineQueriesManager::get_inline_message_id(
tl_object_ptr<telegram_api::inputBotInlineMessageID> &&input_bot_inline_message_id) {
tl_object_ptr<telegram_api::InputBotInlineMessageID> &&input_bot_inline_message_id) {
if (input_bot_inline_message_id == nullptr) {
return string();
}
@ -769,7 +785,7 @@ void InlineQueriesManager::answer_inline_query(int64 inline_query_id, bool is_pe
uint64 InlineQueriesManager::send_inline_query(UserId bot_user_id, DialogId dialog_id, Location user_location,
const string &query, const string &offset, Promise<Unit> &&promise) {
if (td_->auth_manager_->is_bot()) {
promise.set_error(Status::Error(5, "Bot can't send inline queries to other bot"));
promise.set_error(Status::Error(400, "Bot can't send inline queries to other bot"));
return 0;
}
@ -779,7 +795,7 @@ uint64 InlineQueriesManager::send_inline_query(UserId bot_user_id, DialogId dial
return 0;
}
if (!r_bot_data.ok().is_inline) {
promise.set_error(Status::Error(5, "Bot doesn't support inline queries"));
promise.set_error(Status::Error(400, "Bot doesn't support inline queries"));
return 0;
}
@ -1755,7 +1771,7 @@ bool InlineQueriesManager::load_recently_used_bots(Promise<Unit> &promise) {
}
} else {
for (auto it = bot_ids.rbegin(); it != bot_ids.rend(); ++it) {
UserId user_id(to_integer<int32>(*it));
UserId user_id(to_integer<int64>(*it));
if (td_->contacts_manager_->have_user(user_id)) {
update_bot_usage(user_id);
} else {
@ -1783,7 +1799,7 @@ bool InlineQueriesManager::load_recently_used_bots(Promise<Unit> &promise) {
}
} else {
for (auto &bot_id : bot_ids) {
UserId user_id(to_integer<int32>(bot_id));
UserId user_id(to_integer<int64>(bot_id));
td_->contacts_manager_->get_user(user_id, 3, resolve_recent_inline_bots_multipromise_.get_promise());
}
}
@ -1837,7 +1853,7 @@ void InlineQueriesManager::on_new_query(int64 query_id, UserId sender_user_id, L
void InlineQueriesManager::on_chosen_result(
UserId user_id, Location user_location, const string &query, const string &result_id,
tl_object_ptr<telegram_api::inputBotInlineMessageID> &&input_bot_inline_message_id) {
tl_object_ptr<telegram_api::InputBotInlineMessageID> &&input_bot_inline_message_id) {
if (!user_id.is_valid()) {
LOG(ERROR) << "Receive chosen inline query result from invalid " << user_id;
return;

View File

@ -6,14 +6,6 @@
//
#pragma once
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/actor.h"
#include "td/actor/MultiPromise.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/Timeout.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/files/FileId.h"
#include "td/telegram/Location.h"
@ -21,8 +13,15 @@
#include "td/telegram/MessageEntity.h"
#include "td/telegram/net/NetQuery.h"
#include "td/telegram/Photo.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/actor/actor.h"
#include "td/actor/MultiPromise.h"
#include "td/actor/PromiseFuture.h"
#include "td/actor/Timeout.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
@ -71,13 +70,15 @@ class InlineQueriesManager final : public Actor {
const string &offset);
void on_chosen_result(UserId user_id, Location user_location, const string &query, const string &result_id,
tl_object_ptr<telegram_api::inputBotInlineMessageID> &&input_bot_inline_message_id);
tl_object_ptr<telegram_api::InputBotInlineMessageID> &&input_bot_inline_message_id);
static tl_object_ptr<telegram_api::inputBotInlineMessageID> get_input_bot_inline_message_id(
static int32 get_inline_message_dc_id(const tl_object_ptr<telegram_api::InputBotInlineMessageID> &inline_message_id);
static tl_object_ptr<telegram_api::InputBotInlineMessageID> get_input_bot_inline_message_id(
const string &inline_message_id);
static string get_inline_message_id(
tl_object_ptr<telegram_api::inputBotInlineMessageID> &&input_bot_inline_message_id);
tl_object_ptr<telegram_api::InputBotInlineMessageID> &&input_bot_inline_message_id);
private:
static constexpr int32 MAX_RECENT_INLINE_BOTS = 20; // some reasonable value

View File

@ -124,10 +124,7 @@ bool LanguagePackManager::is_custom_language_code(Slice language_code) {
}
static Result<SqliteDb> open_database(const string &path) {
TRY_RESULT(database, SqliteDb::open_with_key(path, DbKey::empty()));
TRY_STATUS(database.exec("PRAGMA synchronous=NORMAL"));
TRY_STATUS(database.exec("PRAGMA temp_store=MEMORY"));
TRY_STATUS(database.exec("PRAGMA encoding=\"UTF-8\""));
TRY_RESULT(database, SqliteDb::open_with_key(path, true, DbKey::empty()));
TRY_STATUS(database.exec("PRAGMA journal_mode=WAL"));
return std::move(database);
}

View File

@ -1090,7 +1090,7 @@ unique_ptr<LinkManager::InternalLink> LinkManager::get_internal_link_passport(
return Slice();
};
UserId bot_user_id(to_integer<int32>(get_arg("bot_id")));
UserId bot_user_id(to_integer<int64>(get_arg("bot_id")));
auto scope = get_arg("scope");
auto public_key = get_arg("public_key");
auto nonce = get_arg("nonce");
@ -1195,17 +1195,18 @@ void LinkManager::get_external_link_info(string &&link, Promise<td_api::object_p
promise.set_value(td_api::make_object<td_api::loginUrlInfoOpen>(url.get_url(), false));
}
void LinkManager::get_login_url_info(FullMessageId full_message_id, int32 button_id,
void LinkManager::get_login_url_info(FullMessageId full_message_id, int64 button_id,
Promise<td_api::object_ptr<td_api::LoginUrlInfo>> &&promise) {
TRY_RESULT_PROMISE(promise, url, td_->messages_manager_->get_login_button_url(full_message_id, button_id));
td_->create_handler<RequestUrlAuthQuery>(std::move(promise))->send(std::move(url), full_message_id, button_id);
td_->create_handler<RequestUrlAuthQuery>(std::move(promise))
->send(std::move(url), full_message_id, narrow_cast<int32>(button_id));
}
void LinkManager::get_login_url(FullMessageId full_message_id, int32 button_id, bool allow_write_access,
void LinkManager::get_login_url(FullMessageId full_message_id, int64 button_id, bool allow_write_access,
Promise<td_api::object_ptr<td_api::httpUrl>> &&promise) {
TRY_RESULT_PROMISE(promise, url, td_->messages_manager_->get_login_button_url(full_message_id, button_id));
td_->create_handler<AcceptUrlAuthQuery>(std::move(promise))
->send(std::move(url), full_message_id, button_id, allow_write_access);
->send(std::move(url), full_message_id, narrow_cast<int32>(button_id), allow_write_access);
}
void LinkManager::get_link_login_url(const string &url, bool allow_write_access,
@ -1339,7 +1340,7 @@ Result<MessageLinkInfo> LinkManager::get_message_link_info(Slice url) {
ChannelId channel_id;
if (username.empty()) {
auto r_channel_id = to_integer_safe<int32>(channel_id_slice);
auto r_channel_id = to_integer_safe<int64>(channel_id_slice);
if (r_channel_id.is_error() || !ChannelId(r_channel_id.ok()).is_valid()) {
return Status::Error("Wrong channel ID");
}

View File

@ -58,10 +58,10 @@ class LinkManager final : public Actor {
void get_external_link_info(string &&link, Promise<td_api::object_ptr<td_api::LoginUrlInfo>> &&promise);
void get_login_url_info(FullMessageId full_message_id, int32 button_id,
void get_login_url_info(FullMessageId full_message_id, int64 button_id,
Promise<td_api::object_ptr<td_api::LoginUrlInfo>> &&promise);
void get_login_url(FullMessageId full_message_id, int32 button_id, bool allow_write_access,
void get_login_url(FullMessageId full_message_id, int64 button_id, bool allow_write_access,
Promise<td_api::object_ptr<td_api::httpUrl>> &&promise);
void get_link_login_url(const string &url, bool allow_write_access,

View File

@ -6,9 +6,6 @@
//
#include "td/telegram/Logging.h"
#include "td/mtproto/SessionConnection.h"
#include "td/mtproto/Transport.h"
#include "td/telegram/ConfigManager.h"
#include "td/telegram/FileReferenceManager.h"
#include "td/telegram/files/FileGcWorker.h"
@ -21,6 +18,9 @@
#include "td/telegram/Td.h"
#include "td/telegram/UpdatesManager.h"
#include "td/mtproto/SessionConnection.h"
#include "td/mtproto/Transport.h"
#include "td/db/binlog/Binlog.h"
#include "td/db/SqliteStatement.h"

View File

@ -17,6 +17,7 @@
#include "td/telegram/Contact.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/Dependencies.h"
#include "td/telegram/DialogAction.h"
#include "td/telegram/DialogParticipant.h"
#include "td/telegram/Document.h"
#include "td/telegram/DocumentsManager.h"
@ -73,6 +74,7 @@
#include "td/actor/PromiseFuture.h"
#include "td/utils/algorithm.h"
#include "td/utils/emoji.h"
#include "td/utils/format.h"
#include "td/utils/HttpUrl.h"
#include "td/utils/logging.h"
@ -655,9 +657,8 @@ class MessageDice final : public MessageContent {
static constexpr const char *DEFAULT_EMOJI = "🎲";
MessageDice() = default;
MessageDice(string emoji, int32 dice_value)
: emoji(emoji.empty() ? string(DEFAULT_EMOJI) : remove_emoji_modifiers(std::move(emoji)))
, dice_value(dice_value) {
MessageDice(const string &emoji, int32 dice_value)
: emoji(emoji.empty() ? string(DEFAULT_EMOJI) : remove_emoji_modifiers(emoji).str()), dice_value(dice_value) {
}
MessageContentType get_type() const final {
@ -1397,9 +1398,8 @@ static void parse(unique_ptr<MessageContent> &content, ParserT &parser) {
case MessageContentType::Dice: {
auto m = make_unique<MessageDice>();
if (parser.version() >= static_cast<int32>(Version::AddDiceEmoji)) {
string emoji;
parse(emoji, parser);
m->emoji = remove_emoji_modifiers(std::move(emoji));
parse(m->emoji, parser);
remove_emoji_modifiers_in_place(m->emoji);
} else {
m->emoji = MessageDice::DEFAULT_EMOJI;
}
@ -1676,7 +1676,7 @@ static Result<InputMessageContent> create_input_message_content(
if (!clean_input_string(input_dice->emoji_)) {
return Status::Error(400, "Dice emoji must be encoded in UTF-8");
}
content = td::make_unique<MessageDice>(std::move(input_dice->emoji_), 0);
content = td::make_unique<MessageDice>(input_dice->emoji_, 0);
clear_draft = input_dice->clear_draft_;
break;
}
@ -1995,7 +1995,7 @@ Result<InputMessageContent> get_input_message_content(
FileId file_id;
if (have_file) {
if (r_file_id.is_error()) {
return Status::Error(7, r_file_id.error().message());
return Status::Error(400, r_file_id.error().message());
}
file_id = r_file_id.ok();
CHECK(file_id.is_valid());
@ -3971,9 +3971,9 @@ unique_ptr<MessageContent> get_secret_message_content(
if (!clean_input_string(message_contact->last_name_)) {
message_contact->last_name_.clear();
}
return make_unique<MessageContact>(
Contact(std::move(message_contact->phone_number_), std::move(message_contact->first_name_),
std::move(message_contact->last_name_), string(), UserId(message_contact->user_id_)));
return make_unique<MessageContact>(Contact(std::move(message_contact->phone_number_),
std::move(message_contact->first_name_),
std::move(message_contact->last_name_), string(), UserId()));
}
case secret_api::decryptedMessageMediaWebPage::ID: {
auto media_web_page = move_tl_object_as<secret_api::decryptedMessageMediaWebPage>(media);
@ -5304,6 +5304,36 @@ string get_message_content_search_text(const Td *td, const MessageContent *conte
}
}
void get_message_content_animated_emoji_click_sticker(const MessageContent *content, FullMessageId full_message_id,
Td *td, Promise<td_api::object_ptr<td_api::sticker>> &&promise) {
if (content->get_type() != MessageContentType::Text) {
return promise.set_error(Status::Error(400, "Message is not an animated emoji message"));
}
auto &text = static_cast<const MessageText *>(content)->text;
if (!text.entities.empty()) {
return promise.set_error(Status::Error(400, "Message is not an animated emoji message"));
}
td->stickers_manager_->get_animated_emoji_click_sticker(text.text, full_message_id, std::move(promise));
}
void on_message_content_animated_emoji_clicked(const MessageContent *content, FullMessageId full_message_id, Td *td,
Slice emoji, string data) {
if (content->get_type() != MessageContentType::Text) {
return;
}
emoji = remove_emoji_modifiers(emoji);
auto &text = static_cast<const MessageText *>(content)->text;
if (!text.entities.empty() || remove_emoji_modifiers(text.text) != emoji) {
return;
}
auto error = td->stickers_manager_->on_animated_emoji_message_clicked(emoji, full_message_id, data);
if (error.is_error()) {
LOG(WARNING) << "Failed to process animated emoji click with data \"" << data << "\": " << error;
}
}
bool need_reget_message_content(const MessageContent *content) {
CHECK(content != nullptr);
switch (content->get_type()) {
@ -5531,6 +5561,15 @@ StickerSetId add_sticker_set(Td *td, tl_object_ptr<telegram_api::InputStickerSet
return td->stickers_manager_->add_sticker_set(std::move(input_sticker_set));
}
bool is_unsent_animated_emoji_click(Td *td, DialogId dialog_id, const DialogAction &action) {
auto emoji = action.get_watching_animations_emoji();
if (emoji.empty()) {
// not a WatchingAnimations action
return false;
}
return !td->stickers_manager_->is_sent_animated_emoji_click(dialog_id, remove_emoji_modifiers(emoji));
}
void on_dialog_used(TopDialogCategory category, DialogId dialog_id, int32 date) {
send_closure(G()->top_dialog_manager(), &TopDialogManager::on_dialog_used, category, dialog_id, date);
}

View File

@ -38,6 +38,7 @@
namespace td {
struct Dependencies;
class DialogAction;
class Game;
struct Photo;
class Td;
@ -225,6 +226,12 @@ vector<FileId> get_message_content_file_ids(const MessageContent *content, const
string get_message_content_search_text(const Td *td, const MessageContent *content);
void get_message_content_animated_emoji_click_sticker(const MessageContent *content, FullMessageId full_message_id,
Td *td, Promise<td_api::object_ptr<td_api::sticker>> &&promise);
void on_message_content_animated_emoji_clicked(const MessageContent *content, FullMessageId full_message_id, Td *td,
Slice emoji, string data);
bool need_reget_message_content(const MessageContent *content);
bool need_delay_message_content_notification(const MessageContent *content, UserId my_user_id);
@ -239,6 +246,8 @@ void on_sent_message_content(Td *td, const MessageContent *content);
StickerSetId add_sticker_set(Td *td, tl_object_ptr<telegram_api::InputStickerSet> &&input_sticker_set);
bool is_unsent_animated_emoji_click(Td *td, DialogId dialog_id, const DialogAction &action);
void on_dialog_used(TopDialogCategory category, DialogId dialog_id, int32 date);
void update_used_hashtags(Td *td, const MessageContent *content);

View File

@ -1805,7 +1805,7 @@ static UserId get_link_user_id(Slice url) {
Slice value;
std::tie(key, value) = split(parameter, '=');
if (key == Slice("id")) {
auto r_user_id = to_integer_safe<int32>(value);
auto r_user_id = to_integer_safe<int64>(value);
if (r_user_id.is_error()) {
return UserId();
}
@ -3267,7 +3267,7 @@ Result<vector<MessageEntity>> get_message_entities(const ContactsManager *contac
auto entity_mention_name = static_cast<td_api::textEntityTypeMentionName *>(entity->type_.get());
UserId user_id(entity_mention_name->user_id_);
if (contacts_manager != nullptr && !contacts_manager->have_input_user(user_id)) {
return Status::Error(7, "Have no access to the user");
return Status::Error(400, "Have no access to the user");
}
entities.emplace_back(entity->offset_, entity->length_, user_id);
break;
@ -3972,7 +3972,7 @@ Status fix_formatted_text(string &text, vector<MessageEntity> &entities, bool al
entities.clear();
return Status::OK();
}
return Status::Error(3, "Message must be non-empty");
return Status::Error(400, "Message must be non-empty");
}
// re-fix entities if needed after removal of some characters
@ -4023,7 +4023,7 @@ Status fix_formatted_text(string &text, vector<MessageEntity> &entities, bool al
LOG_CHECK(check_utf8(text)) << text;
if (!allow_empty && is_empty_string(text)) {
return Status::Error(3, "Message must be non-empty");
return Status::Error(400, "Message must be non-empty");
}
constexpr size_t LENGTH_LIMIT = 35000; // server side limit

View File

@ -7,6 +7,9 @@
#pragma once
#include "td/telegram/DialogId.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/utils/common.h"
@ -14,10 +17,6 @@
#include "td/utils/Status.h"
#include "td/utils/StringBuilder.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include <unordered_set>
#include <utility>

View File

@ -17,7 +17,7 @@
namespace td {
MessageReplyInfo::MessageReplyInfo(tl_object_ptr<telegram_api::messageReplies> &&reply_info, bool is_bot) {
if (reply_info == nullptr || is_bot) {
if (reply_info == nullptr || is_bot || reply_info->channel_id_ == 777) {
return;
}
if (reply_info->replies_ < 0) {

View File

@ -118,6 +118,9 @@ struct MessageReplyInfo {
if (has_last_read_outbox_message_id) {
td::parse(last_read_outbox_message_id, parser);
}
if (channel_id.get() == 777) {
*this = MessageReplyInfo();
}
}
};

File diff suppressed because it is too large Load Diff

View File

@ -196,7 +196,7 @@ class MessagesManager final : public Actor {
void get_channel_difference_if_needed(DialogId dialog_id, MessagesInfo &&messages_info,
Promise<MessagesInfo> &&promise);
bool run_get_channel_difference_request(long id);
void get_channel_differences_if_needed(MessagesInfo &&messages_info, Promise<MessagesInfo> &&promise);
void on_get_messages(vector<tl_object_ptr<telegram_api::Message>> &&messages, bool is_channel_message,
bool is_scheduled, const char *source);
@ -229,9 +229,8 @@ class MessagesManager final : public Actor {
vector<tl_object_ptr<telegram_api::Message>> &&messages);
void on_get_recent_locations_failed(int64 random_id);
void on_get_message_public_forwards_result(int64 random_id, int32 total_count,
vector<tl_object_ptr<telegram_api::Message>> &&messages);
void on_failed_get_message_public_forwards(int64 random_id);
void on_get_message_public_forwards(int32 total_count, vector<tl_object_ptr<telegram_api::Message>> &&messages,
Promise<td_api::object_ptr<td_api::foundMessages>> &&promise);
// if message is from_update, flags have_previous and have_next are ignored and must be both true
FullMessageId on_get_message(tl_object_ptr<telegram_api::Message> message_ptr, bool from_update,
@ -272,7 +271,7 @@ class MessagesManager final : public Actor {
int32 total_count, vector<tl_object_ptr<telegram_api::Message>> &&messages,
Promise<Unit> &&promise);
void on_get_common_dialogs(UserId user_id, int32 offset_chat_id, vector<tl_object_ptr<telegram_api::Chat>> &&chats,
void on_get_common_dialogs(UserId user_id, int64 offset_chat_id, vector<tl_object_ptr<telegram_api::Chat>> &&chats,
int32 total_count);
bool on_update_message_id(int64 random_id, MessageId new_message_id, const string &source);
@ -473,6 +472,8 @@ class MessagesManager final : public Actor {
void send_dialog_action(DialogId dialog_id, MessageId top_thread_message_id, DialogAction action,
Promise<Unit> &&promise);
void after_set_typing_query(DialogId dialog_id, int32 generation);
vector<DialogListId> get_dialog_lists_to_add_dialog(DialogId dialog_id);
void add_dialog_to_list(DialogId dialog_id, DialogListId dialog_list_id, Promise<Unit> &&promise);
@ -582,6 +583,10 @@ class MessagesManager final : public Actor {
DialogId dialog_id, MessageId message_id, DialogId expected_dialog_id,
MessageId expected_message_id, Promise<MessageThreadInfo> promise);
void get_message_viewers(FullMessageId full_message_id, Promise<td_api::object_ptr<td_api::users>> &&promise);
bool is_dialog_opened(DialogId dialog_id) const;
bool is_message_edited_recently(FullMessageId full_message_id, int32 seconds);
bool is_deleted_secret_chat(DialogId dialog_id) const;
@ -649,6 +654,9 @@ class MessagesManager final : public Actor {
Status open_message_content(FullMessageId full_message_id) TD_WARN_UNUSED_RESULT;
void click_animated_emoji_message(FullMessageId full_message_id,
Promise<td_api::object_ptr<td_api::sticker>> &&promise);
td_api::object_ptr<td_api::updateScopeNotificationSettings> get_update_scope_notification_settings_object(
NotificationSettingsScope scope) const;
@ -730,8 +738,8 @@ class MessagesManager final : public Actor {
vector<MessageId> get_dialog_scheduled_messages(DialogId dialog_id, bool force, bool ignore_result,
Promise<Unit> &&promise);
FoundMessages get_message_public_forwards(FullMessageId full_message_id, const string &offset, int32 limit,
int64 &random_id, Promise<Unit> &&promise);
void get_message_public_forwards(FullMessageId full_message_id, string offset, int32 limit,
Promise<td_api::object_ptr<td_api::foundMessages>> &&promise);
tl_object_ptr<td_api::message> get_dialog_message_by_date_object(int64 random_id);
@ -902,7 +910,7 @@ class MessagesManager final : public Actor {
void stop_poll(FullMessageId full_message_id, td_api::object_ptr<td_api::ReplyMarkup> &&reply_markup,
Promise<Unit> &&promise);
Result<string> get_login_button_url(FullMessageId full_message_id, int32 button_id);
Result<string> get_login_button_url(FullMessageId full_message_id, int64 button_id);
Result<ServerMessageId> get_invoice_message_id(FullMessageId full_message_id);
@ -1635,7 +1643,7 @@ class MessagesManager final : public Actor {
};
class BlockMessageSenderFromRepliesOnServerLogEvent;
class ChangeDialogReportSpamStateOnServerLogEvent;
class ToggleDialogReportSpamStateOnServerLogEvent;
class DeleteAllChannelMessagesFromUserOnServerLogEvent;
class DeleteDialogHistoryFromServerLogEvent;
class DeleteAllCallMessagesFromServerLogEvent;
@ -1818,6 +1826,10 @@ class MessagesManager final : public Actor {
static Status can_get_media_timestamp_link(DialogId dialog_id, const Message *m);
Status can_get_message_viewers(FullMessageId full_message_id) TD_WARN_UNUSED_RESULT;
Status can_get_message_viewers(DialogId dialog_id, const Message *m) const TD_WARN_UNUSED_RESULT;
void cancel_edit_message_media(DialogId dialog_id, Message *m, Slice error_message);
void on_message_media_edited(DialogId dialog_id, MessageId message_id, FileId file_id, FileId thumbnail_file_id,
@ -2110,7 +2122,7 @@ class MessagesManager final : public Actor {
void load_messages_impl(const Dialog *d, MessageId from_message_id, int32 offset, int32 limit, int left_tries,
bool only_local, Promise<Unit> &&promise);
void load_dialog_scheduled_messages(DialogId dialog_id, bool from_database, int32 hash, Promise<Unit> &&promise);
void load_dialog_scheduled_messages(DialogId dialog_id, bool from_database, int64 hash, Promise<Unit> &&promise);
void on_get_scheduled_messages_from_database(DialogId dialog_id, vector<BufferSlice> &&messages);
@ -2664,6 +2676,8 @@ class MessagesManager final : public Actor {
Message *get_message(FullMessageId full_message_id);
const Message *get_message(FullMessageId full_message_id) const;
bool have_message_force(Dialog *d, MessageId message_id, const char *source);
Message *get_message_force(Dialog *d, MessageId message_id, const char *source);
Message *get_message_force(FullMessageId full_message_id, const char *source);
@ -2763,6 +2777,9 @@ class MessagesManager final : public Actor {
void on_get_discussion_message(DialogId dialog_id, MessageId message_id, MessageThreadInfo &&message_thread_info,
Promise<MessageThreadInfo> &&promise);
void on_get_message_viewers(DialogId dialog_id, vector<UserId> user_ids, bool is_recursive,
Promise<td_api::object_ptr<td_api::users>> &&promise);
static MessageId get_first_database_message_id_by_index(const Dialog *d, MessageSearchFilter filter);
void on_search_dialog_messages_db_result(int64 random_id, DialogId dialog_id, MessageId from_message_id,
@ -2845,7 +2862,7 @@ class MessagesManager final : public Actor {
void reset_all_notification_settings_on_server(uint64 log_event_id);
void change_dialog_report_spam_state_on_server(DialogId dialog_id, bool is_spam_dialog, uint64 log_event_id,
void toggle_dialog_report_spam_state_on_server(DialogId dialog_id, bool is_spam_dialog, uint64 log_event_id,
Promise<Unit> &&promise);
void set_dialog_folder_id_on_server(DialogId dialog_id, bool from_binlog);
@ -2974,6 +2991,11 @@ class MessagesManager final : public Actor {
Status can_import_messages(DialogId dialog_id);
void send_get_message_public_forwards_query(DcId dc_id, FullMessageId full_message_id, string offset, int32 limit,
Promise<td_api::object_ptr<td_api::foundMessages>> &&promise);
void on_animated_emoji_message_clicked(FullMessageId full_message_id, UserId user_id, Slice emoji, string data);
void add_sponsored_dialog(const Dialog *d, DialogSource source);
void save_sponsored_dialog();
@ -3029,7 +3051,7 @@ class MessagesManager final : public Actor {
void save_send_message_log_event(DialogId dialog_id, const Message *m);
uint64 save_change_dialog_report_spam_state_on_server_log_event(DialogId dialog_id, bool is_spam_dialog);
uint64 save_toggle_dialog_report_spam_state_on_server_log_event(DialogId dialog_id, bool is_spam_dialog);
uint64 save_delete_messages_from_server_log_event(DialogId dialog_id, const vector<MessageId> &message_ids,
bool revoke);
@ -3292,8 +3314,7 @@ class MessagesManager final : public Actor {
std::unordered_map<int64, std::pair<int32, vector<MessageId>>>
found_dialog_recent_location_messages_; // random_id -> [total_count, [message_id]...]
std::unordered_map<int64, FoundMessages> found_fts_messages_; // random_id -> FoundMessages
std::unordered_map<int64, FoundMessages> found_message_public_forwards_; // random_id -> FoundMessages
std::unordered_map<int64, FoundMessages> found_fts_messages_; // random_id -> FoundMessages
struct MessageEmbeddingCodes {
std::unordered_map<MessageId, string, MessageIdHash> embedding_codes_;

View File

@ -29,6 +29,7 @@
#include "td/telegram/StateManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/TdParameters.h"
#include "td/telegram/telegram_api.h"
#include "td/mtproto/AuthKey.h"
@ -3061,7 +3062,7 @@ Status NotificationManager::process_push_notification_payload(string payload, bo
DialogId dialog_id;
if (has_json_object_field(custom, "from_id")) {
TRY_RESULT(user_id_int, get_json_object_int_field(custom, "from_id"));
TRY_RESULT(user_id_int, get_json_object_long_field(custom, "from_id"));
UserId user_id(user_id_int);
if (!user_id.is_valid()) {
return Status::Error("Receive invalid user_id");
@ -3069,7 +3070,7 @@ Status NotificationManager::process_push_notification_payload(string payload, bo
dialog_id = DialogId(user_id);
}
if (has_json_object_field(custom, "chat_id")) {
TRY_RESULT(chat_id_int, get_json_object_int_field(custom, "chat_id"));
TRY_RESULT(chat_id_int, get_json_object_long_field(custom, "chat_id"));
ChatId chat_id(chat_id_int);
if (!chat_id.is_valid()) {
return Status::Error("Receive invalid chat_id");
@ -3077,7 +3078,7 @@ Status NotificationManager::process_push_notification_payload(string payload, bo
dialog_id = DialogId(chat_id);
}
if (has_json_object_field(custom, "channel_id")) {
TRY_RESULT(channel_id_int, get_json_object_int_field(custom, "channel_id"));
TRY_RESULT(channel_id_int, get_json_object_long_field(custom, "channel_id"));
ChannelId channel_id(channel_id_int);
if (!channel_id.is_valid()) {
return Status::Error("Receive invalid channel_id");
@ -3151,25 +3152,27 @@ Status NotificationManager::process_push_notification_payload(string payload, bo
UserId sender_user_id;
DialogId sender_dialog_id;
if (has_json_object_field(custom, "chat_from_broadcast_id")) {
TRY_RESULT(sender_channel_id_int, get_json_object_int_field(custom, "chat_from_broadcast_id"));
TRY_RESULT(sender_channel_id_int, get_json_object_long_field(custom, "chat_from_broadcast_id"));
sender_dialog_id = DialogId(ChannelId(sender_channel_id_int));
if (!sender_dialog_id.is_valid()) {
return Status::Error("Receive invalid chat_from_broadcast_id");
}
} else if (has_json_object_field(custom, "chat_from_group_id")) {
TRY_RESULT(sender_channel_id_int, get_json_object_int_field(custom, "chat_from_group_id"));
TRY_RESULT(sender_channel_id_int, get_json_object_long_field(custom, "chat_from_group_id"));
sender_dialog_id = DialogId(ChannelId(sender_channel_id_int));
if (!sender_dialog_id.is_valid()) {
return Status::Error("Receive invalid chat_from_group_id");
}
} else if (has_json_object_field(custom, "chat_from_id")) {
TRY_RESULT(sender_user_id_int, get_json_object_int_field(custom, "chat_from_id"));
TRY_RESULT(sender_user_id_int, get_json_object_long_field(custom, "chat_from_id"));
sender_user_id = UserId(sender_user_id_int);
if (!sender_user_id.is_valid()) {
return Status::Error("Receive invalid chat_from_id");
}
} else if (dialog_id.get_type() == DialogType::User) {
sender_user_id = dialog_id.get_user_id();
} else if (dialog_id.get_type() == DialogType::Channel) {
sender_dialog_id = dialog_id;
}
TRY_RESULT(contains_mention_int, get_json_object_int_field(custom, "mention"));
@ -3841,7 +3844,7 @@ Result<int64> NotificationManager::get_push_receiver_id(string payload) {
if (r_user_id.ok() <= 0) {
return Status::Error(400, PSLICE() << "Receive wrong user_id " << user_id_str);
}
return static_cast<int64>(r_user_id.ok());
return r_user_id.ok();
}
}

View File

@ -195,7 +195,7 @@ class NotificationTypePushMessage final : public NotificationType {
return td_api::make_object<td_api::pushMessageContentChatChangePhoto>();
}
if (key == "MESSAGE_CHAT_CHANGE_THEME") {
return td_api::make_object<td_api::pushMessageContentChatChangeTheme>(arg);
return td_api::make_object<td_api::pushMessageContentChatSetTheme>(arg);
}
if (key == "MESSAGE_CHAT_CHANGE_TITLE") {
return td_api::make_object<td_api::pushMessageContentChatChangeTitle>(arg);

View File

@ -582,7 +582,7 @@ void PasswordManager::update_password_settings(UpdateSettings update_settings, P
return promise.set_error(r_update_settings.move_as_error());
}
if (!r_update_settings.ok()) {
return promise.set_error(Status::Error(5, "account_updatePasswordSettings returned false"));
return promise.set_error(Status::Error(400, "account_updatePasswordSettings returned false"));
}
send_closure(actor_id, &PasswordManager::get_state, std::move(promise));
});

View File

@ -45,7 +45,7 @@ void PhoneNumberManager::process_send_code_result(uint64 query_id, const T &send
void PhoneNumberManager::set_phone_number(uint64 query_id, string phone_number, Settings settings) {
if (phone_number.empty()) {
return on_query_error(query_id, Status::Error(8, "Phone number can't be empty"));
return on_query_error(query_id, Status::Error(400, "Phone number can't be empty"));
}
switch (type_) {
@ -64,10 +64,10 @@ void PhoneNumberManager::set_phone_number(uint64 query_id, string phone_number,
void PhoneNumberManager::set_phone_number_and_hash(uint64 query_id, string hash, string phone_number,
Settings settings) {
if (phone_number.empty()) {
return on_query_error(query_id, Status::Error(8, "Phone number can't be empty"));
return on_query_error(query_id, Status::Error(400, "Phone number can't be empty"));
}
if (hash.empty()) {
return on_query_error(query_id, Status::Error(8, "Hash can't be empty"));
return on_query_error(query_id, Status::Error(400, "Hash can't be empty"));
}
switch (type_) {
@ -83,7 +83,7 @@ void PhoneNumberManager::set_phone_number_and_hash(uint64 query_id, string hash,
void PhoneNumberManager::resend_authentication_code(uint64 query_id) {
if (state_ != State::WaitCode) {
return on_query_error(query_id, Status::Error(8, "resendAuthenticationCode unexpected"));
return on_query_error(query_id, Status::Error(400, "resendAuthenticationCode unexpected"));
}
auto r_resend_code = send_code_helper_.resend_code();
@ -103,7 +103,7 @@ void PhoneNumberManager::send_new_check_code_query(const T &query) {
void PhoneNumberManager::check_code(uint64 query_id, string code) {
if (state_ != State::WaitCode) {
return on_query_error(query_id, Status::Error(8, "checkAuthenticationCode unexpected"));
return on_query_error(query_id, Status::Error(400, "checkAuthenticationCode unexpected"));
}
on_new_query(query_id);
@ -125,7 +125,7 @@ void PhoneNumberManager::check_code(uint64 query_id, string code) {
void PhoneNumberManager::on_new_query(uint64 query_id) {
if (query_id_ != 0) {
on_query_error(Status::Error(9, "Another authorization query has started"));
on_query_error(Status::Error(400, "Another authorization query has started"));
}
net_query_id_ = 0;
net_query_type_ = NetQueryType::None;

View File

@ -6,9 +6,6 @@
//
#include "td/telegram/Photo.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/files/FileEncryptionKey.h"
#include "td/telegram/files/FileLocation.h"
#include "td/telegram/files/FileManager.h"

View File

@ -12,12 +12,11 @@
#include "td/telegram/files/FileType.h"
#include "td/telegram/net/DcId.h"
#include "td/telegram/PhotoSizeSource.h"
#include "td/telegram/SecretInputMedia.h"
#include "td/telegram/UserId.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/SecretInputMedia.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/utils/buffer.h"
#include "td/utils/common.h"

View File

@ -24,6 +24,7 @@
#include "td/telegram/StateManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/TdParameters.h"
#include "td/telegram/telegram_api.hpp"
#include "td/telegram/UpdatesManager.h"

View File

@ -30,7 +30,7 @@ namespace td {
Result<PrivacyManager::UserPrivacySetting> PrivacyManager::UserPrivacySetting::get_user_privacy_setting(
tl_object_ptr<td_api::UserPrivacySetting> key) {
if (!key) {
return Status::Error(5, "UserPrivacySetting must be non-empty");
return Status::Error(400, "UserPrivacySetting must be non-empty");
}
return UserPrivacySetting(*key);
}
@ -279,7 +279,7 @@ tl_object_ptr<telegram_api::InputPrivacyRule> PrivacyManager::UserPrivacySetting
case Type::AllowUsers:
return make_tl_object<telegram_api::inputPrivacyValueAllowUsers>(get_input_users());
case Type::AllowChatParticipants:
return make_tl_object<telegram_api::inputPrivacyValueAllowChatParticipants>(vector<int32>{chat_ids_});
return make_tl_object<telegram_api::inputPrivacyValueAllowChatParticipants>(vector<int64>{chat_ids_});
case Type::RestrictContacts:
return make_tl_object<telegram_api::inputPrivacyValueDisallowContacts>();
case Type::RestrictAll:
@ -287,7 +287,7 @@ tl_object_ptr<telegram_api::InputPrivacyRule> PrivacyManager::UserPrivacySetting
case Type::RestrictUsers:
return make_tl_object<telegram_api::inputPrivacyValueDisallowUsers>(get_input_users());
case Type::RestrictChatParticipants:
return make_tl_object<telegram_api::inputPrivacyValueDisallowChatParticipants>(vector<int32>{chat_ids_});
return make_tl_object<telegram_api::inputPrivacyValueDisallowChatParticipants>(vector<int64>{chat_ids_});
default:
UNREACHABLE();
}
@ -379,12 +379,12 @@ Result<PrivacyManager::UserPrivacySettingRules> PrivacyManager::UserPrivacySetti
Result<PrivacyManager::UserPrivacySettingRules> PrivacyManager::UserPrivacySettingRules::get_user_privacy_setting_rules(
tl_object_ptr<td_api::userPrivacySettingRules> rules) {
if (!rules) {
return Status::Error(5, "UserPrivacySettingRules must be non-empty");
return Status::Error(400, "UserPrivacySettingRules must be non-empty");
}
UserPrivacySettingRules result;
for (auto &rule : rules->rules_) {
if (!rule) {
return Status::Error(5, "UserPrivacySettingRule must be non-empty");
return Status::Error(400, "UserPrivacySettingRule must be non-empty");
}
result.rules_.emplace_back(*rule);
}
@ -463,7 +463,7 @@ void PrivacyManager::set_privacy(tl_object_ptr<td_api::UserPrivacySetting> key,
auto &info = get_info(user_privacy_setting);
if (info.has_set_query) {
// TODO cancel previous query
return promise.set_error(Status::Error(5, "Another set_privacy query is active"));
return promise.set_error(Status::Error(400, "Another set_privacy query is active"));
}
auto net_query = G()->net_query_creator().create(telegram_api::account_setPrivacy(
user_privacy_setting.get_input_privacy_key(), privacy_rules.get_input_privacy_rules()));

View File

@ -99,7 +99,7 @@ class PrivacyManager final : public NetQueryCallback {
} type_ = Type::RestrictAll;
vector<UserId> user_ids_;
vector<int32> chat_ids_;
vector<int64> chat_ids_;
vector<tl_object_ptr<telegram_api::InputUser>> get_input_users() const;

View File

@ -6,15 +6,22 @@
//
#include "td/telegram/RecentDialogList.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/DialogListId.h"
#include "td/telegram/FolderId.h"
#include "td/telegram/Global.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/td_api.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/TdParameters.h"
#include "td/actor/MultiPromise.h"
#include "td/utils/algorithm.h"
#include "td/utils/misc.h"
#include "td/utils/Slice.h"
#include "td/utils/SliceBuilder.h"
#include <algorithm>

View File

@ -21,7 +21,7 @@ namespace td {
class Td;
// stores list of Dialog identifiers of a limited size
class RecentDialogList : public Actor {
class RecentDialogList final : public Actor {
public:
RecentDialogList(Td *td, const char *name, size_t max_size);

View File

@ -494,7 +494,7 @@ static Result<InlineKeyboardButton> get_inline_keyboard_button(tl_object_ptr<td_
return Status::Error(400, "Inline keyboard button forward text must be encoded in UTF-8");
}
current_button.id = login_url->id_;
if (current_button.id == 0 || current_button.id == std::numeric_limits<int32>::min()) {
if (current_button.id == 0 || current_button.id == std::numeric_limits<int64>::min()) {
return Status::Error(400, "Invalid bot_user_id specified");
}
break;
@ -662,7 +662,7 @@ static tl_object_ptr<telegram_api::KeyboardButton> get_inline_keyboard_button(
return make_tl_object<telegram_api::keyboardButtonBuy>(keyboard_button.text);
case InlineKeyboardButton::Type::UrlAuth: {
int32 flags = 0;
int32 bot_user_id = keyboard_button.id;
int64 bot_user_id = keyboard_button.id;
if (bot_user_id > 0) {
flags |= telegram_api::inputKeyboardButtonUrlAuth::REQUEST_WRITE_ACCESS_MASK;
} else {

View File

@ -42,7 +42,7 @@ struct InlineKeyboardButton {
CallbackWithPassword
};
Type type;
int32 id = 0; // UrlAuth only, button_id or (2 * request_write_access - 1) * bot_user_id
int64 id = 0; // UrlAuth only, button_id or (2 * request_write_access - 1) * bot_user_id
string text;
string forward_text; // UrlAuth only
string data;

View File

@ -7,6 +7,7 @@
#pragma once
#include "td/telegram/ReplyMarkup.h"
#include "td/telegram/Version.h"
#include "td/utils/tl_helpers.h"
@ -38,7 +39,13 @@ template <class ParserT>
void parse(InlineKeyboardButton &button, ParserT &parser) {
parse(button.type, parser);
if (button.type == InlineKeyboardButton::Type::UrlAuth) {
parse(button.id, parser);
if (parser.version() >= static_cast<int32>(Version::Support64BitIds)) {
parse(button.id, parser);
} else {
int32 old_id;
parse(old_id, parser);
button.id = old_id;
}
}
parse(button.text, parser);
parse(button.data, parser);

View File

@ -6,14 +6,13 @@
//
#pragma once
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/telegram/AuthManager.h"
#include "td/telegram/Td.h"
#include "td/telegram/td_api.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Status.h"

View File

@ -381,7 +381,7 @@ class SecretChatActor final : public NetQueryCallback {
}
template <class StorerT>
void store(StorerT &storer) const {
uint32 flags = 0;
uint32 flags = 8;
bool has_date = date != 0;
bool has_key_hash = true;
bool has_initial_folder_id = initial_folder_id != FolderId();
@ -399,7 +399,7 @@ class SecretChatActor final : public NetQueryCallback {
storer.store_int(id);
storer.store_long(access_hash);
storer.store_int(user_id.get());
storer.store_long(user_id.get());
storer.store_long(user_access_hash);
storer.store_int(random_id);
if (has_date) {
@ -425,12 +425,17 @@ class SecretChatActor final : public NetQueryCallback {
bool has_date = (flags & 1) != 0;
bool has_key_hash = (flags & 2) != 0;
bool has_initial_folder_id = (flags & 4) != 0;
bool has_64bit_user_id = (flags & 8) != 0;
x = parser.fetch_int();
id = parser.fetch_int();
access_hash = parser.fetch_long();
user_id = UserId(parser.fetch_int());
if (has_64bit_user_id) {
user_id = UserId(parser.fetch_long());
} else {
user_id = UserId(static_cast<int64>(parser.fetch_int()));
}
user_access_hash = parser.fetch_long();
random_id = parser.fetch_int();
if (has_date) {
@ -483,7 +488,7 @@ class SecretChatActor final : public NetQueryCallback {
// So we can do it immediatelly after EVENT is SENT to the binlog, because SEND CHANGE and ERASE EVENT will be
// ordered automatically.
//
// We will use common ChangeProcessor for all changes (inside one SecretChatActor).
// We will use common ChangesProcessor for all changes (inside one SecretChatActor).
// So all changes will be saved in exactly the same order as they are applied.
template <class StateT>

View File

@ -19,18 +19,17 @@
#include "td/telegram/SequenceDispatcher.h"
#include "td/telegram/StateManager.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/TdParameters.h"
#include "td/telegram/telegram_api.hpp"
#include "td/mtproto/DhCallback.h"
#include "td/actor/PromiseFuture.h"
#include "td/db/binlog/BinlogEvent.h"
#include "td/db/binlog/BinlogHelper.h"
#include "td/db/binlog/BinlogInterface.h"
#include "td/actor/PromiseFuture.h"
#include "td/utils/common.h"
#include "td/utils/format.h"
#include "td/utils/logging.h"

View File

@ -7,12 +7,11 @@
#pragma once
#include "td/telegram/logevent/SecretChatEvent.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/SecretChatId.h"
#include "td/telegram/UserId.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
#include "td/actor/actor.h"
#include "td/actor/PromiseFuture.h"

View File

@ -396,6 +396,7 @@ telegram_api::object_ptr<telegram_api::InputSecureFile> get_input_secure_file_ob
LOG(ERROR) << "Receive invalid EncryptedSecureFile";
return nullptr;
}
CHECK(input_file.file_id.is_valid());
CHECK(file_manager->get_file_view(file.file.file_id).file_id() ==
file_manager->get_file_view(input_file.file_id).file_id());
auto res = std::move(input_file.input_file);

View File

@ -28,7 +28,7 @@ td_api::object_ptr<td_api::authenticationCodeInfo> SendCodeHelper::get_authentic
Result<telegram_api::auth_resendCode> SendCodeHelper::resend_code() {
if (next_code_info_.type == AuthenticationCodeInfo::Type::None) {
return Status::Error(8, "Authentication code can't be resend");
return Status::Error(400, "Authentication code can't be resend");
}
sent_code_info_ = next_code_info_;
next_code_info_ = {};

View File

@ -16,6 +16,10 @@ string SpecialStickerSetType::animated_emoji() {
return "animated_emoji_sticker_set";
}
string SpecialStickerSetType::animated_emoji_click() {
return "animated_emoji_click_sticker_set";
}
string SpecialStickerSetType::animated_dice(const string &emoji) {
CHECK(!emoji.empty());
return PSTRING() << "animated_dice_sticker_set#" << emoji;
@ -28,6 +32,9 @@ SpecialStickerSetType::SpecialStickerSetType(
case telegram_api::inputStickerSetAnimatedEmoji::ID:
type_ = animated_emoji();
break;
case telegram_api::inputStickerSetAnimatedEmojiAnimations::ID:
type_ = animated_emoji_click();
break;
case telegram_api::inputStickerSetDice::ID:
type_ = animated_dice(static_cast<const telegram_api::inputStickerSetDice *>(input_sticker_set.get())->emoticon_);
break;
@ -45,9 +52,12 @@ string SpecialStickerSetType::get_dice_emoji() const {
}
telegram_api::object_ptr<telegram_api::InputStickerSet> SpecialStickerSetType::get_input_sticker_set() const {
if (type_ == "animated_emoji_sticker_set") {
if (type_ == animated_emoji()) {
return telegram_api::make_object<telegram_api::inputStickerSetAnimatedEmoji>();
}
if (type_ == animated_emoji_click()) {
return telegram_api::make_object<telegram_api::inputStickerSetAnimatedEmojiAnimations>();
}
auto emoji = get_dice_emoji();
if (!emoji.empty()) {
return telegram_api::make_object<telegram_api::inputStickerSetDice>(emoji);

View File

@ -17,6 +17,8 @@ struct SpecialStickerSetType {
static string animated_emoji();
static string animated_emoji_click();
static string animated_dice(const string &emoji);
string get_dice_emoji() const;

Some files were not shown because too many files have changed in this diff Show More