diff --git a/CMakeLists.txt b/CMakeLists.txt
index aabad071e..50beaa4ca 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
-project(TDLib VERSION 1.7.0 LANGUAGES CXX C)
+project(TDLib VERSION 1.7.2 LANGUAGES CXX C)
if (NOT DEFINED CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH "")
@@ -201,7 +201,6 @@ endif()
get_directory_property(HAS_PARENT PARENT_DIRECTORY)
if (HAS_PARENT)
- set(TL_TD_API_TLO ${TL_TD_API_TLO} PARENT_SCOPE) # was used in standalone binding generators
set(TL_TD_JSON_AUTO ${TL_TD_JSON_AUTO_SOURCE} PARENT_SCOPE) # used in tdbot
set(TD_TEST_SOURCE ${TD_TEST_SOURCE} PARENT_SCOPE) # used to build tests
endif()
@@ -295,6 +294,7 @@ set(TDLIB_SOURCE
td/telegram/DialogDb.cpp
td/telegram/DialogFilter.cpp
td/telegram/DialogId.cpp
+ td/telegram/DialogInviteLink.cpp
td/telegram/DialogLocation.cpp
td/telegram/DialogParticipant.cpp
td/telegram/DialogSource.cpp
@@ -343,6 +343,7 @@ set(TDLIB_SOURCE
td/telegram/MessagesDb.cpp
td/telegram/MessageSearchFilter.cpp
td/telegram/MessagesManager.cpp
+ td/telegram/MessageTtlSetting.cpp
td/telegram/misc.cpp
td/telegram/net/AuthDataShared.cpp
td/telegram/net/ConnectionCreator.cpp
@@ -374,6 +375,7 @@ set(TDLIB_SOURCE
td/telegram/PollManager.cpp
td/telegram/QueryCombiner.cpp
td/telegram/ReplyMarkup.cpp
+ td/telegram/ReportReason.cpp
td/telegram/RestrictionReason.cpp
td/telegram/SecretChatActor.cpp
td/telegram/SecretChatDb.cpp
@@ -461,6 +463,7 @@ set(TDLIB_SOURCE
td/telegram/DialogFilter.h
td/telegram/DialogFilterId.h
td/telegram/DialogId.h
+ td/telegram/DialogInviteLink.h
td/telegram/DialogListId.h
td/telegram/DialogLocation.h
td/telegram/DialogParticipant.h
@@ -523,6 +526,7 @@ set(TDLIB_SOURCE
td/telegram/MessagesDb.h
td/telegram/MessageSearchFilter.h
td/telegram/MessagesManager.h
+ td/telegram/MessageTtlSetting.h
td/telegram/misc.h
td/telegram/net/AuthDataShared.h
td/telegram/net/ConnectionCreator.h
@@ -567,6 +571,7 @@ set(TDLIB_SOURCE
td/telegram/PublicDialogType.h
td/telegram/QueryCombiner.h
td/telegram/ReplyMarkup.h
+ td/telegram/ReportReason.h
td/telegram/RequestActor.h
td/telegram/RestrictionReason.h
td/telegram/ScheduledServerMessageId.h
diff --git a/README.md b/README.md
index 4e7effa93..26a226abc 100644
--- a/README.md
+++ b/README.md
@@ -216,7 +216,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.0 REQUIRED)
+find_package(Td 1.7.2 REQUIRED)
target_link_libraries(YourTarget PRIVATE Td::TdStatic)
```
See [example/cpp/CMakeLists.txt](https://github.com/tdlib/td/tree/master/example/cpp/CMakeLists.txt).
diff --git a/SplitSource.php b/SplitSource.php
index 605ee0121..2c5da8fa6 100644
--- a/SplitSource.php
+++ b/SplitSource.php
@@ -75,6 +75,7 @@ function split_file($file, $chunks, $undo) {
$target_depth = 1 + $is_generated;
$is_static = false;
$in_define = false;
+ $in_comment = false;
$current = '';
$common = '';
$functions = array();
@@ -113,6 +114,17 @@ function split_file($file, $chunks, $undo) {
continue;
}
+ if ($in_comment && strpos($line, '*/') === 0) {
+ $in_comment = false;
+ continue;
+ }
+ if (strpos($line, '/*') === 0) {
+ $in_comment = true;
+ }
+ if ($in_comment) {
+ continue;
+ }
+
if ($depth !== $target_depth) {
$common .= $line;
continue;
@@ -139,7 +151,8 @@ function split_file($file, $chunks, $undo) {
$in_define = false;
}
}
- if (!empty(trim($current))) {
+ $current = trim($current);
+ if (!empty($current)) {
fwrite(STDERR, "ERROR: $current".PHP_EOL);
exit();
}
@@ -285,7 +298,7 @@ function split_file($file, $chunks, $undo) {
'[>](td_db[(][)]|get_td_db_impl[(])|TdDb[^A-Za-z]' => 'TdDb',
'TopDialogCategory|get_top_dialog_category' => 'TopDialogCategory',
'top_dialog_manager[_(-][^.]|TopDialogManager' => 'TopDialogManager',
- 'updates_manager[_(-][^.]|UpdatesManager|get_difference[)]' => 'UpdatesManager',
+ 'updates_manager[_(-][^.]|UpdatesManager|get_difference[)]|updateSentMessage|dummyUpdate' => 'UpdatesManager',
'WebPageId(Hash)?' => 'WebPageId',
'web_pages_manager[_(-][^.]|WebPagesManager' => 'WebPagesManager');
diff --git a/build.html b/build.html
index cfd2b192e..2cb47895f 100644
--- a/build.html
+++ b/build.html
@@ -715,7 +715,7 @@ function onOptionsChanged() {
commands.push('git clone https://github.com/tdlib/td.git');
commands.push('cd td');
- commands.push('git checkout v1.7.0');
+ // commands.push('git checkout v1.7.0');
if (use_vcpkg) {
commands.push('git clone https://github.com/Microsoft/vcpkg.git');
diff --git a/example/README.md b/example/README.md
index 17ecd1646..2e7273645 100644
--- a/example/README.md
+++ b/example/README.md
@@ -169,10 +169,10 @@ See [project.scarlet](https://github.com/aaugmentum/project.scarlet), [tdlib](ht
TDLib can be used from the Rust programming language through the [JSON](https://github.com/tdlib/td#using-json) interface.
-See [tdlib-rs](https://github.com/agnipau/tdlib-rs), which contains automatically generated classes for all TDLib API methods and objects.
+See [rust-tdlib](https://github.com/aCLr/rust-tdlib) or [tdlib-rs](https://github.com/agnipau/tdlib-rs), which provide convenient TDLib clients with automatically generated and fully-documented classes for all TDLib API methods and objects.
See [rtdlib](https://github.com/fewensa/rtdlib), [tdlib-rs](https://github.com/d653/tdlib-rs), [tdlib-futures](https://github.com/yuri91/tdlib-futures),
-[tdlib-sys](https://github.com/nuxeh/tdlib-sys), [rust-tdlib](https://github.com/lattenwald/rust-tdlib), or
+[tdlib-sys](https://github.com/nuxeh/tdlib-sys), or
[tdjson-rs](https://github.com/mersinvald/tdjson-rs) for examples of TDLib Rust bindings.
diff --git a/example/cpp/CMakeLists.txt b/example/cpp/CMakeLists.txt
index 2d1e0cde0..642bbb07a 100644
--- a/example/cpp/CMakeLists.txt
+++ b/example/cpp/CMakeLists.txt
@@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(TdExample VERSION 1.0 LANGUAGES CXX)
-find_package(Td 1.7.0 REQUIRED)
+find_package(Td 1.7.2 REQUIRED)
add_executable(tdjson_example tdjson_example.cpp)
target_link_libraries(tdjson_example PRIVATE Td::TdJson)
diff --git a/example/uwp/extension.vsixmanifest b/example/uwp/extension.vsixmanifest
index 62a2374f5..5d7989ac2 100644
--- a/example/uwp/extension.vsixmanifest
+++ b/example/uwp/extension.vsixmanifest
@@ -1,6 +1,6 @@
-
+
TDLib for Universal Windows Platform
TDLib is a library for building Telegram clients
https://core.telegram.org/tdlib
diff --git a/td/generate/CMakeLists.txt b/td/generate/CMakeLists.txt
index e9e0c7b14..c4a7312f9 100644
--- a/td/generate/CMakeLists.txt
+++ b/td/generate/CMakeLists.txt
@@ -6,147 +6,92 @@ endif()
file(MAKE_DIRECTORY auto/td/telegram)
file(MAKE_DIRECTORY auto/td/mtproto)
+file(MAKE_DIRECTORY auto/tlo)
set(TL_TD_AUTO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/auto PARENT_SCOPE)
set(TD_AUTO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/auto/td)
set(TL_TD_AUTO_SOURCE
- ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.cpp
- ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.h
- ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.hpp
- ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.cpp
- ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.h
- ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.hpp
- ${TD_AUTO_INCLUDE_DIR}/telegram/secret_api.cpp
- ${TD_AUTO_INCLUDE_DIR}/telegram/secret_api.h
- ${TD_AUTO_INCLUDE_DIR}/telegram/secret_api.hpp
- PARENT_SCOPE
-)
+ ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.cpp
+ ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.h
+ ${TD_AUTO_INCLUDE_DIR}/mtproto/mtproto_api.hpp
+ ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.cpp
+ ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.h
+ ${TD_AUTO_INCLUDE_DIR}/telegram/telegram_api.hpp
+ ${TD_AUTO_INCLUDE_DIR}/telegram/secret_api.cpp
+ ${TD_AUTO_INCLUDE_DIR}/telegram/secret_api.h
+ ${TD_AUTO_INCLUDE_DIR}/telegram/secret_api.hpp
+ PARENT_SCOPE
+ )
set(TL_TD_API_AUTO_SOURCE
- ${TD_AUTO_INCLUDE_DIR}/telegram/td_api.cpp
- ${TD_AUTO_INCLUDE_DIR}/telegram/td_api.h
- ${TD_AUTO_INCLUDE_DIR}/telegram/td_api.hpp
- PARENT_SCOPE
-)
+ ${TD_AUTO_INCLUDE_DIR}/telegram/td_api.cpp
+ ${TD_AUTO_INCLUDE_DIR}/telegram/td_api.h
+ ${TD_AUTO_INCLUDE_DIR}/telegram/td_api.hpp
+ PARENT_SCOPE
+ )
set(TL_TD_JSON_AUTO_SOURCE
- ${TD_AUTO_INCLUDE_DIR}/telegram/td_api_json.cpp
- ${TD_AUTO_INCLUDE_DIR}/telegram/td_api_json.h
- PARENT_SCOPE
-)
-
-set(TL_TD_API_TLO ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tlo)
-set(TL_TD_API_TLO ${TL_TD_API_TLO} PARENT_SCOPE)
+ ${TD_AUTO_INCLUDE_DIR}/telegram/td_api_json.cpp
+ ${TD_AUTO_INCLUDE_DIR}/telegram/td_api_json.h
+ PARENT_SCOPE
+ )
set(TL_C_AUTO_SOURCE
- ${TD_AUTO_INCLUDE_DIR}/telegram/td_tdc_api.cpp
- ${TD_AUTO_INCLUDE_DIR}/telegram/td_tdc_api.h
- ${TD_AUTO_INCLUDE_DIR}/telegram/td_tdc_api_inner.h
- PARENT_SCOPE
-)
+ ${TD_AUTO_INCLUDE_DIR}/telegram/td_tdc_api.cpp
+ ${TD_AUTO_INCLUDE_DIR}/telegram/td_tdc_api.h
+ ${TD_AUTO_INCLUDE_DIR}/telegram/td_tdc_api_inner.h
+ PARENT_SCOPE
+ )
set(TL_DOTNET_AUTO_SOURCE
- ${TD_AUTO_INCLUDE_DIR}/telegram/TdDotNetApi.cpp
- ${TD_AUTO_INCLUDE_DIR}/telegram/TdDotNetApi.h
- PARENT_SCOPE
-)
+ ${TD_AUTO_INCLUDE_DIR}/telegram/TdDotNetApi.cpp
+ ${TD_AUTO_INCLUDE_DIR}/telegram/TdDotNetApi.h
+ PARENT_SCOPE
+ )
set(TL_GENERATE_COMMON_SOURCE
- generate_common.cpp
+ generate_common.cpp
- tl_writer_cpp.cpp
- tl_writer_h.cpp
- tl_writer_hpp.cpp
- tl_writer_jni_cpp.cpp
- tl_writer_jni_h.cpp
- tl_writer_td.cpp
+ tl_writer_cpp.cpp
+ tl_writer_h.cpp
+ tl_writer_hpp.cpp
+ tl_writer_jni_cpp.cpp
+ tl_writer_jni_h.cpp
+ tl_writer_td.cpp
- tl_writer_cpp.h
- tl_writer_h.h
- tl_writer_hpp.h
- tl_writer_jni_cpp.h
- tl_writer_jni_h.h
- tl_writer_td.h
-)
+ tl_writer_cpp.h
+ tl_writer_h.h
+ tl_writer_hpp.h
+ tl_writer_jni_cpp.h
+ tl_writer_jni_h.h
+ tl_writer_td.h
+ )
set(TL_GENERATE_C_SOURCE
- generate_c.cpp
+ generate_c.cpp
- tl_writer_c.h
-)
+ tl_writer_c.h
+ )
set(TL_GENERATE_JAVA_SOURCE
- generate_java.cpp
+ generate_java.cpp
- tl_writer_java.cpp
+ tl_writer_java.cpp
- tl_writer_java.h
-)
+ tl_writer_java.h
+ )
set(TL_GENERATE_JSON_SOURCE
- generate_json.cpp
+ generate_json.cpp
- tl_json_converter.cpp
+ tl_json_converter.cpp
- tl_json_converter.h
-)
+ tl_json_converter.h
+ )
if (NOT CMAKE_CROSSCOMPILING)
- # Start of .tlo update
- add_custom_target(prepare_tl_parser ALL
- COMMAND ${CMAKE_COMMAND} -E make_directory ${CMAKE_CURRENT_SOURCE_DIR}/tl-parser/build)
- add_custom_target(configure_tl_parser
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tl-parser/build
- COMMAND ${CMAKE_COMMAND} -DCMAKE_BUILD_TYPE=Release ../
- COMMENT "Configure tl-parser"
- DEPENDS scheme/mtproto_api.tl scheme/telegram_api.tl scheme/secret_api.tl scheme/td_api.tl
- )
- add_dependencies(configure_tl_parser prepare_tl_parser)
-
- add_custom_target(build_tl_parser
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/tl-parser/build
- COMMAND ${CMAKE_COMMAND} --build .
- COMMENT "Build tl-parser"
- DEPENDS scheme/mtproto_api.tl scheme/telegram_api.tl scheme/secret_api.tl scheme/td_api.tl
- )
- add_dependencies(build_tl_parser configure_tl_parser)
- set(TL_PARSER_BIN ./tl-parser/build/tl-parser)
-
- add_custom_target(generate_mtproto_api_tlo
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${TL_PARSER_BIN} -v -e scheme/mtproto_api.tlo scheme/mtproto_api.tl
- COMMENT "Build tl-parser"
- DEPENDS scheme/mtproto_api.tl
- )
- add_dependencies(generate_mtproto_api_tlo build_tl_parser)
-
- add_custom_target(generate_secret_api_tlo
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${TL_PARSER_BIN} -v -e scheme/secret_api.tlo scheme/secret_api.tl
- COMMENT "Build tl-parser"
- DEPENDS scheme/secret_api.tl
- )
- add_dependencies(generate_secret_api_tlo build_tl_parser)
-
- add_custom_target(generate_telegram_api_tlo
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${TL_PARSER_BIN} -v -e scheme/telegram_api.tlo scheme/telegram_api.tl
- COMMENT "Build tl-parser"
- DEPENDS scheme/telegram_api.tl
- )
- add_dependencies(generate_telegram_api_tlo build_tl_parser)
-
- add_custom_target(generate_td_api_tlo
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${TL_PARSER_BIN} -v -e scheme/td_api.tlo scheme/td_api.tl
- COMMENT "Build tl-parser"
- DEPENDS scheme/td_api.tl
- )
- add_dependencies(generate_td_api_tlo build_tl_parser)
- # End of .tlo update
-
find_program(PHP_EXECUTABLE php)
if ((CMAKE_SYSTEM_NAME MATCHES "FreeBSD") AND (CMAKE_SYSTEM_VERSION MATCHES "HBSD"))
@@ -159,14 +104,27 @@ if (NOT CMAKE_CROSSCOMPILING)
set(GENERATE_COMMON_CMD generate_common)
endif()
+ add_subdirectory(tl-parser)
+
+ set(TLO_AUTO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/auto/tlo)
+
+ add_custom_target(tl_generate_tlo
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND tl-parser -e auto/tlo/mtproto_api.tlo scheme/mtproto_api.tl
+ COMMAND tl-parser -e auto/tlo/secret_api.tlo scheme/secret_api.tl
+ COMMAND tl-parser -e auto/tlo/td_api.tlo scheme/td_api.tl
+ COMMAND tl-parser -e auto/tlo/telegram_api.tlo scheme/telegram_api.tl
+ COMMENT "Generate TLO files"
+ DEPENDS tl-parser ${CMAKE_CURRENT_SOURCE_DIR}/scheme/mtproto_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/scheme/secret_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/scheme/telegram_api.tl
+ )
+
add_executable(generate_common ${TL_GENERATE_COMMON_SOURCE})
- add_dependencies(generate_common generate_mtproto_api_tlo generate_secret_api_tlo generate_telegram_api_tlo generate_td_api_tlo)
target_link_libraries(generate_common PRIVATE tdtl)
add_custom_target(tl_generate_common
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
COMMAND ${GENERATE_COMMON_CMD}
- COMMENT "Generate common tl source files"
- DEPENDS generate_common DoxygenTlDocumentationGenerator.php
+ COMMENT "Generate common TL source files"
+ DEPENDS generate_common tl_generate_tlo ${TLO_AUTO_INCLUDE_DIR}/mtproto_api.tlo ${TLO_AUTO_INCLUDE_DIR}/secret_api.tlo ${TLO_AUTO_INCLUDE_DIR}/td_api.tlo ${TLO_AUTO_INCLUDE_DIR}/telegram_api.tlo ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/DoxygenTlDocumentationGenerator.php
)
if (TD_ENABLE_JNI)
target_compile_definitions(generate_common PRIVATE TD_ENABLE_JNI=1)
@@ -178,12 +136,11 @@ if (NOT CMAKE_CROSSCOMPILING)
add_executable(generate_c ${TL_GENERATE_C_SOURCE})
target_link_libraries(generate_c PRIVATE tdtl)
add_custom_target(tl_generate_c
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND generate_c
- COMMENT "Generate C tl source files"
- DEPENDS generate_c generate_td_api_tlo
- )
- add_dependencies(tl_generate_c generate_td_api_tlo)
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND generate_c
+ COMMENT "Generate C TL source files"
+ DEPENDS generate_c tl_generate_tlo ${TLO_AUTO_INCLUDE_DIR}/td_api.tlo ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl
+ )
add_executable(td_generate_java_api ${TL_GENERATE_JAVA_SOURCE})
target_link_libraries(td_generate_java_api PRIVATE tdtl)
@@ -191,34 +148,33 @@ if (NOT CMAKE_CROSSCOMPILING)
add_executable(generate_json ${TL_GENERATE_JSON_SOURCE})
target_link_libraries(generate_json PRIVATE tdtl tdutils)
add_custom_target(tl_generate_json
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND generate_json
- COMMENT "Generate JSON tl source files"
- DEPENDS generate_json generate_td_api_tlo
- )
- add_dependencies(tl_generate_json generate_td_api_tlo)
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND generate_json
+ COMMENT "Generate JSON TL source files"
+ DEPENDS generate_json tl_generate_tlo ${TLO_AUTO_INCLUDE_DIR}/td_api.tlo ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl
+ )
if (TD_ENABLE_JNI)
install(TARGETS td_generate_java_api RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}")
install(FILES JavadocTlDocumentationGenerator.php TlDocumentationGenerator.php DESTINATION "${CMAKE_INSTALL_BINDIR}/td/generate")
- install(FILES scheme/td_api.tlo scheme/td_api.tl DESTINATION "${CMAKE_INSTALL_BINDIR}/td/generate/scheme")
+ install(FILES ${TLO_AUTO_INCLUDE_DIR}/td_api.tlo scheme/td_api.tl DESTINATION "${CMAKE_INSTALL_BINDIR}/td/generate/scheme")
endif()
if (TD_ENABLE_DOTNET)
if (PHP_EXECUTABLE)
- set(GENERATE_DOTNET_API_CMD td_generate_dotnet_api ${TL_TD_API_TLO} && ${PHP_EXECUTABLE} DotnetTlDocumentationGenerator.php scheme/td_api.tl auto/td/telegram/TdDotNetApi.h)
+ set(GENERATE_DOTNET_API_CMD td_generate_dotnet_api ${TLO_AUTO_INCLUDE_DIR}/td_api.tlo && ${PHP_EXECUTABLE} DotnetTlDocumentationGenerator.php scheme/td_api.tl auto/td/telegram/TdDotNetApi.h)
else()
- set(GENERATE_DOTNET_API_CMD td_generate_dotnet_api ${TL_TD_API_TLO})
+ set(GENERATE_DOTNET_API_CMD td_generate_dotnet_api ${TLO_AUTO_INCLUDE_DIR}/td_api.tlo)
endif()
add_executable(td_generate_dotnet_api generate_dotnet.cpp tl_writer_dotnet.h)
target_link_libraries(td_generate_dotnet_api PRIVATE tdtl)
add_custom_target(generate_dotnet_api
- WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
- COMMAND ${GENERATE_DOTNET_API_CMD} ${TL_TD_API_TLO}
- COMMENT "Generate .NET API files"
- DEPENDS td_generate_dotnet_api generate_td_api_tlo DotnetTlDocumentationGenerator.php
- )
+ WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
+ COMMAND ${GENERATE_DOTNET_API_CMD}
+ COMMENT "Generate .NET API files"
+ DEPENDS td_generate_dotnet_api tl_generate_tlo ${TLO_AUTO_INCLUDE_DIR}/td_api.tlo ${CMAKE_CURRENT_SOURCE_DIR}/scheme/td_api.tl ${CMAKE_CURRENT_SOURCE_DIR}/DotnetTlDocumentationGenerator.php
+ )
endif()
add_executable(remove_documentation remove_documentation.cpp)
diff --git a/td/generate/generate_c.cpp b/td/generate/generate_c.cpp
index ac38a2df7..01831e72d 100644
--- a/td/generate/generate_c.cpp
+++ b/td/generate/generate_c.cpp
@@ -10,7 +10,7 @@
#include "td/tl/tl_generate.h"
int main() {
- td::tl::tl_config config_td = td::tl::read_tl_config_from_file("scheme/td_api.tlo");
+ td::tl::tl_config config_td = td::tl::read_tl_config_from_file("auto/tlo/td_api.tlo");
td::tl::write_tl_to_file(config_td, "auto/td/telegram/td_tdc_api.h",
td::TlWriterCCommon("TdApi", 1, "#include \"td/telegram/td_api.h\"\n"));
td::tl::write_tl_to_file(config_td, "auto/td/telegram/td_tdc_api_inner.h",
diff --git a/td/generate/generate_common.cpp b/td/generate/generate_common.cpp
index 11f507138..8fcdc8e2c 100644
--- a/td/generate/generate_common.cpp
+++ b/td/generate/generate_common.cpp
@@ -22,7 +22,7 @@ static void generate_cpp(const std::string &directory, const std::string &tl_nam
const std::string &bytes_type, const std::vector &ext_cpp_includes,
const std::vector &ext_h_includes) {
std::string path = directory + "/" + tl_name;
- td::tl::tl_config config = td::tl::read_tl_config_from_file("scheme/" + tl_name + ".tlo");
+ td::tl::tl_config config = td::tl::read_tl_config_from_file("auto/tlo/" + tl_name + ".tlo");
td::tl::write_tl_to_file(config, path + ".cpp", WriterCpp(tl_name, string_type, bytes_type, ext_cpp_includes));
td::tl::write_tl_to_file(config, path + ".h", WriterH(tl_name, string_type, bytes_type, ext_h_includes));
td::tl::write_tl_to_file(config, path + ".hpp", WriterHpp(tl_name, string_type, bytes_type));
diff --git a/td/generate/generate_json.cpp b/td/generate/generate_json.cpp
index 993fa2933..b1e47add3 100644
--- a/td/generate/generate_json.cpp
+++ b/td/generate/generate_json.cpp
@@ -10,6 +10,6 @@
#include "td/tl/tl_generate.h"
int main() {
- td::gen_json_converter(td::tl::read_tl_config_from_file("scheme/td_api.tlo"), "td/telegram/td_api_json",
+ td::gen_json_converter(td::tl::read_tl_config_from_file("auto/tlo/td_api.tlo"), "td/telegram/td_api_json",
td::tl::TL_writer::Server);
}
diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl
index 3341e1dda..051de44c4 100644
--- a/td/generate/scheme/td_api.tl
+++ b/td/generate/scheme/td_api.tl
@@ -237,7 +237,7 @@ maskPosition point:MaskPoint x_shift:double y_shift:double scale:double = MaskPo
closedVectorPath commands:vector = ClosedVectorPath;
-//@description Describes one answer option of a poll @text Option text, 1-100 characters @voter_count Number of voters for this option, available only for closed or voted polls @vote_percentage The percentage of votes for this option, 0-100
+//@description Describes one answer option of a poll @text Option text; 1-100 characters @voter_count Number of voters for this option, available only for closed or voted polls @vote_percentage The percentage of votes for this option; 0-100
//@is_chosen True, if the option was chosen by the user @is_being_chosen True, if the option is being chosen by a pending setPollAnswer request
pollOption text:string voter_count:int32 vote_percentage:int32 is_chosen:Bool is_being_chosen:Bool = PollOption;
@@ -249,7 +249,7 @@ pollTypeRegular allow_multiple_answers:Bool = PollType;
//@description A poll in quiz mode, which has exactly one correct answer option and can be answered only once
//@correct_option_id 0-based identifier of the correct answer option; -1 for a yet unanswered poll
-//@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon, 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll
+//@explanation Text that is shown when the user chooses an incorrect answer or taps on the lamp icon; 0-200 characters with at most 2 line feeds; empty for a yet unanswered poll
pollTypeQuiz correct_option_id:int32 explanation:formattedText = PollType;
@@ -308,7 +308,7 @@ venue location:location title:string address:string provider:string id:string ty
//@param_description Game description @photo Game photo @animation Game animation; may be null
game id:int64 short_name:string title:string text:formattedText description:string photo:photo animation:animation = Game;
-//@description Describes a poll @id Unique poll identifier @question Poll question, 1-300 characters @options List of poll answer options
+//@description Describes a poll @id Unique poll identifier @question Poll question; 1-300 characters @options List of poll answer options
//@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
@@ -377,7 +377,7 @@ chatPhotos total_count:int32 photos:vector = ChatPhotos;
//@class InputChatPhoto @description Describes a photo to be set as a user profile or chat photo
-//@description A previously used profile photo of the current user @chat_photo_id Identifier of the profile photo to reuse
+//@description A previously used profile photo of the current user @chat_photo_id Identifier of the current user's profile photo to reuse
inputChatPhotoPrevious chat_photo_id:int64 = InputChatPhoto;
//@description A static photo in JPEG format @photo Photo to be set as profile photo. Only inputFileLocal and inputFileGenerated are allowed
@@ -403,10 +403,11 @@ inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputC
//@is_support True, if the user is Telegram support account
//@restriction_reason If non-empty, it contains a human-readable description of the reason why access to this user must be restricted
//@is_scam True, if many users reported this user as a scam
+//@is_fake True, if many users reported this user as a fake account
//@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 have_access:Bool type:UserType language_code:string = User;
+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;
//@description Contains full information about a user
//@photo User profile photo; may be null
@@ -454,17 +455,18 @@ chatMemberStatusCreator custom_title:string is_anonymous:Bool is_member:Bool = C
//@description The user is a member of a chat and has some additional privileges. In basic groups, administrators can edit and delete messages sent by others, add new members, ban unprivileged members, and manage voice chats. In supergroups and channels, there are more detailed options for administrator privileges
//@custom_title A custom title of the administrator; 0-16 characters without emojis; applicable to supergroups only
//@can_be_edited True, if the current user can edit the administrator privileges for the called user
+//@can_manage_chat True, if the administrator can get chat event log, get chat statistics, get message statistics in channels, get channel members, see anonymous administrators in supergoups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only
//@can_change_info True, if the administrator can change the chat title, photo, and other settings
//@can_post_messages True, if the administrator can create channel posts; applicable to channels only
//@can_edit_messages True, if the administrator can edit messages of other users and pin messages; applicable to channels only
//@can_delete_messages True, if the administrator can delete messages of other users
//@can_invite_users True, if the administrator can invite new users to the chat
//@can_restrict_members True, if the administrator can restrict, ban, or unban chat members
-//@can_pin_messages True, if the administrator can pin messages; applicable to groups only
+//@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only
//@can_promote_members True, if the administrator can add new administrators with a subset of their own privileges or demote administrators that were directly or indirectly promoted by them
-//@can_manage_voice_chats True, if the administrator can manage voice chats; applicable to groups only
+//@can_manage_voice_chats True, if the administrator can manage voice chats; applicable to basic groups and supergroups only
//@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only
-chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_voice_chats:Bool is_anonymous:Bool = ChatMemberStatus;
+chatMemberStatusAdministrator custom_title:string can_be_edited:Bool can_manage_chat:Bool can_change_info:Bool can_post_messages:Bool can_edit_messages:Bool can_delete_messages:Bool can_invite_users:Bool can_restrict_members:Bool can_pin_messages:Bool can_promote_members:Bool can_manage_voice_chats:Bool is_anonymous:Bool = ChatMemberStatus;
//@description The user is a member of a chat, without any additional privileges or restrictions
chatMemberStatusMember = ChatMemberStatus;
@@ -479,7 +481,7 @@ chatMemberStatusRestricted is_member:Bool restricted_until_date:int32 permission
chatMemberStatusLeft = ChatMemberStatus;
//@description The user was banned (and hence is not a member of the chat). Implies the user can't return to the chat or view messages
-//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever
+//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Always 0 in basic groups
chatMemberStatusBanned banned_until_date:int32 = ChatMemberStatus;
@@ -545,6 +547,46 @@ supergroupMembersFilterMention query:string message_thread_id:int53 = Supergroup
supergroupMembersFilterBots = SupergroupMembersFilter;
+//@description Contains a chat invite link @invite_link Chat invite link @creator_user_id User identifier of an administrator created the link
+//@date Point in time (Unix timestamp) when the link was created
+//@edit_date Point in time (Unix timestamp) when the link was last edited; 0 if never or unknown
+//@expire_date Point in time (Unix timestamp) when the link will expire; 0 if never
+//@member_limit Maximum number of members, which can join the chat using the link simultaneously; 0 if not limited
+//@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;
+
+//@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 = ChatInviteLinks;
+
+//@description Describes a chat administrator with a number of active and revoked chat invite links
+//@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;
+
+//@description Contains a list of chat invite link counts @invite_link_counts List of invite linkcounts
+chatInviteLinkCounts invite_link_counts:vector = 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;
+
+//@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 = ChatInviteLinkMembers;
+
+//@description Contains information about a chat invite link
+//@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining
+//@accessible_for If non-zero, the amount of time for which read access to the chat will remain available, in seconds
+//@type Contains information about the type of the chat
+//@title Title of the chat
+//@photo Chat photo; may be null
+//@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 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)
//@id Group identifier
//@member_count Number of members in the group
@@ -555,11 +597,11 @@ basicGroup id:int32 member_count:int32 status:ChatMemberStatus is_active:Bool up
//@description Contains full information about a basic group
//@photo Chat photo; may be null
-//@param_description Group description
+//@param_description Group description. Updated only after the basic group is opened
//@creator_user_id User identifier of the creator of the group; 0 if unknown
//@members Group members
-//@invite_link Invite link for this group; available only after it has been generated at least once and only for the group creator
-basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int32 members:vector invite_link:string = BasicGroupFullInfo;
+//@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
+basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int32 members:vector invite_link:chatInviteLink = 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
@@ -573,10 +615,12 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int32 memb
//@sign_messages True, if messages sent to the channel should contain information about the sender. This field is only applicable to channels
//@is_slow_mode_enabled True, if the slow mode is enabled in the supergroup
//@is_channel True, if the supergroup is a channel
+//@is_broadcast_group True, if the supergroup is a broadcast group, i.e. only administrators can send messages and there is no limit on number of members
//@is_verified True, if the supergroup or channel is verified
//@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 as a scam
-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_verified:Bool restriction_reason:string is_scam:Bool = Supergroup;
+//@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;
//@description Contains full information about a supergroup or channel
//@photo Chat photo; may be null
@@ -596,10 +640,10 @@ supergroup id:int32 username:string date:int32 status:ChatMemberStatus member_co
//@is_all_history_available True, if new chat members will have access to old messages. In public or discussion groups and both public and private channels, old messages are always available, so this option affects only private supergroups without a linked chat. The value of this field is only available for chat administrators
//@sticker_set_id Identifier of the supergroup sticker set; 0 if none
//@location Location to which the supergroup is connected; may be null
-//@invite_link Invite link for this chat
+//@invite_link Primary invite link for this chat; may be null. For chat administrators with can_invite_users right only
//@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:string 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 upgraded_from_basic_group_id:int32 upgraded_from_max_message_id:int53 = SupergroupFullInfo;
//@class SecretChatState @description Describes the current secret chat state
@@ -619,11 +663,10 @@ secretChatStateClosed = SecretChatState;
//@user_id Identifier of the chat partner
//@state State of the secret chat
//@is_outbound True, if the chat was created by the current user; otherwise false
-//@ttl Current message Time To Live setting (self-destruct timer) for the chat, in seconds
//@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. Video notes are supported if the layer >= 66; 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 ttl:int32 key_hash:bytes layer:int32 = SecretChat;
+secretChat id:int32 user_id:int32 state:SecretChatState is_outbound:Bool key_hash:bytes layer:int32 = SecretChat;
//@class MessageSender @description Contains information about the sender of a message
@@ -658,6 +701,9 @@ messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin;
//@author_signature Original post author signature
messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin;
+//@description The message was imported from an exported message history @sender_name Name of the sender
+messageForwardOriginMessageImport sender_name:string = MessageForwardOrigin;
+
//@description Contains information about a forwarded message
//@origin Origin of a forwarded message
@@ -858,20 +904,21 @@ chatPosition list:ChatList order:int64 is_pinned:Bool source:ChatSource = ChatPo
//@has_scheduled_messages True, if the chat has scheduled messages
//@can_be_deleted_only_for_self True, if the chat messages can be deleted only for the current user while other users will continue to see the messages
//@can_be_deleted_for_all_users True, if the chat messages can be deleted for all users
-//@can_be_reported True, if the chat can be reported to Telegram moderators through reportChat
+//@can_be_reported True, if the chat can be reported to Telegram moderators through reportChat or reportChatPhoto
//@default_disable_notification Default value of the disable_notification parameter, used when a message is sent to the chat
//@unread_count Number of unread messages in the chat
//@last_read_inbox_message_id Identifier of the last read incoming message
//@last_read_outbox_message_id Identifier of the last read outgoing message
//@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
//@action_bar Describes actions which should be possible to do through a chat action bar; may be null
//@voice_chat_group_call_id Group call identifier of an active voice chat; 0 if none or unknown. The voice chat can be received through the method getGroupCall
//@is_voice_chat_empty True, if an active voice chat is empty
//@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
//@draft_message A draft of a message in the chat; may be null
//@client_data Contains application-specific data associated with the chat. (For example, the chat scroll position or local chat notification settings can be stored here.) Persistent if the message database is used
-chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings action_bar:ChatActionBar voice_chat_group_call_id:int32 is_voice_chat_empty:Bool reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat;
+chat id:int53 type:ChatType title:string photo:chatPhotoInfo permissions:chatPermissions last_message:message positions:vector is_marked_as_unread:Bool is_blocked:Bool has_scheduled_messages:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_be_reported:Bool default_disable_notification:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 notification_settings:chatNotificationSettings message_ttl_setting:int32 action_bar:ChatActionBar voice_chat_group_call_id:int32 is_voice_chat_empty:Bool reply_markup_message_id:int53 draft_message:draftMessage client_data:string = Chat;
//@description Represents a list of chats @total_count Approximate total count of chats found @chat_ids List of chat identifiers
chats total_count:int32 chat_ids:vector = Chats;
@@ -884,21 +931,6 @@ chatNearby chat_id:int53 distance:int32 = ChatNearby;
chatsNearby users_nearby:vector supergroups_nearby:vector = ChatsNearby;
-//@description Contains a chat invite link @invite_link Chat invite link
-chatInviteLink invite_link:string = ChatInviteLink;
-
-//@description Contains information about a chat invite link
-//@chat_id Chat identifier of the invite link; 0 if the user has no access to the chat before joining
-//@accessible_for If non-zero, the amount of time for which read access to the chat will remain available, in seconds
-//@type Contains information about the type of the chat
-//@title Title of the chat
-//@photo Chat photo; may be null
-//@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 is_public:Bool = ChatInviteLinkInfo;
-
-
//@class PublicChatType @description Describes a type of public chats
//@description The chat is public, because it has username
@@ -917,6 +949,9 @@ chatActionBarReportSpam can_unarchive:Bool = ChatActionBar;
//@description The chat is a location-based supergroup, which can be reported as having unrelated location using the method reportChat with the reason chatReportReasonUnrelatedLocation
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
//@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
@@ -1290,12 +1325,12 @@ inputCredentialsSaved saved_credentials_id:string = InputCredentials;
//@description Applies if a user enters new credentials on a payment provider website @data Contains JSON-encoded data with a credential identifier from the payment provider @allow_save True, if the credential identifier can be saved on the server side
inputCredentialsNew data:string allow_save:Bool = InputCredentials;
-//@description Applies if a user enters new credentials using Android Pay @data JSON-encoded data with the credential identifier
-inputCredentialsAndroidPay data:string = InputCredentials;
-
//@description Applies if a user enters new credentials using Apple Pay @data JSON-encoded data with the credential identifier
inputCredentialsApplePay data:string = InputCredentials;
+//@description Applies if a user enters new credentials using Google Pay @data JSON-encoded data with the credential identifier
+inputCredentialsGooglePay data:string = InputCredentials;
+
//@description Stripe payment provider @publishable_key Stripe API publishable key @need_country True, if the user country must be provided @need_postal_code True, if the user ZIP/postal code must be provided @need_cardholder_name True, if the cardholder name must be provided
paymentsProviderStripe publishable_key:string need_country:Bool need_postal_code:Bool need_cardholder_name:Bool = PaymentsProviderStripe;
@@ -1360,7 +1395,7 @@ passportElementTypePhoneNumber = PassportElementType;
passportElementTypeEmailAddress = PassportElementType;
-//@description Represents a date according to the Gregorian calendar @day Day of the month, 1-31 @month Month, 1-12 @year Year, 1-9999
+//@description Represents a date according to the Gregorian calendar @day Day of the month; 1-31 @month Month; 1-12 @year Year; 1-9999
date day:int32 month:int32 year:int32 = Date;
//@description Contains the user's personal details
@@ -1678,7 +1713,7 @@ messagePinMessage message_id:int53 = MessageContent;
//@description A screenshot of a message in the chat has been taken
messageScreenshotTaken = MessageContent;
-//@description The TTL (Time To Live) setting messages in a secret chat has been changed @ttl New TTL
+//@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL setting
messageChatSetTtl ttl:int32 = MessageContent;
//@description A non-standard action has happened in the chat @text Message text to be shown in the chat
@@ -1851,7 +1886,7 @@ inputMessageGame bot_user_id:int32 game_short_name:string = InputMessageContent;
//@payload The invoice payload @provider_token Payment provider token @provider_data JSON-encoded data about the invoice, which will be shared with the payment provider @start_parameter Unique invoice bot start_parameter for the generation of this invoice
inputMessageInvoice invoice:invoice title:string description:string photo_url:string photo_size:int32 photo_width:int32 photo_height:int32 payload:bytes provider_token:string provider_data:string start_parameter:string = InputMessageContent;
-//@description A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot @question Poll question, 1-255 characters (up to 300 characters for bots) @options List of poll answer options, 2-10 strings 1-100 characters each
+//@description A message with a poll. Polls can't be sent to secret chats. Polls can be sent only to a private chat with a bot @question Poll question; 1-255 characters (up to 300 characters for bots) @options List of poll answer options, 2-10 strings 1-100 characters each
//@is_anonymous True, if the poll voters are anonymous. Non-anonymous polls can't be sent or forwarded to channels @type Type of the poll
//@open_period Amount of time the poll will be active after creation, in seconds; for bots only
//@close_date Point in time (Unix timestamp) when the poll will be automatically closed; for bots only
@@ -2080,9 +2115,9 @@ groupCallRecentSpeaker user_id:int32 is_speaking:Bool = GroupCallRecentSpeaker;
//@loaded_all_participants True, if all group call participants are loaded
//@recent_speakers Recently speaking users in the group call
//@mute_new_participants True, if only group call administrators can unmute new participants
-//@allowed_change_mute_new_participants True, if group call administrators can enable or disable mute_new_participants setting
+//@can_change_mute_new_participants True, if the current user can enable or disable mute_new_participants setting
//@duration Call duration; for ended calls only
-groupCall id:int32 is_active:Bool is_joined:Bool need_rejoin:Bool can_unmute_self:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector mute_new_participants:Bool allowed_change_mute_new_participants:Bool duration:int32 = GroupCall;
+groupCall id:int32 is_active:Bool is_joined:Bool need_rejoin:Bool can_unmute_self:Bool can_be_managed:Bool participant_count:int32 loaded_all_participants:Bool recent_speakers:vector mute_new_participants:Bool can_change_mute_new_participants:Bool duration:int32 = GroupCall;
//@description Describes a payload fingerprint for interaction with tgcalls @hash Value of the field hash @setup Value of the field setup @fingerprint Value of the field fingerprint
groupCallPayloadFingerprint hash:string setup:string fingerprint:string = GroupCallPayloadFingerprint;
@@ -2102,12 +2137,16 @@ groupCallJoinResponse payload:groupCallPayload candidates:vector = ChatEvents;
//@member_restrictions True, if member restricted/unrestricted/banned/unbanned events should be returned
//@info_changes True, if changes in chat information should be returned
//@setting_changes True, if changes in chat settings should be returned
+//@invite_link_changes True, if changes to invite links should be returned
//@voice_chat_changes True, if voice chat actions should be returned
-chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool voice_chat_changes:Bool = ChatEventLogFilters;
+chatEventLogFilters message_edits:Bool message_deletions:Bool message_pins:Bool member_joins:Bool member_leaves:Bool member_invites:Bool member_promotions:Bool member_restrictions:Bool info_changes:Bool setting_changes:Bool invite_link_changes:Bool voice_chat_changes:Bool = ChatEventLogFilters;
//@class LanguagePackStringValue @description Represents the value of a string in a language pack
@@ -2520,7 +2578,7 @@ backgroundTypeWallpaper is_blurred:Bool is_moving:Bool = BackgroundType;
//@description A PNG or TGV (gzipped subset of SVG with MIME type "application/x-tgwallpattern") pattern to be combined with the background fill chosen by the user
//@fill Description of the background fill
-//@intensity Intensity of the pattern when it is shown above the filled background, 0-100
+//@intensity Intensity of the pattern when it is shown above the filled background; 0-100
//@is_moving True, if the background needs to be slightly moved when device is tilted
backgroundTypePattern fill:BackgroundFill intensity:int32 is_moving:Bool = BackgroundType;
@@ -2588,6 +2646,18 @@ checkChatUsernameResultPublicChatsTooMuch = CheckChatUsernameResult;
checkChatUsernameResultPublicGroupsUnavailable = CheckChatUsernameResult;
+//@class MessageFileType @description Contains information about a file with messages exported from another app
+
+//@description The messages was exported from a private chat @name Name of the other party; may be empty if unrecognized
+messageFileTypePrivate name:string = MessageFileType;
+
+//@description The messages was exported from a group chat @title Title of the group chat; may be empty if unrecognized
+messageFileTypeGroup title:string = MessageFileType;
+
+//@description The messages was exported from a chat of unknown type
+messageFileTypeUnknown = MessageFileType;
+
+
//@class PushMessageContent @description Contains content of a push message notification
//@description A general message with hidden content @is_pinned True, if the message is a pinned message with the specified content
@@ -2867,8 +2937,11 @@ chatReportReasonCopyright = ChatReportReason;
//@description The location-based chat is unrelated to its stated location
chatReportReasonUnrelatedLocation = ChatReportReason;
-//@description A custom reason provided by the user @text Report text
-chatReportReasonCustom text:string = ChatReportReason;
+//@description The chat represents a fake account
+chatReportReasonFake = ChatReportReason;
+
+//@description A custom reason provided by the user
+chatReportReasonCustom = ChatReportReason;
//@description Contains an HTTPS link to a message in a supergroup or channel @link Message link @is_public True, if the link will work for non-members of the chat
@@ -3081,6 +3154,12 @@ suggestedActionEnableArchiveAndMuteNewChats = SuggestedAction;
//@description Suggests the user to check authorization phone number and change the phone number if it is inaccessible
suggestedActionCheckPhoneNumber = SuggestedAction;
+//@description Suggests the user to see a hint about meaning of one and two ticks on sent message
+suggestedActionSeeTicksHint = SuggestedAction;
+
+//@description Suggests the user to convert specified supergroup to a broadcast group @supergroup_id Supergroup identifier
+suggestedActionConvertToBroadcastGroup supergroup_id:int32 = SuggestedAction;
+
//@description Contains a counter @count Count
count count:int32 = Count;
@@ -3330,6 +3409,9 @@ updateChatNotificationSettings chat_id:int53 notification_settings:chatNotificat
//@description Notification settings for some type of chats were updated @scope Types of chats for which notification settings were updated @notification_settings The new notification settings
updateScopeNotificationSettings scope:NotificationSettingsScope notification_settings:scopeNotificationSettings = Update;
+//@description The message Time To Live setting for a chat was changed @chat_id Chat identifier @message_ttl_setting New value of message_ttl_setting
+updateChatMessageTtlSetting chat_id:int53 message_ttl_setting:int32 = Update;
+
//@description The chat action bar was changed @chat_id Chat identifier @action_bar The new value of the action bar; may be null
updateChatActionBar chat_id:int53 action_bar:ChatActionBar = Update;
@@ -3525,6 +3607,11 @@ 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 = 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;
+
//@description Contains a list of updates @updates List of updates
updates updates:vector = Updates;
@@ -3802,6 +3889,9 @@ getMessageThreadHistory chat_id:int53 message_id:int53 from_message_id:int53 off
//@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;
+//@description Deletes a chat along with all messages in the corresponding chat for all chat members; requires owner privileges. For group chats this will release the username and remove all members. Chats with more than 1000 members can't be deleted using this method @chat_id Chat identifier
+deleteChat chat_id:int53 = Ok;
+
//@description Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. Cannot be used in secret chats with a non-empty query
//-(searchSecretMessages should be used instead), or without an enabled message database. For optimal performance the number of returned messages is chosen by the library
//@chat_id Identifier of the chat in which to search messages
@@ -3840,6 +3930,9 @@ searchSecretMessages chat_id:int53 query:string offset:string limit:int32 filter
//@limit The maximum number of messages to be returned; up to 100. Fewer messages may be returned than specified by the limit, even if the end of the message history has not been reached @only_missed If true, returns only messages with missed calls
searchCallMessages from_message_id:int53 limit:int32 only_missed:Bool = Messages;
+//@description Deletes all call messages @revoke Pass true to delete the messages for all users
+deleteAllCallMessages revoke:Bool = Ok;
+
//@description Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location message per user @chat_id Chat identifier @limit The maximum number of messages to be returned
searchChatRecentLocationMessages chat_id:int53 limit:int32 = Messages;
@@ -3930,9 +4023,6 @@ forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector optio
//@chat_id Identifier of the chat to send messages @message_ids Identifiers of the messages to resend. Message identifiers must be in a strictly increasing order
resendMessages chat_id:int53 message_ids:vector = Messages;
-//@description Changes the current TTL setting (sets a new self-destruct timer) in a secret chat and sends the corresponding message @chat_id Chat identifier @ttl New TTL value, in seconds
-sendChatSetTtlMessage chat_id:int53 ttl:int32 = Message;
-
//@description Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier
sendChatScreenshotTakenNotification chat_id:int53 = Ok;
@@ -4125,6 +4215,9 @@ viewMessages chat_id:int53 message_thread_id:int53 message_ids:vector 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 Returns an HTTP URL to open when user clicks on a given HTTP link. This method can be used to automatically login user on a Telegram site @link The HTTP link
+getExternalLink link:string = HttpUrl;
+
//@description Marks all mentions in a chat as read @chat_id Chat identifier
readAllChatMentions chat_id:int53 = Ok;
@@ -4145,8 +4238,13 @@ 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 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 @is_channel True, if a channel chat should be created @param_description Chat description; 0-255 characters @location Chat location if a location-based supergroup is being created
-createNewSupergroupChat title:string is_channel:Bool description:string location:chatLocation = 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
+//@is_channel True, if a channel chat needs to be created
+//@param_description Chat description; 0-255 characters
+//@location Chat location if a location-based supergroup is being created
+//@for_import True, if the supergroup is created for importing messages using importMessage
+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;
@@ -4184,14 +4282,19 @@ getRecommendedChatFilters = RecommendedChatFilters;
getChatFilterDefaultIconName filter:chatFilter = Text;
-//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info rights
+//@description Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
//@chat_id Chat identifier @title New title of the chat; 1-128 characters
setChatTitle chat_id:int53 title:string = Ok;
-//@description Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info rights
+//@description Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info administrator right
//@chat_id Chat identifier @photo New chat photo. Pass null to delete the chat photo
setChatPhoto chat_id:int53 photo:InputChatPhoto = Ok;
+//@description Changes the message TTL setting (sets a new self-destruct timer) in a chat. Requires can_delete_messages administrator right in basic groups, supergroups and channels
+//-Message TTL setting of a chat with the current user (Saved Messages) and the chat 777000 (Telegram) can't be changed
+//@chat_id Chat identifier @ttl New TTL value, in seconds; must be one of 0, 86400, 604800 unless chat is secret
+setChatMessageTtlSetting chat_id:int53 ttl:int32 = Ok;
+
//@description Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members administrator right
//@chat_id Chat identifier @permissions New non-administrator members permissions in the chat
setChatPermissions chat_id:int53 permissions:chatPermissions = Ok;
@@ -4212,10 +4315,10 @@ toggleChatDefaultDisableNotification chat_id:int53 default_disable_notification:
//@description Changes application-specific data associated with a chat @chat_id Chat identifier @client_data New value of client_data
setChatClientData chat_id:int53 client_data:string = Ok;
-//@description Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info rights @chat_id Identifier of the chat @param_description New chat description; 0-255 characters
+//@description Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info administrator right @chat_id Identifier of the chat @param_description New chat description; 0-255 characters
setChatDescription chat_id:int53 description:string = Ok;
-//@description Changes the discussion group of a channel chat; requires can_change_info rights in the channel if it is specified @chat_id Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup) @discussion_chat_id Identifier of a new channel's discussion group. Use 0 to remove the discussion group.
+//@description Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is specified @chat_id Identifier of the channel chat. Pass 0 to remove a link from the supergroup passed in the second argument to a linked channel chat (requires can_pin_messages rights in the supergroup) @discussion_chat_id Identifier of a new channel's discussion group. Use 0 to remove the discussion group.
//-Use the method getSuitableDiscussionChats to find all suitable groups. Basic group chats must be first upgraded to supergroup chats. If new chat members don't have access to old messages in the supergroup, then toggleSupergroupIsAllHistoryAvailable must be used first to change that
setChatDiscussionGroup chat_id:int53 discussion_chat_id:int53 = Ok;
@@ -4245,18 +4348,25 @@ joinChat chat_id:int53 = Ok;
//@description Removes the current user from chat members. Private and secret chats can't be left using this method @chat_id Chat identifier
leaveChat chat_id:int53 = Ok;
-//@description Adds a new member to a chat. Members can't be added to private or secret chats. Members will not be added until the chat state has been synchronized with the server
+//@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;
-//@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. Members will not be added until the chat state has been synchronized with the server
+//@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 = 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. The chat member status will not be changed until it has been synchronized with the server
+//@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
//@chat_id Chat identifier @user_id User identifier @status The new status of the member in the chat
setChatMemberStatus chat_id:int53 user_id:int32 status:ChatMemberStatus = Ok;
+//@description Bans a member in a chat. Members can't be banned in private or secret chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links, etc., unless unbanned first
+//@chat_id Chat identifier
+//@user_id Identifier of the user
+//@banned_until_date Point in time (Unix timestamp) when the user will be unbanned; 0 if never. If the user is banned for more than 366 days or for less than 30 seconds from the current time, the user is considered to be banned forever. Ignored in basic groups
+//@revoke_messages Pass true to delete all messages in the chat for the user. Always true for supergroups and channels
+banChatMember chat_id:int53 user_id:int32 banned_until_date:int32 revoke_messages:Bool = Ok;
+
//@description Checks whether the current session can be used to transfer a chat ownership to another user
canTransferOwnership = CanTransferOwnershipResult;
@@ -4346,14 +4456,76 @@ readFilePart file_id:int32 offset:int32 count:int32 = FilePart;
deleteFile file_id:int32 = Ok;
-//@description Generates a new invite link for a chat; the previously generated link is revoked. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right @chat_id Chat identifier
-generateChatInviteLink chat_id:int53 = ChatInviteLink;
+//@description Returns information about a file with messages exported from another app @message_file_head Beginning of the message file; up to 100 first lines
+getMessageFileType message_file_head:string = MessageFileType;
-//@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; should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/"
+//@description Returns a confirmation text to be shown to the user before starting message import
+//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right
+getMessageImportConfirmationText chat_id:int53 = Text;
+
+//@description Imports messages exported from another app
+//@chat_id Identifier of a chat to which the messages will be imported. It must be an identifier of a private chat with a mutual contact or an identifier of a supergroup chat with can_change_info administrator right
+//@message_file File with messages to import. Only inputFileLocal and inputFileGenerated are supported. The file must not be previously uploaded
+//@attached_files Files used in the imported messages. Only inputFileLocal and inputFileGenerated are supported. The files must not be previously uploaded
+importMessages chat_id:int53 message_file:InputFile attached_files:vector = Ok;
+
+
+//@description Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right @chat_id Chat identifier
+replacePrimaryChatInviteLink chat_id:int53 = ChatInviteLink;
+
+//@description Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat
+//@chat_id Chat identifier
+//@expire_date Point in time (Unix timestamp) when the link will expire; pass 0 if never
+//@member_limit Maximum number of chat members that can join the chat by the link simultaneously; 0-99999; pass 0 if not limited
+createChatInviteLink chat_id:int53 expire_date:int32 member_limit:int32 = ChatInviteLink;
+
+//@description Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. 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 to be edited
+//@expire_date Point in time (Unix timestamp) when the link will expire; pass 0 if never
+//@member_limit Maximum number of chat members that can join the chat by the link simultaneously; 0-99999; pass 0 if not limited
+editChatInviteLink chat_id:int53 invite_link:string expire_date:int32 member_limit:int32 = ChatInviteLink;
+
+//@description Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links
+//@chat_id Chat identifier
+//@invite_link Invite link to get
+getChatInviteLink chat_id:int53 invite_link:string = ChatInviteLink;
+
+//@description Returns list of chat administrators with number of their invite links. Requires owner privileges in the chat @chat_id Chat identifier
+getChatInviteLinkCounts chat_id:int53 = ChatInviteLinkCounts;
+
+//@description Returns invite links for a chat created by specified administrator. Requires administrator privileges and can_invite_users right in the chat to get own links and owner privileges to get other links
+//@chat_id Chat identifier
+//@creator_user_id User identifier of a chat administrator. Must be an identifier of the current user for non-owner
+//@is_revoked Pass true if revoked links needs to be returned instead of active or expired
+//@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 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;
+
+//@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 Maximum number of chat members to return
+getChatInviteLinkMembers chat_id:int53 invite_link:string offset_member:chatInviteLinkMember limit:int32 = ChatInviteLinkMembers;
+
+//@description Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat for own links and owner privileges for other links.
+//-If a primary link is revoked, then additionally to the revoked link returns new primary link
+//@chat_id Chat identifier
+//@invite_link Invite link to be revoked
+revokeChatInviteLink chat_id:int53 invite_link:string = ChatInviteLinks;
+
+//@description Deletes revoked chat invite links. 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 to revoke
+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;
+
+//@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; must have URL "t.me", "telegram.me", or "telegram.dog" and query beginning with "/joinchat/" or "/+"
checkChatInviteLink invite_link:string = ChatInviteLinkInfo;
-//@description Uses an invite link to add the current user to the chat if possible. The new member will not be added until the chat state has been synchronized with the server
-//@invite_link Invite link to import; should begin with "https://t.me/joinchat/", "https://telegram.me/joinchat/", or "https://telegram.dog/joinchat/"
+//@description Uses an invite link to add the current user to the chat if possible
+//@invite_link Invite link to import; must have URL "t.me", "telegram.me", or "telegram.dog" and query beginning with "/joinchat/" or "/+"
joinChatByInviteLink invite_link:string = Chat;
@@ -4385,7 +4557,7 @@ getGroupCall group_call_id:int32 = GroupCall;
//@description Joins a group call @group_call_id Group call identifier @payload Group join payload, received from tgcalls. Use null to cancel previous joinGroupCall request @source Caller synchronization source identifier; received from tgcalls @is_muted True, if the user's microphone is muted
joinGroupCall group_call_id:int32 payload:groupCallPayload source:int32 is_muted:Bool = GroupCallJoinResponse;
-//@description Toggles whether new participants of a group call can be unmuted only by administrators of the group call. Requires can_manage_voice_chats rights in the corresponding chat and allowed_change_mute_mew_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_change_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;
@@ -4401,6 +4573,10 @@ setGroupCallParticipantIsSpeaking group_call_id:int32 source:int32 is_speaking:B
//@group_call_id Group call identifier @user_id User identifier @is_muted Pass true if the user must be muted and false otherwise
toggleGroupCallParticipantIsMuted group_call_id:int32 user_id:int32 is_muted:Bool = Ok;
+//@description Changes a group call participant's volume level. If the current user can manage the group call, then the participant's volume level will be changed for all users with default volume level
+//@group_call_id Group call identifier @user_id User identifier @volume_level New participant's volume level; 1-20000 in hundreds of percents
+setGroupCallParticipantVolumeLevel group_call_id:int32 user_id:int32 volume_level:int32 = Ok;
+
//@description Loads more group call participants. The loaded participants will be received through updates. Use the field groupCall.loaded_all_participants to check whether all participants has already been loaded
//@group_call_id Group call identifier. The group call must be previously received through getGroupCall and must be joined or being joined
//@limit Maximum number of participants to load
@@ -4409,7 +4585,7 @@ loadGroupCallParticipants group_call_id:int32 limit:int32 = Ok;
//@description Leaves a group call @group_call_id Group call identifier
leaveGroupCall group_call_id:int32 = Ok;
-//@description Discards a group call. Requires can_manage_voice_chats rights in the corresponding chat @group_call_id Group call identifier
+//@description Discards a group call. Requires groupCall.can_be_managed @group_call_id Group call identifier
discardGroupCall group_call_id:int32 = Ok;
@@ -4620,15 +4796,18 @@ 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;
-//@description Changes the sticker set of a supergroup; requires can_change_info rights @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
+//@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;
-//@description Toggles sender signatures messages sent in a channel; requires can_change_info rights @supergroup_id Identifier of the channel @sign_messages New value of sign_messages
+//@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;
-//@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info rights @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available
+//@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;
+//@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup
+toggleSupergroupIsBroadcastGroup supergroup_id:int32 = 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 = Ok;
@@ -4636,9 +4815,6 @@ reportSupergroupSpam supergroup_id:int32 user_id:int32 message_ids:vector
//@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;
-//@description Deletes a supergroup or channel along with all messages in the corresponding chat. This will release the supergroup or channel username and remove all members; requires owner privileges in the supergroup or channel. Chats with more than 1000 members can't be deleted using this method @supergroup_id Identifier of the supergroup or channel
-deleteSupergroup supergroup_id:int32 = Ok;
-
//@description Closes a secret chat, effectively transferring its state to secretChatStateClosed @secret_chat_id Secret chat identifier
closeSecretChat secret_chat_id:int32 = Ok;
@@ -4771,9 +4947,13 @@ deleteAccount reason:string = Ok;
//@description Removes a chat action bar without any other action @chat_id Chat identifier
removeChatActionBar chat_id:int53 = Ok;
-//@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private chats with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators @chat_id Chat identifier @reason The reason for reporting the chat @message_ids Identifiers of reported messages, if any
-reportChat chat_id:int53 reason:ChatReportReason message_ids:vector = Ok;
+//@description Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if this is a private chat with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators
+//@chat_id Chat identifier @message_ids Identifiers of reported messages, if any @reason The reason for reporting the chat @text Additional report details; 0-1024 characters
+reportChat chat_id:int53 message_ids:vector reason:ChatReportReason text:string = Ok;
+//@description Reports a chat photo to the Telegram moderators. A chat photo can be reported only if this is a private chat with a bot, a private chat with a user sharing their location, a supergroup, or a channel, since other chats can't be checked by moderators
+//@chat_id Chat identifier @file_id Identifier of the photo to report. Only full photos from chatPhoto can be reported @reason The reason for reporting the chat photo @text Additional report details; 0-1024 characters
+reportChatPhoto chat_id:int53 file_id:int32 reason:ChatReportReason text:string = Ok;
//@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 from "tg://statsrefresh?params=******" link @is_dark Pass true if a URL with the dark theme must be returned
getChatStatisticsUrl chat_id:int53 parameters:string is_dark:Bool = HttpUrl;
@@ -4999,7 +5179,7 @@ removeProxy proxy_id:int32 = Ok;
getProxies = Proxies;
//@description Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called before authorization @proxy_id Proxy identifier
-getProxyLink proxy_id:int32 = Text;
+getProxyLink proxy_id:int32 = HttpUrl;
//@description Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization @proxy_id Proxy identifier. Use 0 to ping a Telegram server without a proxy
pingProxy proxy_id:int32 = Seconds;
@@ -5029,7 +5209,7 @@ setLogTagVerbosityLevel tag:string new_verbosity_level:int32 = Ok;
getLogTagVerbosityLevel tag:string = LogVerbosityLevel;
//@description Adds a message to TDLib internal log. Can be called synchronously
-//@verbosity_level The minimum verbosity level needed for the message to be logged, 0-1023 @text Text of a message to log
+//@verbosity_level The minimum verbosity level needed for the message to be logged; 0-1023 @text Text of a message to log
addLogMessage verbosity_level:int32 text:string = Ok;
diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl
index 60018bf81..d37b95efc 100644
--- a/td/generate/scheme/telegram_api.tl
+++ b/td/generate/scheme/telegram_api.tl
@@ -96,7 +96,7 @@ 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 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 bot_inline_placeholder:flags.19?string lang_code:flags.22?string = 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 bot_inline_placeholder:flags.19?string lang_code:flags.22?string = User;
userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto;
userProfilePhoto#69d3ab26 flags:# has_video:flags.0?true photo_id:long photo_small:FileLocation photo_big:FileLocation dc_id:int = UserProfilePhoto;
@@ -111,11 +111,11 @@ 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 id:int access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date:int version:int restriction_reason:flags.9?Vector admin_rights:flags.14?ChatAdminRights banned_rights:flags.15?ChatBannedRights default_banned_rights:flags.18?ChatBannedRights participants_count:flags.17?int = 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 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;
-chatFull#dc8c181 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:ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall = ChatFull;
-channelFull#ef3a6acd 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:ExportedChatInvite bot_info:Vector 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 = ChatFull;
+chatFull#f06c4018 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 pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int = ChatFull;
+channelFull#2548c037 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 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 = ChatFull;
chatParticipant#c8d7493e user_id:int inviter_id:int date:int = ChatParticipant;
chatParticipantCreator#da13538a user_id:int = ChatParticipant;
@@ -127,9 +127,9 @@ chatParticipants#3f460fed chat_id:int participants:Vector versi
chatPhotoEmpty#37c1011c = ChatPhoto;
chatPhoto#d20b9f3c flags:# has_video:flags.0?true photo_small:FileLocation photo_big:FileLocation dc_id:int = ChatPhoto;
-messageEmpty#83e5de54 id:int = Message;
-message#58ae39c9 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 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 = Message;
-messageService#286fa604 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 = Message;
+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 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 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;
@@ -171,6 +171,7 @@ 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 = MessageAction;
+messageActionSetMessagesTTL#aa1afbfd period:int = MessageAction;
dialog#2c171f72 flags:# pinned:flags.2?true unread_mark:flags.3?true peer:Peer top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int notify_settings:PeerNotifySettings pts:flags.0?int draft:flags.1?DraftMessage folder_id:flags.4?int = Dialog;
dialogFolder#71bd134c flags:# pinned:flags.2?true folder:Folder peer:Peer top_message:int unread_muted_peers_count:int unread_unmuted_peers_count:int unread_muted_messages_count:int unread_unmuted_messages_count:int = Dialog;
@@ -204,7 +205,7 @@ inputPeerNotifySettings#9c3d198e flags:# show_previews:flags.0?Bool silent:flags
peerNotifySettings#af509d20 flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?string = PeerNotifySettings;
-peerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true geo_distance:flags.6?int = PeerSettings;
+peerSettings#733f2961 flags:# report_spam:flags.0?true add_contact:flags.1?true block_contact:flags.2?true share_contact:flags.3?true need_contacts_exception:flags.4?true report_geo:flags.5?true autoarchived:flags.7?true invite_members:flags.8?true geo_distance:flags.6?int = PeerSettings;
wallPaper#a437c3ed id:long flags:# creator:flags.0?true default:flags.1?true pattern:flags.3?true dark:flags.4?true access_hash:long slug:string document:Document settings:flags.2?WallPaperSettings = WallPaper;
wallPaperNoFile#8af40b25 flags:# default:flags.1?true dark:flags.4?true settings:flags.2?WallPaperSettings = WallPaper;
@@ -213,11 +214,12 @@ inputReportReasonSpam#58dbcab8 = ReportReason;
inputReportReasonViolence#1e22c78d = ReportReason;
inputReportReasonPornography#2e59d922 = ReportReason;
inputReportReasonChildAbuse#adf44ee3 = ReportReason;
-inputReportReasonOther#e1746d0a text:string = ReportReason;
+inputReportReasonOther#c1e4a2b1 = ReportReason;
inputReportReasonCopyright#9b89f93a = ReportReason;
inputReportReasonGeoIrrelevant#dbd4feed = ReportReason;
+inputReportReasonFake#f5ddd6e7 = ReportReason;
-userFull#edf17c12 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 = UserFull;
+userFull#139a9a77 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 = UserFull;
contact#f911c994 user_id:int mutual:Bool = Contact;
@@ -344,7 +346,6 @@ updateDialogFilter#26ffde7d flags:# id:int filter:flags.0?DialogFilter = Update;
updateDialogFilterOrder#a5d72105 order:Vector = Update;
updateDialogFilters#3504914f = Update;
updatePhoneCallSignalingData#2661bf09 phone_call_id:long data:bytes = Update;
-updateChannelParticipant#65d2b464 flags:# channel_id:int date:int user_id:int prev_participant:flags.0?ChannelParticipant new_participant:flags.1?ChannelParticipant qts:int = 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;
@@ -355,6 +356,10 @@ updatePinnedChannelMessages#8588878b flags:# pinned:flags.0?true channel_id:int
updateChat#1330a196 chat_id:int = Update;
updateGroupCallParticipants#f2ebdb4e call:InputGroupCall participants:Vector version:int = Update;
updateGroupCall#a45eb99b chat_id:int 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;
updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State;
@@ -364,12 +369,12 @@ updates.differenceSlice#a8fb1981 new_messages:Vector new_encrypted_mess
updates.differenceTooLong#4afe8f6d pts:int = updates.Difference;
updatesTooLong#e317af7e = Updates;
-updateShortMessage#2296d2c8 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 = Updates;
-updateShortChatMessage#402d5dbb 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 = 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 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 ttl_period:flags.25?int = Updates;
updateShort#78d4dec1 update:Update date:int = Updates;
updatesCombined#725b04c3 updates:Vector users:Vector chats:Vector date:int seq_start:int seq:int = Updates;
updates#74ae4240 updates:Vector users:Vector chats:Vector date:int seq:int = Updates;
-updateShortSentMessage#11f1331c flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector = Updates;
+updateShortSentMessage#9015e101 flags:# out:flags.1?true id:int pts:int pts_count:int date:int media:flags.9?MessageMedia entities:flags.7?Vector ttl_period:flags.25?int = Updates;
photos.photos#8dca6aa5 photos:Vector users:Vector = photos.Photos;
photos.photosSlice#15051f54 count:int photos:Vector users:Vector = photos.Photos;
@@ -394,7 +399,7 @@ 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;
-encryptedChatDiscarded#13d6dd27 id:int = EncryptedChat;
+encryptedChatDiscarded#1e1c7c45 flags:# history_deleted:flags.0?true id:int = EncryptedChat;
inputEncryptedChat#f141b5e1 chat_id:int access_hash:long = InputEncryptedChat;
@@ -442,6 +447,7 @@ sendMessageGamePlayAction#dd6a8f48 = SendMessageAction;
sendMessageRecordRoundAction#88f27fbc = SendMessageAction;
sendMessageUploadRoundAction#243e1c66 progress:int = SendMessageAction;
speakingInGroupCallAction#d92c2285 = SendMessageAction;
+sendMessageHistoryImportAction#dbda9246 progress:int = SendMessageAction;
contacts.found#b3134d9d my_results:Vector results:Vector chats:Vector users:Vector = contacts.Found;
@@ -522,8 +528,7 @@ auth.passwordRecovery#137948a5 email_pattern:string = auth.PasswordRecovery;
receivedNotifyMessage#a384b779 id:int flags:int = ReceivedNotifyMessage;
-chatInviteEmpty#69df3769 = ExportedChatInvite;
-chatInviteExported#fc2e05bc link:string = ExportedChatInvite;
+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;
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 = ChatInvite;
@@ -648,7 +653,7 @@ messages.botResults#947ca848 flags:# gallery:flags.0?true query_id:long next_off
exportedMessageLink#5dab1af4 link:string html:string = ExportedMessageLink;
-messageFwdHeader#5f777dce flags:# from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;
+messageFwdHeader#5f777dce flags:# imported:flags.7?true from_id:flags.0?Peer from_name:flags.5?string date:int channel_post:flags.2?int post_author:flags.3?string saved_from_peer:flags.4?Peer saved_from_msg_id:flags.4?int psa_type:flags.6?string = MessageFwdHeader;
auth.codeTypeSms#72a3158c = auth.CodeType;
auth.codeTypeCall#741cd3e3 = auth.CodeType;
@@ -807,7 +812,7 @@ payments.savedInfo#fb8fe43c flags:# has_saved_credentials:flags.1?true saved_inf
inputPaymentCredentialsSaved#c10eb2cf id:string tmp_password:bytes = InputPaymentCredentials;
inputPaymentCredentials#3417d728 flags:# save:flags.0?true data:DataJSON = InputPaymentCredentials;
inputPaymentCredentialsApplePay#aa1c39f payment_data:DataJSON = InputPaymentCredentials;
-inputPaymentCredentialsAndroidPay#ca05d50e payment_token:DataJSON google_transaction_id:string = InputPaymentCredentials;
+inputPaymentCredentialsGooglePay#8ac32801 payment_token:DataJSON = InputPaymentCredentials;
account.tmpPassword#db64fd34 tmp_password:bytes valid_until:int = account.TmpPassword;
@@ -872,12 +877,18 @@ channelAdminLogEventActionDiscardGroupCall#db9f9140 call:InputGroupCall = Channe
channelAdminLogEventActionParticipantMute#f92424d2 participant:GroupCallParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionParticipantUnmute#e64429c0 participant:GroupCallParticipant = ChannelAdminLogEventAction;
channelAdminLogEventActionToggleGroupCallSetting#56d6a247 join_muted:Bool = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantJoinByInvite#5cdada77 invite:ExportedChatInvite = ChannelAdminLogEventAction;
+channelAdminLogEventActionExportedInviteDelete#5a50fca4 invite:ExportedChatInvite = ChannelAdminLogEventAction;
+channelAdminLogEventActionExportedInviteRevoke#410a134e invite:ExportedChatInvite = ChannelAdminLogEventAction;
+channelAdminLogEventActionExportedInviteEdit#e90ebb59 prev_invite:ExportedChatInvite new_invite:ExportedChatInvite = ChannelAdminLogEventAction;
+channelAdminLogEventActionParticipantVolume#3e7f6847 participant:GroupCallParticipant = ChannelAdminLogEventAction;
+channelAdminLogEventActionChangeHistoryTTL#6e941a38 prev_value:int new_value:int = ChannelAdminLogEventAction;
channelAdminLogEvent#3b5a3e40 id:long date:int user_id:int action:ChannelAdminLogEventAction = ChannelAdminLogEvent;
channels.adminLogResults#ed8af74d events:Vector chats:Vector users:Vector = channels.AdminLogResults;
-channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true = ChannelAdminLogEventsFilter;
+channelAdminLogEventsFilter#ea107ae4 flags:# join:flags.0?true leave:flags.1?true invite:flags.2?true ban:flags.3?true unban:flags.4?true kick:flags.5?true unkick:flags.6?true promote:flags.7?true demote:flags.8?true info:flags.9?true settings:flags.10?true pinned:flags.11?true edit:flags.12?true delete:flags.13?true group_call:flags.14?true invites:flags.15?true = ChannelAdminLogEventsFilter;
popularContact#5ce14175 client_id:long importers:int = PopularContact;
@@ -1035,7 +1046,7 @@ chatOnlines#f041e250 onlines:int = ChatOnlines;
statsURL#47a971e0 url:string = StatsURL;
-chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true = ChatAdminRights;
+chatAdminRights#5fb224d5 flags:# change_info:flags.0?true post_messages:flags.1?true edit_messages:flags.2?true delete_messages:flags.3?true ban_users:flags.4?true invite_users:flags.5?true pin_messages:flags.7?true add_admins:flags.9?true anonymous:flags.10?true manage_call:flags.11?true other:flags.12?true = ChatAdminRights;
chatBannedRights#9f120418 flags:# view_messages:flags.0?true send_messages:flags.1?true send_media:flags.2?true send_stickers:flags.3?true send_gifs:flags.4?true send_games:flags.5?true send_inline:flags.6?true embed_links:flags.7?true send_polls:flags.8?true change_info:flags.10?true invite_users:flags.15?true pin_messages:flags.17?true until_date:int = ChatBannedRights;
@@ -1182,7 +1193,7 @@ groupCall#55903081 flags:# join_muted:flags.1?true can_change_join_muted:flags.2
inputGroupCall#d8aa840f id:long access_hash:long = InputGroupCall;
-groupCallParticipant#56b087c9 flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true user_id:int date:int active_date:flags.3?int source:int = GroupCallParticipant;
+groupCallParticipant#64c62a15 flags:# muted:flags.0?true left:flags.1?true can_self_unmute:flags.2?true just_joined:flags.4?true versioned:flags.5?true min:flags.8?true muted_by_you:flags.9?true volume_by_admin:flags.10?true user_id:int date:int active_date:flags.3?int source:int volume:flags.7?int = GroupCallParticipant;
phone.groupCall#66ab0bfc call:GroupCall participants:Vector participants_next_offset:string users:Vector = phone.GroupCall;
@@ -1194,6 +1205,27 @@ inlineQueryPeerTypeChat#d766c50a = InlineQueryPeerType;
inlineQueryPeerTypeMegagroup#5ec4be43 = InlineQueryPeerType;
inlineQueryPeerTypeBroadcast#6334ee9a = InlineQueryPeerType;
+messages.historyImport#1662af0b id:long = messages.HistoryImport;
+
+messages.historyImportParsed#5e0fb7b9 flags:# pm:flags.0?true group:flags.1?true title:flags.2?string = messages.HistoryImportParsed;
+
+messages.affectedFoundMessages#ef8d3e6c pts:int pts_count:int offset:int messages:Vector = messages.AffectedFoundMessages;
+
+chatInviteImporter#1e3e6680 user_id:int date:int = ChatInviteImporter;
+
+messages.exportedChatInvites#bdc62dcc count:int invites:Vector users:Vector = messages.ExportedChatInvites;
+
+messages.exportedChatInvite#1871be50 invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;
+messages.exportedChatInviteReplaced#222600ef invite:ExportedChatInvite new_invite:ExportedChatInvite users:Vector = messages.ExportedChatInvite;
+
+messages.chatInviteImporters#81b6b00a count:int importers:Vector users:Vector = messages.ChatInviteImporters;
+
+chatAdminWithInvites#dfd2330f admin_id:int invites_count:int revoked_invites_count:int = ChatAdminWithInvites;
+
+messages.chatAdminsWithInvites#b69b72d7 admins:Vector users:Vector = messages.ChatAdminsWithInvites;
+
+messages.checkedHistoryImportPeer#a24de717 confirm_text:string = messages.CheckedHistoryImportPeer;
+
---functions---
invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X;
@@ -1231,7 +1263,7 @@ 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.reportPeer#ae189d5f peer:InputPeer reason:ReportReason = Bool;
+account.reportPeer#c5ba3d86 peer:InputPeer reason:ReportReason message:string = Bool;
account.checkUsername#2714d86c username:string = Bool;
account.updateUsername#3e0bdd7c username:string = User;
account.getPrivacy#dadbc950 key:InputPrivacyKey = account.PrivacyRules;
@@ -1290,6 +1322,7 @@ account.getContentSettings#8b9b4dae = account.ContentSettings;
account.getMultiWallPapers#65ad71dc wallpapers:Vector = Vector;
account.getGlobalPrivacySettings#eb2b4cf6 = GlobalPrivacySettings;
account.setGlobalPrivacySettings#1edaaac2 settings:GlobalPrivacySettings = GlobalPrivacySettings;
+account.reportProfilePhoto#fa8cc6f5 peer:InputPeer photo_id:InputPhoto reason:ReportReason message:string = Bool;
users.getUsers#d91a548 id:Vector = Vector;
users.getFullUser#ca30a5b1 id:InputUser = UserFull;
@@ -1330,18 +1363,18 @@ messages.sendMedia#3491eba9 flags:# silent:flags.5?true background:flags.6?true
messages.forwardMessages#d9fee60e flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int = Updates;
messages.reportSpam#cf1592db peer:InputPeer = Bool;
messages.getPeerSettings#3672e09c peer:InputPeer = PeerSettings;
-messages.report#bd82b658 peer:InputPeer id:Vector reason:ReportReason = Bool;
+messages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool;
messages.getChats#3c6aa187 id:Vector = 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#e0611f16 chat_id:int user_id:InputUser = Updates;
+messages.deleteChatUser#c534459a flags:# revoke_history:flags.0?true chat_id:int user_id:InputUser = Updates;
messages.createChat#9cb126e users:Vector 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;
messages.acceptEncryption#3dbc0415 peer:InputEncryptedChat g_b:bytes key_fingerprint:long = EncryptedChat;
-messages.discardEncryption#edd923c5 chat_id:int = Bool;
+messages.discardEncryption#f393aea0 flags:# delete_history:flags.0?true chat_id:int = Bool;
messages.setEncryptedTyping#791451ed peer:InputEncryptedChat typing:Bool = Bool;
messages.readEncryptedHistory#7f4b690a peer:InputEncryptedChat max_date:int = Bool;
messages.sendEncrypted#44fa7a15 flags:# silent:flags.0?true peer:InputEncryptedChat random_id:long data:bytes = messages.SentEncryptedMessage;
@@ -1353,7 +1386,7 @@ messages.readMessageContents#36a73f77 id:Vector = messages.AffectedMessages
messages.getStickers#43d4f2c emoticon:string hash:int = messages.Stickers;
messages.getAllStickers#1c9618b1 hash:int = messages.AllStickers;
messages.getWebPagePreview#8b68b0cc flags:# message:string entities:flags.3?Vector = MessageMedia;
-messages.exportChatInvite#df7534c peer:InputPeer = ExportedChatInvite;
+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;
messages.importChatInvite#6c50051c hash:string = Updates;
messages.getStickerSet#2619a90e stickerset:InputStickerSet = messages.StickerSet;
@@ -1443,6 +1476,21 @@ messages.getReplies#24b581ba peer:InputPeer msg_id:int offset_id:int offset_date
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.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;
+messages.uploadImportedMedia#2a862092 peer:InputPeer import_id:long file_name:string media:InputMedia = MessageMedia;
+messages.startHistoryImport#b43df344 peer:InputPeer import_id:long = Bool;
+messages.getExportedChatInvites#a2b5a3f6 flags:# revoked:flags.3?true peer:InputPeer admin_id:InputUser offset_date:flags.2?int offset_link:flags.2?string limit:int = messages.ExportedChatInvites;
+messages.getExportedChatInvite#73746f5c peer:InputPeer link:string = messages.ExportedChatInvite;
+messages.editExportedChatInvite#2e4ffbe flags:# revoked:flags.2?true peer:InputPeer link:string expire_date:flags.0?int usage_limit:flags.1?int = messages.ExportedChatInvite;
+messages.deleteRevokedExportedChatInvites#56987bd5 peer:InputPeer admin_id:InputUser = Bool;
+messages.deleteExportedChatInvite#d464a42b peer:InputPeer link:string = Bool;
+messages.getAdminsWithInvites#3920e6ef peer:InputPeer = messages.ChatAdminsWithInvites;
+messages.getChatInviteImporters#26fb7289 peer:InputPeer link:string offset_date:int offset_user:InputUser limit:int = messages.ChatInviteImporters;
+messages.setHistoryTTL#b80e5fe4 peer:InputPeer period:int = Updates;
+messages.checkHistoryImportPeer#5dc60f03 peer:InputPeer = messages.CheckedHistoryImportPeer;
updates.getState#edd4882a = updates.State;
updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference;
@@ -1482,7 +1530,7 @@ help.getUserInfo#38a08d3 user_id:InputUser = help.UserInfo;
help.editUserInfo#66b91b70 user_id:InputUser message:string entities:Vector = help.UserInfo;
help.getPromoData#c0977421 = help.PromoData;
help.hidePromoData#1e251c95 peer:InputPeer = Bool;
-help.dismissSuggestion#77fa99f suggestion:string = Bool;
+help.dismissSuggestion#f50dbaa1 peer:InputPeer suggestion:string = Bool;
help.getCountriesList#735787a8 lang_code:string hash:int = help.CountriesList;
channels.readHistory#cc104937 channel:InputChannel max_id:int = Bool;
@@ -1494,7 +1542,7 @@ channels.getParticipants#123e05e9 channel:InputChannel filter:ChannelParticipant
channels.getParticipant#546dd7a6 channel:InputChannel user_id:InputUser = channels.ChannelParticipant;
channels.getChannels#a7f6bbb id:Vector = messages.Chats;
channels.getFullChannel#8736a09 channel:InputChannel = messages.ChatFull;
-channels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;
+channels.createChannel#3d5fb10f flags:# broadcast:flags.0?true megagroup:flags.1?true for_import:flags.3?true title:string about:string geo_point:flags.2?InputGeoPoint address:flags.2?string = Updates;
channels.editAdmin#d33c8902 channel:InputChannel user_id:InputUser admin_rights:ChatAdminRights rank:string = Updates;
channels.editTitle#566decd0 channel:InputChannel title:string = Updates;
channels.editPhoto#f12e57c9 channel:InputChannel photo:InputChatPhoto = Updates;
@@ -1520,6 +1568,7 @@ channels.editCreator#8f38cd1f channel:InputChannel user_id:InputUser password:In
channels.editLocation#58e63f6d channel:InputChannel geo_point:InputGeoPoint address:string = Bool;
channels.toggleSlowMode#edd49ef0 channel:InputChannel seconds:int = Updates;
channels.getInactiveChannels#11e831ee = messages.InactiveChats;
+channels.convertToGigagroup#b290c69 channel:InputChannel = Updates;
bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON;
bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool;
@@ -1551,7 +1600,7 @@ phone.sendSignalingData#ff7a9383 peer:InputPhoneCall data:bytes = Bool;
phone.createGroupCall#bd3dabe0 peer:InputPeer random_id:int = Updates;
phone.joinGroupCall#5f9c8e62 flags:# muted:flags.0?true call:InputGroupCall params:DataJSON = Updates;
phone.leaveGroupCall#500377f9 call:InputGroupCall source:int = Updates;
-phone.editGroupCallMember#63146ae4 flags:# muted:flags.0?true call:InputGroupCall user_id:InputUser = Updates;
+phone.editGroupCallMember#a5e76cd8 flags:# muted:flags.0?true call:InputGroupCall user_id:InputUser volume:flags.1?int = Updates;
phone.inviteToGroupCall#7b393160 call:InputGroupCall users:Vector = Updates;
phone.discardGroupCall#7a777135 call:InputGroupCall = Updates;
phone.toggleGroupCallSettings#74bbb43d flags:# call:InputGroupCall join_muted:flags.0?Bool = Updates;
diff --git a/td/generate/tl-parser b/td/generate/tl-parser
deleted file mode 160000
index 3df9f70d5..000000000
--- a/td/generate/tl-parser
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 3df9f70d5947282836ea454609fc6dcc1e8f546c
diff --git a/td/mtproto/AuthKey.h b/td/mtproto/AuthKey.h
index 5c3959605..20eb414e2 100644
--- a/td/mtproto/AuthKey.h
+++ b/td/mtproto/AuthKey.h
@@ -34,11 +34,7 @@ class AuthKey {
bool auth_flag() const {
return auth_flag_;
}
- bool was_auth_flag() const {
- return was_auth_flag_;
- }
void set_auth_flag(bool new_auth_flag) {
- was_auth_flag_ |= new_auth_flag;
auth_flag_ = new_auth_flag;
}
@@ -67,15 +63,13 @@ class AuthKey {
}
static constexpr int32 AUTH_FLAG = 1;
- static constexpr int32 WAS_AUTH_FLAG = 2;
static constexpr int32 HAS_CREATED_AT = 4;
template
void store(StorerT &storer) const {
storer.store_binary(auth_key_id_);
bool has_created_at = created_at_ != 0;
- storer.store_binary(static_cast((auth_flag_ ? AUTH_FLAG : 0) | (was_auth_flag_ ? WAS_AUTH_FLAG : 0) |
- (has_created_at ? HAS_CREATED_AT : 0)));
+ storer.store_binary(static_cast((auth_flag_ ? AUTH_FLAG : 0) | (has_created_at ? HAS_CREATED_AT : 0)));
storer.store_string(auth_key_);
if (has_created_at) {
storer.store_binary(created_at_);
@@ -87,7 +81,6 @@ class AuthKey {
auth_key_id_ = parser.fetch_long();
auto flags = parser.fetch_int();
auth_flag_ = (flags & AUTH_FLAG) != 0;
- was_auth_flag_ = (flags & WAS_AUTH_FLAG) != 0 || auth_flag_;
auth_key_ = parser.template fetch_string();
if ((flags & HAS_CREATED_AT) != 0) {
created_at_ = parser.fetch_double();
@@ -100,7 +93,6 @@ class AuthKey {
uint64 auth_key_id_{0};
string auth_key_;
bool auth_flag_{false};
- bool was_auth_flag_{false};
bool need_header_{true};
double expires_at_{0};
double created_at_{0};
diff --git a/td/mtproto/ProxySecret.h b/td/mtproto/ProxySecret.h
index 6bb1e441a..fb88ff25c 100644
--- a/td/mtproto/ProxySecret.h
+++ b/td/mtproto/ProxySecret.h
@@ -32,9 +32,9 @@ class ProxySecret {
}
Slice get_proxy_secret() const {
- auto proxy_secret = Slice(secret_).truncate(17);
- if (proxy_secret.size() == 17) {
- proxy_secret.remove_prefix(1);
+ Slice proxy_secret(secret_);
+ if (proxy_secret.size() >= 17) {
+ return proxy_secret.substr(1, 16);
}
return proxy_secret;
}
diff --git a/td/mtproto/RSA.cpp b/td/mtproto/RSA.cpp
index 5c33f3bd5..48740130a 100644
--- a/td/mtproto/RSA.cpp
+++ b/td/mtproto/RSA.cpp
@@ -22,7 +22,7 @@
#include
#include
#include
-#if OPENSSL_VERSION_NUMBER < 0x30000000L
+#if OPENSSL_VERSION_NUMBER < 0x30000000L || defined(LIBRESSL_VERSION_NUMBER)
#include
#endif
@@ -47,7 +47,7 @@ Result RSA::from_pem_public_key(Slice pem) {
BIO_free(bio);
};
-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
EVP_PKEY *rsa = PEM_read_bio_PUBKEY(bio, nullptr, nullptr, nullptr);
#else
auto rsa = PEM_read_bio_RSAPublicKey(bio, nullptr, nullptr, nullptr);
@@ -56,14 +56,14 @@ Result RSA::from_pem_public_key(Slice pem) {
return Status::Error("Error while reading RSA public key");
}
SCOPE_EXIT {
-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
EVP_PKEY_free(rsa);
#else
RSA_free(rsa);
#endif
};
-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
if (!EVP_PKEY_is_a(rsa, "RSA")) {
return Status::Error("Key is not an RSA key");
}
@@ -76,7 +76,7 @@ Result RSA::from_pem_public_key(Slice pem) {
}
#endif
-#if OPENSSL_VERSION_NUMBER >= 0x30000000L
+#if OPENSSL_VERSION_NUMBER >= 0x30000000L && !defined(LIBRESSL_VERSION_NUMBER)
BIGNUM *n_num = nullptr;
BIGNUM *e_num = nullptr;
diff --git a/td/mtproto/TcpTransport.cpp b/td/mtproto/TcpTransport.cpp
index 70546ec1c..98760aa1e 100644
--- a/td/mtproto/TcpTransport.cpp
+++ b/td/mtproto/TcpTransport.cpp
@@ -63,7 +63,7 @@ void IntermediateTransport::write_prepare_inplace(BufferWriter *message, bool qu
size_t append_size = 0;
if (with_padding()) {
append_size = Random::secure_uint32() % 16;
- MutableSlice append = message->prepare_append().truncate(append_size);
+ MutableSlice append = message->prepare_append().substr(0, append_size);
CHECK(append.size() == append_size);
Random::secure_bytes(append);
message->confirm_append(append.size());
diff --git a/td/mtproto/Transport.cpp b/td/mtproto/Transport.cpp
index 782aa8683..7aa616622 100644
--- a/td/mtproto/Transport.cpp
+++ b/td/mtproto/Transport.cpp
@@ -226,7 +226,7 @@ Status Transport::read_crypto_impl(int X, MutableSlice message, const AuthKey &a
auto *header = reinterpret_cast(message.begin());
*header_ptr = header;
auto to_decrypt = MutableSlice(header->encrypt_begin(), message.uend());
- to_decrypt = to_decrypt.truncate(to_decrypt.size() & ~15);
+ to_decrypt.truncate(to_decrypt.size() & ~15);
if (to_decrypt.size() % 16 != 0) {
return Status::Error(PSLICE() << "Invalid mtproto message: size of encrypted part is not multiple of 16 [size = "
<< to_decrypt.size() << "]");
diff --git a/td/mtproto/Transport.h b/td/mtproto/Transport.h
index d8875f59a..57eea1a62 100644
--- a/td/mtproto/Transport.h
+++ b/td/mtproto/Transport.h
@@ -91,11 +91,11 @@ class Transport {
static size_t write(const Storer &storer, const AuthKey &auth_key, PacketInfo *info,
MutableSlice dest = MutableSlice());
+ static std::pair calc_message_key2(const AuthKey &auth_key, int X, Slice to_encrypt);
private:
template
static std::pair calc_message_ack_and_key(const HeaderT &head, size_t data_size);
- static std::pair calc_message_key2(const AuthKey &auth_key, int X, Slice to_encrypt);
template
static size_t calc_crypto_size(size_t data_size);
diff --git a/td/telegram/AnimationsManager.cpp b/td/telegram/AnimationsManager.cpp
index 3be56900a..caa54c2cb 100644
--- a/td/telegram/AnimationsManager.cpp
+++ b/td/telegram/AnimationsManager.cpp
@@ -310,6 +310,7 @@ bool AnimationsManager::merge_animations(FileId new_id, FileId old_id, bool can_
return old_->is_changed;
}
+ bool need_merge = true;
auto new_it = animations_.find(new_id);
if (new_it == animations_.end() || new_it->second == nullptr) {
auto &old = animations_[old_id];
@@ -328,8 +329,13 @@ bool AnimationsManager::merge_animations(FileId new_id, FileId old_id, bool can_
if (old_->thumbnail != new_->thumbnail) {
// LOG_STATUS(td_->file_manager_->merge(new_->thumbnail.file_id, old_->thumbnail.file_id));
}
+ if (old_->mime_type == "image/gif" && new_->mime_type == "video/mp4") {
+ need_merge = false;
+ }
+ }
+ if (need_merge) {
+ LOG_STATUS(td_->file_manager_->merge(new_id, old_id));
}
- LOG_STATUS(td_->file_manager_->merge(new_id, old_id));
if (can_delete_old) {
animations_.erase(old_id);
}
@@ -402,7 +408,7 @@ tl_object_ptr AnimationsManager::get_input_media(
}
return make_tl_object(
flags, false /*ignored*/, false /*ignored*/, std::move(input_file), std::move(input_thumbnail), mime_type,
- std::move(attributes), vector>(), 0);
+ std::move(attributes), std::move(added_stickers), 0);
} else {
CHECK(!file_view.has_remote_location());
}
diff --git a/td/telegram/AuthManager.cpp b/td/telegram/AuthManager.cpp
index f73da39e5..301105f15 100644
--- a/td/telegram/AuthManager.cpp
+++ b/td/telegram/AuthManager.cpp
@@ -729,7 +729,7 @@ void AuthManager::on_get_authorization(tl_object_ptrschedule_get_promo_data(0);
G()->td_db()->get_binlog_pmc()->set("fetched_marks_as_unread", "1");
} else {
- send_closure(G()->state_manager(), &StateManager::on_online, true);
+ td->set_is_bot_online(true);
}
send_closure(G()->config_manager(), &ConfigManager::request_config);
if (query_id_ != 0) {
diff --git a/td/telegram/CallActor.cpp b/td/telegram/CallActor.cpp
index ceefd7716..7181834c0 100644
--- a/td/telegram/CallActor.cpp
+++ b/td/telegram/CallActor.cpp
@@ -189,8 +189,8 @@ void CallActor::send_call_signaling_data(string &&data, Promise<> promise) {
auto query = G()->net_query_creator().create(
telegram_api::phone_sendSignalingData(get_input_phone_call("send_call_signaling_data"), BufferSlice(data)));
send_with_promise(std::move(query),
- PromiseCreator::lambda([promise = std::move(promise)](NetQueryPtr net_query) mutable {
- auto res = fetch_result(std::move(net_query));
+ PromiseCreator::lambda([promise = std::move(promise)](Result r_net_query) mutable {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
promise.set_error(res.move_as_error());
} else {
@@ -298,14 +298,15 @@ void CallActor::rate_call(int32 rating, string comment, vectornet_query_creator().create(tl_query);
- send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this)](NetQueryPtr net_query) {
- send_closure(actor_id, &CallActor::on_set_rating_query_result, std::move(net_query));
+ send_with_promise(std::move(query),
+ PromiseCreator::lambda([actor_id = actor_id(this)](Result r_net_query) {
+ send_closure(actor_id, &CallActor::on_set_rating_query_result, std::move(r_net_query));
}));
loop();
}
-void CallActor::on_set_rating_query_result(NetQueryPtr net_query) {
- auto res = fetch_result(std::move(net_query));
+void CallActor::on_set_rating_query_result(Result r_net_query) {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
return on_error(res.move_as_error());
}
@@ -321,14 +322,15 @@ void CallActor::send_call_debug_information(string data, Promise<> promise) {
auto tl_query = telegram_api::phone_saveCallDebug(get_input_phone_call("send_call_debug_information"),
make_tl_object(std::move(data)));
auto query = G()->net_query_creator().create(tl_query);
- send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this)](NetQueryPtr net_query) {
- send_closure(actor_id, &CallActor::on_set_debug_query_result, std::move(net_query));
+ send_with_promise(std::move(query),
+ PromiseCreator::lambda([actor_id = actor_id(this)](Result r_net_query) {
+ send_closure(actor_id, &CallActor::on_set_debug_query_result, std::move(r_net_query));
}));
loop();
}
-void CallActor::on_set_debug_query_result(NetQueryPtr net_query) {
- auto res = fetch_result(std::move(net_query));
+void CallActor::on_set_debug_query_result(Result r_net_query) {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
return on_error(res.move_as_error());
}
@@ -603,13 +605,14 @@ void CallActor::do_load_dh_config(Promise> promise) {
void CallActor::send_received_query() {
auto tl_query = telegram_api::phone_receivedCall(get_input_phone_call("send_received_query"));
auto query = G()->net_query_creator().create(tl_query);
- send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this)](NetQueryPtr net_query) {
- send_closure(actor_id, &CallActor::on_received_query_result, std::move(net_query));
+ send_with_promise(std::move(query),
+ PromiseCreator::lambda([actor_id = actor_id(this)](Result r_net_query) {
+ send_closure(actor_id, &CallActor::on_received_query_result, std::move(r_net_query));
}));
}
-void CallActor::on_received_query_result(NetQueryPtr net_query) {
- auto res = fetch_result(std::move(net_query));
+void CallActor::on_received_query_result(Result r_net_query) {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
return on_error(res.move_as_error());
}
@@ -637,13 +640,14 @@ void CallActor::try_send_request_query() {
set_timeout_in(timeout);
query->total_timeout_limit_ = max(timeout, 10.0);
request_query_ref_ = query.get_weak();
- send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this)](NetQueryPtr net_query) {
- send_closure(actor_id, &CallActor::on_request_query_result, std::move(net_query));
+ send_with_promise(std::move(query),
+ PromiseCreator::lambda([actor_id = actor_id(this)](Result r_net_query) {
+ send_closure(actor_id, &CallActor::on_request_query_result, std::move(r_net_query));
}));
}
-void CallActor::on_request_query_result(NetQueryPtr net_query) {
- auto res = fetch_result(std::move(net_query));
+void CallActor::on_request_query_result(Result r_net_query) {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
return on_error(res.move_as_error());
}
@@ -666,13 +670,14 @@ void CallActor::try_send_accept_query() {
call_state_.protocol.get_input_phone_call_protocol());
auto query = G()->net_query_creator().create(tl_query);
state_ = State::WaitAcceptResult;
- send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this)](NetQueryPtr net_query) {
- send_closure(actor_id, &CallActor::on_accept_query_result, std::move(net_query));
+ send_with_promise(std::move(query),
+ PromiseCreator::lambda([actor_id = actor_id(this)](Result r_net_query) {
+ send_closure(actor_id, &CallActor::on_accept_query_result, std::move(r_net_query));
}));
}
-void CallActor::on_accept_query_result(NetQueryPtr net_query) {
- auto res = fetch_result(std::move(net_query));
+void CallActor::on_accept_query_result(Result r_net_query) {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
return on_error(res.move_as_error());
}
@@ -690,13 +695,14 @@ void CallActor::try_send_confirm_query() {
call_state_.protocol.get_input_phone_call_protocol());
auto query = G()->net_query_creator().create(tl_query);
state_ = State::WaitConfirmResult;
- send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this)](NetQueryPtr net_query) {
- send_closure(actor_id, &CallActor::on_confirm_query_result, std::move(net_query));
+ send_with_promise(std::move(query),
+ PromiseCreator::lambda([actor_id = actor_id(this)](Result r_net_query) {
+ send_closure(actor_id, &CallActor::on_confirm_query_result, std::move(r_net_query));
}));
}
-void CallActor::on_confirm_query_result(NetQueryPtr net_query) {
- auto res = fetch_result(std::move(net_query));
+void CallActor::on_confirm_query_result(Result r_net_query) {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
return on_error(res.move_as_error());
}
@@ -720,13 +726,14 @@ void CallActor::try_send_discard_query() {
get_input_phone_call_discard_reason(call_state_.discard_reason), connection_id_);
auto query = G()->net_query_creator().create(tl_query);
state_ = State::WaitDiscardResult;
- send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this)](NetQueryPtr net_query) {
- send_closure(actor_id, &CallActor::on_discard_query_result, std::move(net_query));
+ send_with_promise(std::move(query),
+ PromiseCreator::lambda([actor_id = actor_id(this)](Result r_net_query) {
+ send_closure(actor_id, &CallActor::on_discard_query_result, std::move(r_net_query));
}));
}
-void CallActor::on_discard_query_result(NetQueryPtr net_query) {
- auto res = fetch_result(std::move(net_query));
+void CallActor::on_discard_query_result(Result r_net_query) {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
return on_error(res.move_as_error());
}
@@ -768,13 +775,14 @@ void CallActor::flush_call_state() {
void CallActor::start_up() {
auto tl_query = telegram_api::phone_getCallConfig();
auto query = G()->net_query_creator().create(tl_query);
- send_with_promise(std::move(query), PromiseCreator::lambda([actor_id = actor_id(this)](NetQueryPtr net_query) {
- send_closure(actor_id, &CallActor::on_get_call_config_result, std::move(net_query));
+ send_with_promise(std::move(query),
+ PromiseCreator::lambda([actor_id = actor_id(this)](Result r_net_query) {
+ send_closure(actor_id, &CallActor::on_get_call_config_result, std::move(r_net_query));
}));
}
-void CallActor::on_get_call_config_result(NetQueryPtr net_query) {
- auto res = fetch_result(std::move(net_query));
+void CallActor::on_get_call_config_result(Result r_net_query) {
+ auto res = fetch_result(std::move(r_net_query));
if (res.is_error()) {
return on_error(res.move_as_error());
}
diff --git a/td/telegram/CallActor.h b/td/telegram/CallActor.h
index 7d282661f..d4ac600ff 100644
--- a/td/telegram/CallActor.h
+++ b/td/telegram/CallActor.h
@@ -164,28 +164,28 @@ class CallActor : public NetQueryCallback {
Status do_update_call(telegram_api::phoneCallDiscarded &call);
void send_received_query();
- void on_received_query_result(NetQueryPtr net_query);
+ void on_received_query_result(Result r_net_query);
void try_send_request_query();
- void on_request_query_result(NetQueryPtr net_query);
+ void on_request_query_result(Result r_net_query);
void try_send_accept_query();
- void on_accept_query_result(NetQueryPtr net_query);
+ void on_accept_query_result(Result r_net_query);
void try_send_confirm_query();
- void on_confirm_query_result(NetQueryPtr net_query);
+ void on_confirm_query_result(Result r_net_query);
void try_send_discard_query();
- void on_discard_query_result(NetQueryPtr net_query);
+ void on_discard_query_result(Result r_net_query);
void on_begin_exchanging_key();
void on_call_discarded(CallDiscardReason reason, bool need_rating, bool need_debug, bool is_video);
- void on_set_rating_query_result(NetQueryPtr net_query);
- void on_set_debug_query_result(NetQueryPtr net_query);
+ void on_set_rating_query_result(Result r_net_query);
+ void on_set_debug_query_result(Result r_net_query);
- void on_get_call_config_result(NetQueryPtr net_query);
+ void on_get_call_config_result(Result r_net_query);
void flush_call_state();
diff --git a/td/telegram/ConfigManager.cpp b/td/telegram/ConfigManager.cpp
index c5be27e4c..09bdd1e81 100644
--- a/td/telegram/ConfigManager.cpp
+++ b/td/telegram/ConfigManager.cpp
@@ -45,6 +45,7 @@
#include "td/utils/common.h"
#include "td/utils/crypto.h"
#include "td/utils/format.h"
+#include "td/utils/HttpUrl.h"
#include "td/utils/JsonBuilder.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
@@ -56,7 +57,6 @@
#include "td/utils/tl_parsers.h"
#include "td/utils/UInt.h"
-#include
#include
#include
#include
@@ -100,7 +100,7 @@ Result HttpDate::to_unix_time(int32 year, int32 month, int32 day, int32 h
return res;
}
-Result HttpDate::parse_http_date(std::string slice) {
+Result HttpDate::parse_http_date(string slice) {
Parser p(slice);
p.read_till(','); // ignore week day
p.skip(',');
@@ -434,10 +434,8 @@ ActorOwn<> get_full_config(DcOption option, Promise promise, ActorSh
}
return res;
}
- std::pair get_auth_key_state() override {
- auto auth_key = get_auth_key();
- AuthKeyState state = AuthDataShared::get_auth_key_state(auth_key);
- return std::make_pair(state, auth_key.was_auth_flag());
+ AuthKeyState get_auth_key_state() override {
+ return AuthDataShared::get_auth_key_state(get_auth_key());
}
void set_auth_key(const mtproto::AuthKey &auth_key) override {
G()->td_db()->get_binlog_pmc()->set(auth_key_key(), serialize(auth_key));
@@ -890,6 +888,9 @@ void ConfigManager::start_up() {
expire_time_ = expire_time;
set_timeout_in(expire_time_.in());
}
+
+ autologin_update_time_ = Time::now() - 365 * 86400;
+ autologin_domains_ = full_split(G()->td_db()->get_binlog_pmc()->get("autologin_domains"), '\xFF');
}
ActorShared<> ConfigManager::create_reference() {
@@ -966,6 +967,60 @@ void ConfigManager::get_app_config(Promise
}
}
+void ConfigManager::get_external_link(string &&link, Promise &&promise) {
+ if (G()->close_flag()) {
+ return promise.set_value(std::move(link));
+ }
+
+ auto r_url = parse_url(link);
+ if (r_url.is_error()) {
+ return promise.set_value(std::move(link));
+ }
+
+ if (!td::contains(autologin_domains_, r_url.ok().host_)) {
+ return promise.set_value(std::move(link));
+ }
+
+ if (autologin_update_time_ < Time::now() - 10000) {
+ auto query_promise = PromiseCreator::lambda([link = std::move(link), promise = std::move(promise)](
+ Result> &&result) mutable {
+ if (result.is_error()) {
+ return promise.set_value(std::move(link));
+ }
+ send_closure(G()->config_manager(), &ConfigManager::get_external_link, std::move(link), std::move(promise));
+ });
+ return get_app_config(std::move(query_promise));
+ }
+
+ if (autologin_token_.empty()) {
+ return promise.set_value(std::move(link));
+ }
+
+ auto url = r_url.move_as_ok();
+ url.protocol_ = HttpUrl::Protocol::Https;
+ Slice path = url.query_;
+ path.truncate(url.query_.find_first_of("?#"));
+ Slice parameters_hash = Slice(url.query_).substr(path.size());
+ Slice parameters = parameters_hash;
+ parameters.truncate(parameters.find('#'));
+ Slice hash = parameters_hash.substr(parameters.size());
+
+ string added_parameter;
+ if (parameters.empty()) {
+ added_parameter = '?';
+ } else if (parameters.size() == 1) {
+ CHECK(parameters == "?");
+ } else {
+ added_parameter = '&';
+ }
+ added_parameter += "autologin_token=";
+ added_parameter += autologin_token_;
+
+ url.query_ = PSTRING() << path << parameters << added_parameter << hash;
+
+ promise.set_value(url.get_url());
+}
+
void ConfigManager::get_content_settings(Promise &&promise) {
if (G()->close_flag()) {
return promise.set_error(Status::Error(500, "Request aborted"));
@@ -1025,7 +1080,7 @@ void ConfigManager::set_archive_and_mute(bool archive_and_mute, Promise &&
return promise.set_error(Status::Error(500, "Request aborted"));
}
if (archive_and_mute) {
- do_dismiss_suggested_action(SuggestedAction::EnableArchiveAndMuteNewChats);
+ remove_suggested_action(suggested_actions_, SuggestedAction{SuggestedAction::Type::EnableArchiveAndMuteNewChats});
}
last_set_archive_and_mute_ = archive_and_mute;
@@ -1070,22 +1125,13 @@ void ConfigManager::do_set_ignore_sensitive_content_restrictions(bool ignore_sen
void ConfigManager::do_set_archive_and_mute(bool archive_and_mute) {
if (archive_and_mute) {
- do_dismiss_suggested_action(SuggestedAction::EnableArchiveAndMuteNewChats);
+ remove_suggested_action(suggested_actions_, SuggestedAction{SuggestedAction::Type::EnableArchiveAndMuteNewChats});
}
G()->shared_config().set_option_boolean("archive_and_mute_new_chats_from_unknown_users", archive_and_mute);
}
-td_api::object_ptr ConfigManager::get_update_suggested_actions(
- const vector &added_actions, const vector &removed_actions) {
- return td_api::make_object(transform(added_actions, get_suggested_action_object),
- transform(removed_actions, get_suggested_action_object));
-}
-
void ConfigManager::dismiss_suggested_action(SuggestedAction suggested_action, Promise &&promise) {
- if (suggested_action == SuggestedAction::Empty) {
- return promise.set_error(Status::Error(400, "Action must be non-empty"));
- }
- auto action_str = get_suggested_action_str(suggested_action);
+ auto action_str = suggested_action.get_suggested_action_str();
if (action_str.empty()) {
return promise.set_value(Unit());
}
@@ -1095,27 +1141,24 @@ void ConfigManager::dismiss_suggested_action(SuggestedAction suggested_action, P
}
dismiss_suggested_action_request_count_++;
- auto &queries = dismiss_suggested_action_queries_[suggested_action];
+ auto type = static_cast(suggested_action.type_);
+ auto &queries = dismiss_suggested_action_queries_[type];
queries.push_back(std::move(promise));
if (queries.size() == 1) {
G()->net_query_dispatcher().dispatch_with_callback(
- G()->net_query_creator().create(telegram_api::help_dismissSuggestion(action_str)),
- actor_shared(this, 100 + static_cast(suggested_action)));
- }
-}
-
-void ConfigManager::do_dismiss_suggested_action(SuggestedAction suggested_action) {
- if (td::remove(suggested_actions_, suggested_action)) {
- send_closure(G()->td(), &Td::send_update, get_update_suggested_actions({}, {suggested_action}));
+ G()->net_query_creator().create(
+ telegram_api::help_dismissSuggestion(make_tl_object(), action_str)),
+ actor_shared(this, 100 + type));
}
}
void ConfigManager::on_result(NetQueryPtr res) {
auto token = get_link_token();
if (token >= 100 && token <= 200) {
- SuggestedAction suggested_action = static_cast(static_cast(token - 100));
- auto promises = std::move(dismiss_suggested_action_queries_[suggested_action]);
- dismiss_suggested_action_queries_.erase(suggested_action);
+ auto type = static_cast(token - 100);
+ SuggestedAction suggested_action{static_cast(type)};
+ auto promises = std::move(dismiss_suggested_action_queries_[type]);
+ dismiss_suggested_action_queries_.erase(type);
CHECK(!promises.empty());
CHECK(dismiss_suggested_action_request_count_ >= promises.size());
dismiss_suggested_action_request_count_ -= promises.size();
@@ -1127,7 +1170,7 @@ void ConfigManager::on_result(NetQueryPtr res) {
}
return;
}
- do_dismiss_suggested_action(suggested_action);
+ remove_suggested_action(suggested_actions_, suggested_action);
get_app_config(Auto());
for (auto &promise : promises) {
@@ -1476,6 +1519,11 @@ void ConfigManager::process_app_config(tl_object_ptr &c
const bool archive_and_mute =
G()->shared_config().get_option_boolean("archive_and_mute_new_chats_from_unknown_users");
+ autologin_token_.clear();
+ auto old_autologin_domains = std::move(autologin_domains_);
+ autologin_domains_.clear();
+ autologin_update_time_ = Time::now();
+
vector> new_values;
string ignored_restriction_reasons;
vector dice_emojis;
@@ -1613,10 +1661,11 @@ void ConfigManager::process_app_config(tl_object_ptr &c
CHECK(action != nullptr);
if (action->get_id() == telegram_api::jsonString::ID) {
Slice action_str = static_cast(action.get())->value_;
- auto suggested_action = get_suggested_action(action_str);
- if (suggested_action != SuggestedAction::Empty) {
- if (archive_and_mute && suggested_action == SuggestedAction::EnableArchiveAndMuteNewChats) {
- LOG(INFO) << "Skip SuggestedAction::EnableArchiveAndMuteNewChats";
+ SuggestedAction suggested_action(action_str);
+ if (!suggested_action.is_empty()) {
+ if (archive_and_mute &&
+ suggested_action == SuggestedAction{SuggestedAction::Type::EnableArchiveAndMuteNewChats}) {
+ LOG(INFO) << "Skip EnableArchiveAndMuteNewChats suggested action";
} else {
suggested_actions.push_back(suggested_action);
}
@@ -1641,6 +1690,30 @@ void ConfigManager::process_app_config(tl_object_ptr &c
}
continue;
}
+ if (key == "autologin_token") {
+ if (value->get_id() == telegram_api::jsonString::ID) {
+ autologin_token_ = url_encode(static_cast(value)->value_);
+ } else {
+ LOG(ERROR) << "Receive unexpected autologin_token " << to_string(*value);
+ }
+ continue;
+ }
+ if (key == "autologin_domains") {
+ if (value->get_id() == telegram_api::jsonArray::ID) {
+ auto domains = std::move(static_cast(value)->value_);
+ for (auto &domain : domains) {
+ CHECK(domain != nullptr);
+ if (domain->get_id() == telegram_api::jsonString::ID) {
+ autologin_domains_.push_back(std::move(static_cast(domain.get())->value_));
+ } else {
+ LOG(ERROR) << "Receive unexpected autologin domain " << to_string(domain);
+ }
+ }
+ } else {
+ LOG(ERROR) << "Receive unexpected autologin_domains " << to_string(*value);
+ }
+ continue;
+ }
new_values.push_back(std::move(key_value));
}
@@ -1649,6 +1722,10 @@ void ConfigManager::process_app_config(tl_object_ptr &c
}
config = make_tl_object(std::move(new_values));
+ if (autologin_domains_ != old_autologin_domains) {
+ G()->td_db()->get_binlog_pmc()->set("autologin_domains", implode(autologin_domains_, '\xFF'));
+ }
+
ConfigShared &shared_config = G()->shared_config();
if (ignored_restriction_reasons.empty()) {
@@ -1700,34 +1777,13 @@ void ConfigManager::process_app_config(tl_object_ptr &c
// do not update suggested actions while changing content settings or dismissing an action
if (!is_set_content_settings_request_sent_ && dismiss_suggested_action_request_count_ == 0) {
- td::unique(suggested_actions);
- if (suggested_actions != suggested_actions_) {
- vector added_actions;
- vector removed_actions;
- auto old_it = suggested_actions_.begin();
- auto new_it = suggested_actions.begin();
- while (old_it != suggested_actions_.end() || new_it != suggested_actions.end()) {
- if (old_it != suggested_actions_.end() &&
- (new_it == suggested_actions.end() || std::less()(*old_it, *new_it))) {
- removed_actions.push_back(*old_it++);
- } else if (old_it == suggested_actions_.end() || std::less()(*new_it, *old_it)) {
- added_actions.push_back(*new_it++);
- } else {
- old_it++;
- new_it++;
- }
- }
- CHECK(!added_actions.empty() || !removed_actions.empty());
- suggested_actions_ = std::move(suggested_actions);
- send_closure(G()->td(), &Td::send_update,
- get_update_suggested_actions(std::move(added_actions), std::move(removed_actions)));
- }
+ update_suggested_actions(suggested_actions_, std::move(suggested_actions));
}
}
void ConfigManager::get_current_state(vector> &updates) const {
if (!suggested_actions_.empty()) {
- updates.push_back(get_update_suggested_actions(suggested_actions_, {}));
+ updates.push_back(get_update_suggested_actions_object(suggested_actions_, {}));
}
}
diff --git a/td/telegram/ConfigManager.h b/td/telegram/ConfigManager.h
index 0b12e4c70..ecc3569c6 100644
--- a/td/telegram/ConfigManager.h
+++ b/td/telegram/ConfigManager.h
@@ -93,6 +93,8 @@ class ConfigManager : public NetQueryCallback {
void get_app_config(Promise> &&promise);
+ void get_external_link(string &&link, Promise &&promise);
+
void get_content_settings(Promise &&promise);
void set_content_settings(bool ignore_sensitive_content_restrictions, Promise &&promise);
@@ -114,6 +116,10 @@ class ConfigManager : public NetQueryCallback {
int ref_cnt_{1};
Timestamp expire_time_;
+ string autologin_token_;
+ vector autologin_domains_;
+ double autologin_update_time_ = 0.0;
+
FloodControlStrict lazy_request_flood_control_;
vector>> get_app_config_queries_;
@@ -130,7 +136,7 @@ class ConfigManager : public NetQueryCallback {
vector suggested_actions_;
size_t dismiss_suggested_action_request_count_ = 0;
- std::map>> dismiss_suggested_action_queries_;
+ std::map>> dismiss_suggested_action_queries_;
static constexpr uint64 REFCNT_TOKEN = std::numeric_limits::max() - 2;
@@ -151,11 +157,6 @@ class ConfigManager : public NetQueryCallback {
void do_set_archive_and_mute(bool archive_and_mute);
- static td_api::object_ptr get_update_suggested_actions(
- const vector &added_actions, const vector &removed_actions);
-
- void do_dismiss_suggested_action(SuggestedAction suggested_action);
-
static Timestamp load_config_expire_time();
static void save_config_expire(Timestamp timestamp);
static void save_dc_options_update(DcOptions dc_options);
diff --git a/td/telegram/ContactsManager.cpp b/td/telegram/ContactsManager.cpp
index b4add6075..09307e132 100644
--- a/td/telegram/ContactsManager.cpp
+++ b/td/telegram/ContactsManager.cpp
@@ -11,9 +11,12 @@
#include "td/telegram/telegram_api.hpp"
#include "td/telegram/AuthManager.h"
+#include "td/telegram/ConfigManager.h"
#include "td/telegram/ConfigShared.h"
#include "td/telegram/Dependencies.h"
#include "td/telegram/DeviceTokenManager.h"
+#include "td/telegram/DialogInviteLink.h"
+#include "td/telegram/DialogLocation.h"
#include "td/telegram/FileReferenceManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/files/FileType.h"
@@ -24,6 +27,7 @@
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/logevent/LogEventHelper.h"
#include "td/telegram/MessagesManager.h"
+#include "td/telegram/MessageTtlSetting.h"
#include "td/telegram/misc.h"
#include "td/telegram/net/NetQuery.h"
#include "td/telegram/NotificationManager.h"
@@ -31,6 +35,7 @@
#include "td/telegram/Photo.h"
#include "td/telegram/Photo.hpp"
#include "td/telegram/SecretChatActor.h"
+#include "td/telegram/SecretChatsManager.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/StickerSetId.hpp"
#include "td/telegram/StickersManager.h"
@@ -54,6 +59,7 @@
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/Random.h"
+#include "td/utils/Slice.h"
#include "td/utils/StringBuilder.h"
#include "td/utils/Time.h"
#include "td/utils/tl_helpers.h"
@@ -66,6 +72,38 @@
namespace td {
+class DismissSuggestionQuery : public Td::ResultHandler {
+ Promise promise_;
+ DialogId dialog_id_;
+
+ public:
+ explicit DismissSuggestionQuery(Promise &&promise) : promise_(std::move(promise)) {
+ }
+
+ void send(SuggestedAction action) {
+ dialog_id_ = action.dialog_id_;
+ auto input_peer = td->messages_manager_->get_input_peer(dialog_id_, AccessRights::Read);
+ CHECK(input_peer != nullptr);
+
+ send_query(G()->net_query_creator().create(
+ telegram_api::help_dismissSuggestion(std::move(input_peer), action.get_suggested_action_str())));
+ }
+
+ void on_result(uint64 id, BufferSlice packet) override {
+ auto result_ptr = fetch_result(packet);
+ if (result_ptr.is_error()) {
+ return on_error(id, result_ptr.move_as_error());
+ }
+
+ promise_.set_value(Unit());
+ }
+
+ void on_error(uint64 id, Status status) override {
+ td->messages_manager_->on_get_dialog_error(dialog_id_, status, "DismissSuggestionQuery");
+ promise_.set_error(std::move(status));
+ }
+};
+
class SetAccountTtlQuery : public Td::ResultHandler {
Promise promise_;
@@ -1150,13 +1188,13 @@ class ToggleChannelSignaturesQuery : public Td::ResultHandler {
}
};
-class ToggleChannelIsAllHistoryAvailableQuery : public Td::ResultHandler {
+class TogglePrehistoryHiddenQuery : public Td::ResultHandler {
Promise promise_;
ChannelId channel_id_;
bool is_all_history_available_;
public:
- explicit ToggleChannelIsAllHistoryAvailableQuery(Promise &&promise) : promise_(std::move(promise)) {
+ explicit TogglePrehistoryHiddenQuery(Promise &&promise) : promise_(std::move(promise)) {
}
void send(ChannelId channel_id, bool is_all_history_available) {
@@ -1176,7 +1214,7 @@ class ToggleChannelIsAllHistoryAvailableQuery : public Td::ResultHandler {
}
auto ptr = result_ptr.move_as_ok();
- LOG(INFO) << "Receive result for TogglePreHistoryHiddenQuery: " << to_string(ptr);
+ LOG(INFO) << "Receive result for TogglePrehistoryHiddenQuery: " << to_string(ptr);
td->updates_manager_->on_get_updates(
std::move(ptr),
@@ -1197,7 +1235,46 @@ class ToggleChannelIsAllHistoryAvailableQuery : public Td::ResultHandler {
return;
}
} else {
- td->contacts_manager_->on_get_channel_error(channel_id_, status, "ToggleChannelIsAllHistoryAvailableQuery");
+ td->contacts_manager_->on_get_channel_error(channel_id_, status, "TogglePrehistoryHiddenQuery");
+ }
+ promise_.set_error(std::move(status));
+ }
+};
+
+class ConvertToGigagroupQuery : public Td::ResultHandler {
+ Promise promise_;
+ ChannelId channel_id_;
+
+ public:
+ explicit ConvertToGigagroupQuery(Promise &&promise) : promise_(std::move(promise)) {
+ }
+
+ void send(ChannelId channel_id) {
+ channel_id_ = channel_id;
+
+ auto input_channel = td->contacts_manager_->get_input_channel(channel_id);
+ CHECK(input_channel != nullptr);
+ send_query(G()->net_query_creator().create(telegram_api::channels_convertToGigagroup(std::move(input_channel))));
+ }
+
+ void on_result(uint64 id, BufferSlice packet) override {
+ auto result_ptr = fetch_result(packet);
+ if (result_ptr.is_error()) {
+ return on_error(id, result_ptr.move_as_error());
+ }
+
+ auto ptr = result_ptr.move_as_ok();
+ LOG(INFO) << "Receive result for ConvertToGigagroupQuery: " << to_string(ptr);
+
+ td->updates_manager_->on_get_updates(std::move(ptr), std::move(promise_));
+ }
+
+ void on_error(uint64 id, Status status) override {
+ if (status.message() == "CHAT_NOT_MODIFIED") {
+ promise_.set_value(Unit());
+ return;
+ } else {
+ td->contacts_manager_->on_get_channel_error(channel_id_, status, "ConvertToGigagroupQuery");
}
promise_.set_error(std::move(status));
}
@@ -1438,6 +1515,34 @@ class ReportChannelSpamQuery : public Td::ResultHandler {
}
};
+class DeleteChatQuery : public Td::ResultHandler {
+ Promise promise_;
+
+ public:
+ explicit DeleteChatQuery(Promise &&promise) : promise_(std::move(promise)) {
+ }
+
+ void send(ChatId chat_id) {
+ send_query(G()->net_query_creator().create(telegram_api::messages_deleteChat(chat_id.get())));
+ }
+
+ void on_result(uint64 id, BufferSlice packet) override {
+ auto result_ptr = fetch_result(packet);
+ if (result_ptr.is_error()) {
+ return on_error(id, result_ptr.move_as_error());
+ }
+
+ LOG(INFO) << "Receive result for DeleteChatQuery: " << result_ptr.ok();
+ td->updates_manager_->get_difference("DeleteChatQuery");
+ td->updates_manager_->on_get_updates(make_tl_object(Auto(), Auto(), Auto(), 0, 0),
+ std::move(promise_));
+ }
+
+ void on_error(uint64 id, Status status) override {
+ promise_.set_error(std::move(status));
+ }
+};
+
class DeleteChannelQuery : public Td::ResultHandler {
Promise promise_;
ChannelId channel_id_;
@@ -1535,21 +1640,35 @@ class EditChatAdminQuery : public Td::ResultHandler {
}
};
-class ExportChatInviteLinkQuery : public Td::ResultHandler {
- Promise promise_;
- ChatId chat_id_;
+class ExportChatInviteQuery : public Td::ResultHandler {
+ Promise> promise_;
+ DialogId dialog_id_;
public:
- explicit ExportChatInviteLinkQuery(Promise &&promise) : promise_(std::move(promise)) {
+ explicit ExportChatInviteQuery(Promise> &&promise)
+ : promise_(std::move(promise)) {
}
- void send(ChatId chat_id) {
- chat_id_ = chat_id;
- auto input_peer = td->messages_manager_->get_input_peer(DialogId(chat_id), AccessRights::Read);
+ void send(DialogId dialog_id, int32 expire_date, int32 usage_limit, bool is_permanent) {
+ dialog_id_ = dialog_id;
+ auto input_peer = td->messages_manager_->get_input_peer(dialog_id, AccessRights::Write);
if (input_peer == nullptr) {
return on_error(0, Status::Error(400, "Can't access the chat"));
}
- send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite(std::move(input_peer))));
+
+ int32 flags = 0;
+ if (expire_date > 0) {
+ flags |= telegram_api::messages_exportChatInvite::EXPIRE_DATE_MASK;
+ }
+ if (usage_limit > 0) {
+ flags |= telegram_api::messages_exportChatInvite::USAGE_LIMIT_MASK;
+ }
+ if (is_permanent) {
+ flags |= telegram_api::messages_exportChatInvite::LEGACY_REVOKE_PERMANENT_MASK;
+ }
+
+ send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite(
+ flags, false /*ignored*/, std::move(input_peer), expire_date, usage_limit)));
}
void on_result(uint64 id, BufferSlice packet) override {
@@ -1561,65 +1680,464 @@ class ExportChatInviteLinkQuery : public Td::ResultHandler {
auto ptr = result_ptr.move_as_ok();
LOG(INFO) << "Receive result for ExportChatInviteQuery: " << to_string(ptr);
- td->contacts_manager_->on_get_chat_invite_link(chat_id_, std::move(ptr));
- promise_.set_value(Unit());
+ DialogInviteLink invite_link(std::move(ptr));
+ if (!invite_link.is_valid()) {
+ return on_error(id, Status::Error(500, "Receive invalid invite link"));
+ }
+ if (invite_link.get_creator_user_id() != td->contacts_manager_->get_my_id()) {
+ return on_error(id, Status::Error(500, "Receive invalid invite link creator"));
+ }
+ if (invite_link.is_permanent()) {
+ td->contacts_manager_->on_get_permanent_dialog_invite_link(dialog_id_, invite_link);
+ }
+ promise_.set_value(invite_link.get_chat_invite_link_object(td->contacts_manager_.get()));
}
void on_error(uint64 id, Status status) override {
+ td->messages_manager_->on_get_dialog_error(dialog_id_, status, "ExportChatInviteQuery");
promise_.set_error(std::move(status));
- td->updates_manager_->get_difference("ExportChatInviteLinkQuery");
}
};
-class ExportChannelInviteLinkQuery : public Td::ResultHandler {
- Promise promise_;
- ChannelId channel_id_;
+class EditChatInviteLinkQuery : public Td::ResultHandler {
+ Promise> promise_;
+ DialogId dialog_id_;
public:
- explicit ExportChannelInviteLinkQuery(Promise &&promise) : promise_(std::move(promise)) {
+ explicit EditChatInviteLinkQuery(Promise> &&promise)
+ : promise_(std::move(promise)) {
}
- void send(ChannelId channel_id) {
- channel_id_ = channel_id;
- auto input_peer = td->messages_manager_->get_input_peer(DialogId(channel_id), AccessRights::Read);
+ void send(DialogId dialog_id, const string &invite_link, int32 expire_date, int32 usage_limit) {
+ dialog_id_ = dialog_id;
+ auto input_peer = td->messages_manager_->get_input_peer(dialog_id, AccessRights::Write);
if (input_peer == nullptr) {
return on_error(0, Status::Error(400, "Can't access the chat"));
}
- send_query(G()->net_query_creator().create(telegram_api::messages_exportChatInvite(std::move(input_peer))));
+
+ int32 flags = telegram_api::messages_editExportedChatInvite::EXPIRE_DATE_MASK |
+ telegram_api::messages_editExportedChatInvite::USAGE_LIMIT_MASK;
+ send_query(G()->net_query_creator().create(telegram_api::messages_editExportedChatInvite(
+ flags, false /*ignored*/, std::move(input_peer), invite_link, expire_date, usage_limit)));
}
void on_result(uint64 id, BufferSlice packet) override {
- auto result_ptr = fetch_result(packet);
+ auto result_ptr = fetch_result(packet);
if (result_ptr.is_error()) {
return on_error(id, result_ptr.move_as_error());
}
- auto ptr = result_ptr.move_as_ok();
- LOG(INFO) << "Receive result for ExportChannelInviteQuery: " << to_string(ptr);
+ auto result = result_ptr.move_as_ok();
+ LOG(INFO) << "Receive result for EditChatInviteLinkQuery: " << to_string(result);
+
+ if (result->get_id() != telegram_api::messages_exportedChatInvite::ID) {
+ return on_error(id, Status::Error(500, "Receive unexpected response from server"));
+ }
+
+ auto invite = move_tl_object_as(result);
+
+ td->contacts_manager_->on_get_users(std::move(invite->users_), "EditChatInviteLinkQuery");
+
+ DialogInviteLink invite_link(std::move(invite->invite_));
+ if (!invite_link.is_valid()) {
+ return on_error(id, Status::Error(500, "Receive invalid invite link"));
+ }
+ promise_.set_value(invite_link.get_chat_invite_link_object(td->contacts_manager_.get()));
+ }
+
+ void on_error(uint64 id, Status status) override {
+ td->messages_manager_->on_get_dialog_error(dialog_id_, status, "EditChatInviteLinkQuery");
+ promise_.set_error(std::move(status));
+ }
+};
+
+class GetExportedChatInviteQuery : public Td::ResultHandler {
+ Promise> promise_;
+ DialogId dialog_id_;
+
+ public:
+ explicit GetExportedChatInviteQuery(Promise> &&promise)
+ : promise_(std::move(promise)) {
+ }
+
+ void send(DialogId dialog_id, const string &invite_link) {
+ dialog_id_ = dialog_id;
+ auto input_peer = td->messages_manager_->get_input_peer(dialog_id, AccessRights::Write);
+ if (input_peer == nullptr) {
+ return on_error(0, Status::Error(400, "Can't access the chat"));
+ }
+
+ send_query(G()->net_query_creator().create(
+ telegram_api::messages_getExportedChatInvite(std::move(input_peer), invite_link)));
+ }
+
+ void on_result(uint64 id, BufferSlice packet) override {
+ auto result_ptr = fetch_result(packet);
+ if (result_ptr.is_error()) {
+ return on_error(id, result_ptr.move_as_error());
+ }
+
+ if (result_ptr.ok()->get_id() != telegram_api::messages_exportedChatInvite::ID) {
+ LOG(ERROR) << "Receive wrong result for GetExportedChatInviteQuery: " << to_string(result_ptr.ok());
+ return on_error(id, Status::Error(500, "Receive unexpected response"));
+ }
+
+ auto result = move_tl_object_as(result_ptr.ok_ref());
+ LOG(INFO) << "Receive result for GetExportedChatInviteQuery: " << to_string(result);
+
+ td->contacts_manager_->on_get_users(std::move(result->users_), "GetExportedChatInviteQuery");
+
+ DialogInviteLink invite_link(std::move(result->invite_));
+ if (!invite_link.is_valid()) {
+ LOG(ERROR) << "Receive invalid invite link in " << dialog_id_;
+ return on_error(id, Status::Error(500, "Receive invalid invite link"));
+ }
+ promise_.set_value(invite_link.get_chat_invite_link_object(td->contacts_manager_.get()));
+ }
+
+ void on_error(uint64 id, Status status) override {
+ td->messages_manager_->on_get_dialog_error(dialog_id_, status, "GetExportedChatInviteQuery");
+ promise_.set_error(std::move(status));
+ }
+};
+
+class GetExportedChatInvitesQuery : public Td::ResultHandler {
+ Promise