diff --git a/CMake/iOS.cmake b/CMake/iOS.cmake index 4c1e3065f..935139542 100644 --- a/CMake/iOS.cmake +++ b/CMake/iOS.cmake @@ -136,12 +136,9 @@ if (IOS_DEPLOYMENT_TARGET) endif() set (CMAKE_SHARED_LINKER_FLAGS_INIT "-fapplication-extension") -if (NOT SIMULATOR_FLAG) - set (BITCODE "-fembed-bitcode") -endif() -set (CMAKE_C_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE}") +set (CMAKE_C_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS}") # Hidden visibilty is required for cxx on iOS -set (CMAKE_CXX_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} ${BITCODE} -fvisibility-inlines-hidden") +set (CMAKE_CXX_FLAGS_INIT "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fvisibility-inlines-hidden") set (CMAKE_C_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fapplication-extension -Wl,-search_paths_first ${CMAKE_C_LINK_FLAGS}") set (CMAKE_CXX_LINK_FLAGS "${XCODE_IOS_PLATFORM_VERSION_FLAGS} -fapplication-extension -Wl,-search_paths_first ${CMAKE_CXX_LINK_FLAGS}") diff --git a/CMakeLists.txt b/CMakeLists.txt index 1beff40de..cb46c1cda 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -6,7 +6,7 @@ if (POLICY CMP0065) cmake_policy(SET CMP0065 NEW) endif() -project(TDLib VERSION 1.8.6 LANGUAGES CXX C) +project(TDLib VERSION 1.8.8 LANGUAGES CXX C) if (NOT DEFINED CMAKE_MODULE_PATH) set(CMAKE_MODULE_PATH "") @@ -324,6 +324,7 @@ set(TDLIB_SOURCE td/telegram/DialogId.cpp td/telegram/DialogInviteLink.cpp td/telegram/DialogLocation.cpp + td/telegram/DialogNotificationSettings.cpp td/telegram/DialogParticipant.cpp td/telegram/DialogParticipantFilter.cpp td/telegram/DialogSource.cpp @@ -355,6 +356,11 @@ set(TDLIB_SOURCE td/telegram/files/FileUploader.cpp td/telegram/files/PartsManager.cpp td/telegram/files/ResourceManager.cpp + td/telegram/ForumTopic.cpp + td/telegram/ForumTopicEditedData.cpp + td/telegram/ForumTopicIcon.cpp + td/telegram/ForumTopicInfo.cpp + td/telegram/ForumTopicManager.cpp td/telegram/Game.cpp td/telegram/GameManager.cpp td/telegram/Global.cpp @@ -366,6 +372,7 @@ set(TDLIB_SOURCE td/telegram/InlineQueriesManager.cpp td/telegram/InputDialogId.cpp td/telegram/InputGroupCallId.cpp + td/telegram/InputInvoice.cpp td/telegram/InputMessageText.cpp td/telegram/JsonValue.cpp td/telegram/LanguagePackManager.cpp @@ -376,8 +383,10 @@ set(TDLIB_SOURCE td/telegram/MessageContent.cpp td/telegram/MessageContentType.cpp td/telegram/MessageEntity.cpp + td/telegram/MessageExtendedMedia.cpp td/telegram/MessageId.cpp td/telegram/MessageReaction.cpp + td/telegram/MessageReplyHeader.cpp td/telegram/MessageReplyInfo.cpp td/telegram/MessagesDb.cpp td/telegram/MessageSearchFilter.cpp @@ -405,11 +414,12 @@ set(TDLIB_SOURCE td/telegram/net/SessionMultiProxy.cpp td/telegram/NewPasswordState.cpp td/telegram/NotificationManager.cpp - td/telegram/NotificationSettings.cpp + td/telegram/NotificationSettingsScope.cpp td/telegram/NotificationSettingsManager.cpp td/telegram/NotificationSound.cpp td/telegram/NotificationType.cpp td/telegram/OptionManager.cpp + td/telegram/OrderInfo.cpp td/telegram/Payments.cpp td/telegram/PasswordManager.cpp td/telegram/PhoneNumberManager.cpp @@ -425,6 +435,7 @@ set(TDLIB_SOURCE td/telegram/ReplyMarkup.cpp td/telegram/ReportReason.cpp td/telegram/RestrictionReason.cpp + td/telegram/ScopeNotificationSettings.cpp td/telegram/SecretChatActor.cpp td/telegram/SecretChatDb.cpp td/telegram/SecretChatsManager.cpp @@ -451,7 +462,9 @@ set(TDLIB_SOURCE td/telegram/ThemeManager.cpp td/telegram/TopDialogCategory.cpp td/telegram/TopDialogManager.cpp + td/telegram/TranscriptionInfo.cpp td/telegram/UpdatesManager.cpp + td/telegram/Usernames.cpp td/telegram/Venue.cpp td/telegram/VideoNotesManager.cpp td/telegram/VideosManager.cpp @@ -519,6 +532,7 @@ set(TDLIB_SOURCE td/telegram/Contact.h td/telegram/ContactsManager.h td/telegram/CountryInfoManager.h + td/telegram/CustomEmojiId.h td/telegram/DelayDispatcher.h td/telegram/Dependencies.h td/telegram/DeviceTokenManager.h @@ -536,6 +550,7 @@ set(TDLIB_SOURCE td/telegram/DialogInviteLink.h td/telegram/DialogListId.h td/telegram/DialogLocation.h + td/telegram/DialogNotificationSettings.h td/telegram/DialogParticipant.h td/telegram/DialogParticipantFilter.h td/telegram/DialogSource.h @@ -576,6 +591,11 @@ set(TDLIB_SOURCE td/telegram/files/ResourceManager.h td/telegram/files/ResourceState.h td/telegram/FolderId.h + td/telegram/ForumTopic.h + td/telegram/ForumTopicEditedData.h + td/telegram/ForumTopicIcon.h + td/telegram/ForumTopicInfo.h + td/telegram/ForumTopicManager.h td/telegram/FullMessageId.h td/telegram/Game.h td/telegram/GameManager.h @@ -590,8 +610,10 @@ set(TDLIB_SOURCE td/telegram/InlineQueriesManager.h td/telegram/InputDialogId.h td/telegram/InputGroupCallId.h + td/telegram/InputInvoice.h td/telegram/InputMessageText.h td/telegram/JsonValue.h + td/telegram/LabeledPricePart.h td/telegram/LanguagePackManager.h td/telegram/LinkManager.h td/telegram/Location.h @@ -603,9 +625,11 @@ set(TDLIB_SOURCE td/telegram/MessageContentType.h td/telegram/MessageCopyOptions.h td/telegram/MessageEntity.h + td/telegram/MessageExtendedMedia.h td/telegram/MessageId.h td/telegram/MessageLinkInfo.h td/telegram/MessageReaction.h + td/telegram/MessageReplyHeader.h td/telegram/MessageReplyInfo.h td/telegram/MessageThreadInfo.h td/telegram/MessagesDb.h @@ -645,12 +669,13 @@ set(TDLIB_SOURCE td/telegram/NotificationGroupType.h td/telegram/NotificationId.h td/telegram/NotificationManager.h - td/telegram/NotificationSettings.h + td/telegram/NotificationSettingsScope.h td/telegram/NotificationSettingsManager.h td/telegram/NotificationSound.h td/telegram/NotificationSoundType.h td/telegram/NotificationType.h td/telegram/OptionManager.h + td/telegram/OrderInfo.h td/telegram/PasswordManager.h td/telegram/Payments.h td/telegram/PhoneNumberManager.h @@ -672,6 +697,7 @@ set(TDLIB_SOURCE td/telegram/RequestActor.h td/telegram/RestrictionReason.h td/telegram/ScheduledServerMessageId.h + td/telegram/ScopeNotificationSettings.h td/telegram/SecretChatActor.h td/telegram/SecretChatId.h td/telegram/SecretChatDb.h @@ -705,9 +731,11 @@ set(TDLIB_SOURCE td/telegram/ThemeManager.h td/telegram/TopDialogCategory.h td/telegram/TopDialogManager.h + td/telegram/TranscriptionInfo.h td/telegram/UniqueId.h td/telegram/UpdatesManager.h td/telegram/UserId.h + td/telegram/Usernames.h td/telegram/Venue.h td/telegram/Version.h td/telegram/VideoNotesManager.h @@ -721,6 +749,7 @@ set(TDLIB_SOURCE td/telegram/AudiosManager.hpp td/telegram/AuthManager.hpp td/telegram/BackgroundType.hpp + td/telegram/DialogNotificationSettings.hpp td/telegram/DialogFilter.hpp td/telegram/Dimensions.hpp td/telegram/Document.hpp @@ -732,14 +761,17 @@ set(TDLIB_SOURCE td/telegram/files/FileLocation.hpp td/telegram/files/FileManager.hpp td/telegram/files/FileSourceId.hpp + td/telegram/ForumTopicEditedData.hpp + td/telegram/ForumTopicIcon.hpp td/telegram/Game.hpp + td/telegram/InputInvoice.hpp td/telegram/InputMessageText.hpp td/telegram/MessageEntity.hpp + td/telegram/MessageExtendedMedia.hpp td/telegram/MessageReaction.hpp td/telegram/MessageReplyInfo.hpp td/telegram/MinChannel.hpp - td/telegram/NotificationSettings.hpp - td/telegram/Payments.hpp + td/telegram/OrderInfo.hpp td/telegram/Photo.hpp td/telegram/PhotoSize.hpp td/telegram/PhotoSizeSource.hpp @@ -747,10 +779,12 @@ set(TDLIB_SOURCE td/telegram/PollManager.hpp td/telegram/PremiumGiftOption.hpp td/telegram/ReplyMarkup.hpp + td/telegram/ScopeNotificationSettings.hpp td/telegram/SecureValue.hpp td/telegram/SendCodeHelper.hpp td/telegram/StickerSetId.hpp td/telegram/StickersManager.hpp + td/telegram/TranscriptionInfo.hpp td/telegram/VideoNotesManager.hpp td/telegram/VideosManager.hpp td/telegram/VoiceNotesManager.hpp diff --git a/README.md b/README.md index c8cab1657..614710996 100644 --- a/README.md +++ b/README.md @@ -130,7 +130,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.8.6 REQUIRED) +find_package(Td 1.8.8 REQUIRED) target_link_libraries(YourTarget PRIVATE Td::TdStatic) ``` See [example/cpp/CMakeLists.txt](https://github.com/tdlight-team/tdlight/blob/master/example/cpp/CMakeLists.txt). diff --git a/SplitSource.php b/SplitSource.php index 1932b31c0..49854cb71 100644 --- a/SplitSource.php +++ b/SplitSource.php @@ -66,7 +66,7 @@ function split_file($file, $chunks, $undo) { } if (!file_exists($cpp_name)) { - echo "ERROR: skip unexisting file $cpp_name".PHP_EOL; + echo "ERROR: skip nonexistent file $cpp_name".PHP_EOL; return; } @@ -286,12 +286,13 @@ function split_file($file, $chunks, $undo) { 'documents_manager[_(-][^.]|DocumentsManager' => "DocumentsManager", 'file_reference_manager[_(-][^.]|FileReferenceManager|file_references[)]' => 'FileReferenceManager', 'file_manager[_(-][^.]|FileManager([^ ;.]| [^*])|update_file[)]' => 'files/FileManager', + 'forum_topic_manager[_(-][^.]|ForumTopicManager' => 'ForumTopicManager', 'G[(][)]|Global[^A-Za-z]' => 'Global', 'game_manager[_(-][^.]|GameManager' => 'GameManager', 'group_call_manager[_(-][^.]|GroupCallManager' => 'GroupCallManager', 'HashtagHints' => 'HashtagHints', 'inline_queries_manager[_(-][^.]|InlineQueriesManager' => 'InlineQueriesManager', - 'language_pack_manager[_(-][^.]|LanguagePackManager' => 'LanguagePackManager', + 'language_pack_manager[_(-]|LanguagePackManager' => 'LanguagePackManager', 'link_manager[_(-][^.]|LinkManager' => 'LinkManager', 'LogeventIdWithGeneration|add_log_event|delete_log_event|get_erase_log_event_promise|parse_time|store_time' => 'logevent/LogEventHelper', 'MessageCopyOptions' => 'MessageCopyOptions', @@ -303,7 +304,7 @@ function split_file($file, $chunks, $undo) { 'poll_manager[_(-][^.]|PollManager' => "PollManager", 'PublicDialogType|get_public_dialog_type' => 'PublicDialogType', 'SecretChatActor' => 'SecretChatActor', - 'secret_chats_manager[_(-][^.]|SecretChatsManager' => 'SecretChatsManager', + 'secret_chats_manager[_(-]|SecretChatsManager' => 'SecretChatsManager', 'sponsored_message_manager[_(-][^.]|SponsoredMessageManager' => 'SponsoredMessageManager', 'stickers_manager[_(-][^.]|StickersManager' => 'StickersManager', '[>](td_db[(][)]|get_td_db_impl[(])|TdDb[^A-Za-z]' => 'TdDb', diff --git a/benchmark/hashset_memory.cpp b/benchmark/hashset_memory.cpp index 1cc8f891a..ec2ba858e 100644 --- a/benchmark/hashset_memory.cpp +++ b/benchmark/hashset_memory.cpp @@ -138,7 +138,7 @@ static void measure(td::StringBuilder &sb, td::Slice name, td::Slice key_name, t ht.emplace(key_generator.next(), value_generator.next()); update(); if ((i + 1) % p == 0) { - stat.emplace_back(Stat{pi, min_ratio, max_ratio}); + stat.push_back(Stat{pi, min_ratio, max_ratio}); reset(); pi++; p *= 10; diff --git a/example/README.md b/example/README.md index f24e520cb..cbb3a6f42 100644 --- a/example/README.md +++ b/example/README.md @@ -134,7 +134,7 @@ See [example/cpp](https://github.com/tdlight-team/tdlight/tree/master/example/cp See also the source code of [Fernschreiber](https://github.com/Wunderfitz/harbour-fernschreiber) and [Depecher](https://github.com/blacksailer/depecher) – Telegram apps for Sailfish OS, [TELEports](https://gitlab.com/ubports/development/apps/teleports) – a Qt-client for Ubuntu Touch, [tdlib-purple](https://github.com/ars3niy/tdlib-purple) - Telegram plugin for Pidgin, or [MeeGram](https://github.com/qtinsider/meegram2) - a Telegram client for Nokia N9, -[TDLib Native Sciter Extension](https://github.com/RadRussianRus/TDLibNSE) - a Sciter native extension for TDLib's JSON interface, all of which are based on TDLib. +[TDLib Native Sciter Extension](https://github.com/EricKotato/TDLibNSE) - a Sciter native extension for TDLib's JSON interface, all of which are based on TDLib. ## Using TDLib in Swift projects @@ -182,7 +182,7 @@ See also [f-Telegram](https://github.com/evgfilim1/ftg) - Flutter Telegram clien TDLib can be used from the Rust programming language through the [JSON](https://github.com/tdlib/td#using-json) interface. -See [rust-tdlib](https://github.com/aCLr/rust-tdlib), [tdlib](https://github.com/melix99/tdlib-rs), 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 [rust-tdlib](https://github.com/aCLr/rust-tdlib), or [tdlib](https://github.com/melix99/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), [tdjson-rs](https://github.com/mersinvald/tdjson-rs), [rust-tdlib](https://github.com/vhaoran/rust-tdlib), or [tdlib-json-sys](https://github.com/aykxt/tdlib-json-sys) for examples of TDLib Rust bindings. diff --git a/example/android/Dockerfile b/example/android/Dockerfile new file mode 100644 index 000000000..7f738fa86 --- /dev/null +++ b/example/android/Dockerfile @@ -0,0 +1,26 @@ +FROM --platform=linux/amd64 ubuntu:22.04 as build + +RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -yq default-jdk g++ git gperf make perl php-cli unzip wget && rm -rf /var/lib/apt/lists/* + +WORKDIR /home + +ARG ANDROID_NDK_VERSION=23.2.8568313 +COPY ./check-environment.sh ./fetch-sdk.sh ./ +RUN ./fetch-sdk.sh SDK "$ANDROID_NDK_VERSION" + +ARG OPENSSL_VERSION=OpenSSL_1_1_1q +COPY ./build-openssl.sh ./ +RUN ./build-openssl.sh SDK "$ANDROID_NDK_VERSION" openssl "$OPENSSL_VERSION" + +ADD "https://api.github.com/repos/tdlib/td/git/refs/heads/master" version.json +ARG COMMIT_HASH=master +RUN git clone https://github.com/tdlib/td.git && cd td && git checkout "$COMMIT_HASH" +RUN cd td && git merge-base --is-ancestor bcd89728c3b93b67448b93b4863dc5bd4e122a4c "$COMMIT_HASH" + +ARG ANDROID_STL=c++_static +RUN td/example/android/build-tdlib.sh SDK "$ANDROID_NDK_VERSION" openssl "$ANDROID_STL" && rm -rf td/example/android/build-* + + +FROM scratch + +COPY --from=build /home/td/example/android/tdlib/tdlib* / diff --git a/example/android/README.md b/example/android/README.md index f484d2aa9..6fa34fb6d 100644 --- a/example/android/README.md +++ b/example/android/README.md @@ -17,6 +17,8 @@ If you already have prebuilt OpenSSL, you can skip the third step and specify pa If you want to update TDLib to a newer version, you need to run only the script `./build-tdlib.sh`. -You can specify different OpenSSL version as the fourth parameter to the script `./build-openssl.sh`. By default OpenSSL 1.1.1 is used because of much smaller binary footprint than newer OpenSSL versions. +You can specify different OpenSSL version as the fourth parameter to the script `./build-openssl.sh`. By default OpenSSL 1.1.1 is used because of much smaller binary footprint and better performance than newer OpenSSL versions. You can build TDLib against shared standard C++ library by specifying "c++_shared" as the fourth parameter to the script `./build-tdlib.sh`. This can reduce total application size if you have a lot of other C++ code and want it to use the same shared library. + +Alternatively, you can use Docker to build TDLib for Android. Use `docker build --output tdlib .` to build the latest TDLib commit from Github, or `docker build --build-arg COMMIT_HASH= --output tdlib .` to build specific commit. The output archives will be placed in the tdlib directory as specified. diff --git a/example/cpp/CMakeLists.txt b/example/cpp/CMakeLists.txt index a9548d67c..6ad8be44b 100644 --- a/example/cpp/CMakeLists.txt +++ b/example/cpp/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.4 FATAL_ERROR) project(TdExample VERSION 1.0 LANGUAGES CXX) -find_package(Td 1.8.6 REQUIRED) +find_package(Td 1.8.8 REQUIRED) add_executable(tdjson_example tdjson_example.cpp) target_link_libraries(tdjson_example PRIVATE Td::TdJson) diff --git a/example/ios/Python-Apple-support.patch b/example/ios/Python-Apple-support.patch index 65845102c..cb551bf70 100644 --- a/example/ios/Python-Apple-support.patch +++ b/example/ios/Python-Apple-support.patch @@ -1,10 +1,8 @@ diff --git a/Makefile b/Makefile -index 695be54..4efe5e5 100644 +index 695be54..eda7b0d 100644 --- a/Makefile +++ b/Makefile -@@ -5,10 +5,13 @@ - # - iOS - build everything for iOS - # - tvOS - build everything for tvOS +@@ -7,8 +7,11 @@ # - watchOS - build everything for watchOS # - OpenSSL-macOS - build OpenSSL for macOS # - OpenSSL-iOS - build OpenSSL for iOS @@ -16,7 +14,14 @@ index 695be54..4efe5e5 100644 # - BZip2-macOS - build BZip2 for macOS # - BZip2-iOS - build BZip2 for iOS # - BZip2-tvOS - build BZip2 for tvOS -@@ -36,31 +39,45 @@ OPENSSL_VERSION=$(OPENSSL_VERSION_NUMBER)$(OPENSSL_REVISION) +@@ -30,37 +33,51 @@ PYTHON_VERSION=2.7.14 + PYTHON_VER=$(basename $(PYTHON_VERSION)) + + OPENSSL_VERSION_NUMBER=1.0.2 +-OPENSSL_REVISION=n ++OPENSSL_REVISION=u + OPENSSL_VERSION=$(OPENSSL_VERSION_NUMBER)$(OPENSSL_REVISION) + BZIP2_VERSION=1.0.6 # Supported OS @@ -33,19 +38,23 @@ index 695be54..4efe5e5 100644 -TARGETS-iOS=iphonesimulator.x86_64 iphonesimulator.i386 iphoneos.armv7 iphoneos.armv7s iphoneos.arm64 +TARGETS-iOS=iphoneos.armv7 iphoneos.armv7s iphoneos.arm64 CFLAGS-iOS=-mios-version-min=7.0 - CFLAGS-iphoneos.armv7=-fembed-bitcode - CFLAGS-iphoneos.armv7s=-fembed-bitcode - CFLAGS-iphoneos.arm64=-fembed-bitcode - +-CFLAGS-iphoneos.armv7=-fembed-bitcode +-CFLAGS-iphoneos.armv7s=-fembed-bitcode +-CFLAGS-iphoneos.arm64=-fembed-bitcode ++CFLAGS-iphoneos.armv7= ++CFLAGS-iphoneos.armv7s= ++CFLAGS-iphoneos.arm64= ++ +# iOS-simulator targets +TARGETS-iOS-simulator=iphonesimulator.x86_64 iphonesimulator.i386 iphonesimulator.arm64 +CFLAGS-iOS-simulator=-mios-simulator-version-min=7.0 -+ + # tvOS targets -TARGETS-tvOS=appletvsimulator.x86_64 appletvos.arm64 +TARGETS-tvOS=appletvos.arm64 CFLAGS-tvOS=-mtvos-version-min=9.0 - CFLAGS-appletvos.arm64=-fembed-bitcode +-CFLAGS-appletvos.arm64=-fembed-bitcode ++CFLAGS-appletvos.arm64= PYTHON_CONFIGURE-tvOS=ac_cv_func_sigaltstack=no +# tvOS-simulator targets @@ -56,8 +65,9 @@ index 695be54..4efe5e5 100644 -TARGETS-watchOS=watchsimulator.i386 watchos.armv7k +TARGETS-watchOS=watchos.armv7k watchos.arm64_32 CFLAGS-watchOS=-mwatchos-version-min=4.0 - CFLAGS-watchos.armv7k=-fembed-bitcode -+CFLAGS-watchos.arm64_32=-fembed-bitcode +-CFLAGS-watchos.armv7k=-fembed-bitcode ++CFLAGS-watchos.armv7k= ++CFLAGS-watchos.arm64_32= PYTHON_CONFIGURE-watchOS=ac_cv_func_sigaltstack=no +# watchOS-simulator targets @@ -80,3 +90,15 @@ index 695be54..4efe5e5 100644 else cd $$(OPENSSL_DIR-$1) && \ CC="$$(CC-$1)" \ +@@ -216,7 +235,10 @@ $$(OPENSSL_DIR-$1)/libssl.a $$(OPENSSL_DIR-$1)/libcrypto.a: $$(OPENSSL_DIR-$1)/M + CC="$$(CC-$1)" \ + CROSS_TOP="$$(dir $$(SDK_ROOT-$1)).." \ + CROSS_SDK="$$(notdir $$(SDK_ROOT-$1))" \ +- make all && make install ++ make build_libs && \ ++ mkdir -p "$(PROJECT_DIR)/build/$2/openssl/lib" && \ ++ cp libcrypto.a libssl.a "$(PROJECT_DIR)/build/$2/openssl/lib" ++ -cd $$(OPENSSL_DIR-$1) && make install_sw 2> /dev/null + + # Unpack BZip2 + $$(BZIP2_DIR-$1)/Makefile: downloads/bzip2-$(BZIP2_VERSION).tgz diff --git a/example/ios/build-openssl.sh b/example/ios/build-openssl.sh index 21ed07eed..eac937caa 100755 --- a/example/ios/build-openssl.sh +++ b/example/ios/build-openssl.sh @@ -26,12 +26,12 @@ do echo $platform cd Python-Apple-support #NB: -j will fail - make OpenSSL-$platform + make OpenSSL-$platform || exit 1 cd .. - rm -rf third_party/openssl/$platform - mkdir -p third_party/openssl/$platform/lib - cp ./Python-Apple-support/build/$platform/libcrypto.a third_party/openssl/$platform/lib/ - cp ./Python-Apple-support/build/$platform/libssl.a third_party/openssl/$platform/lib/ - cp -r ./Python-Apple-support/build/$platform/Support/OpenSSL/Headers/ third_party/openssl/$platform/include + rm -rf third_party/openssl/$platform || exit 1 + mkdir -p third_party/openssl/$platform/lib || exit 1 + cp ./Python-Apple-support/build/$platform/libcrypto.a third_party/openssl/$platform/lib/ || exit 1 + cp ./Python-Apple-support/build/$platform/libssl.a third_party/openssl/$platform/lib/ || exit 1 + cp -r ./Python-Apple-support/build/$platform/openssl/include/ third_party/openssl/$platform/include || exit 1 done done diff --git a/example/uwp/extension.vsixmanifest b/example/uwp/extension.vsixmanifest index e5deb134e..0b11245c8 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/sqlite/sqlite/sqlite3.c b/sqlite/sqlite/sqlite3.c index 87801250f..4fb5bc5e5 100644 --- a/sqlite/sqlite/sqlite3.c +++ b/sqlite/sqlite/sqlite3.c @@ -60743,17 +60743,24 @@ act_like_temp_file: pPager->memDb = (u8)memDb; pPager->readOnly = (u8)readOnly; assert( useJournal || pPager->tempFile ); - pPager->noSync = pPager->tempFile; + int level = SQLITE_DEFAULT_SYNCHRONOUS + 1; + pPager->noSync = pPager->tempFile || level==PAGER_SYNCHRONOUS_OFF; if( pPager->noSync ){ assert( pPager->fullSync==0 ); assert( pPager->extraSync==0 ); assert( pPager->syncFlags==0 ); assert( pPager->walSyncFlags==0 ); }else{ - pPager->fullSync = 1; - pPager->extraSync = 0; + pPager->fullSync = level>=PAGER_SYNCHRONOUS_FULL ?1:0; + pPager->extraSync = level==PAGER_SYNCHRONOUS_EXTRA ?1:0; pPager->syncFlags = SQLITE_SYNC_NORMAL; - pPager->walSyncFlags = SQLITE_SYNC_NORMAL | (SQLITE_SYNC_NORMAL<<2); + pPager->walSyncFlags = (pPager->syncFlags<<2); + if( pPager->fullSync ){ + pPager->walSyncFlags |= pPager->syncFlags; + } +#if SQLITE_DEFAULT_CKPTFULLFSYNC + pPager->walSyncFlags |= (SQLITE_SYNC_FULL<<2); +#endif } /* pPager->pFirst = 0; */ /* pPager->pFirstSynced = 0; */ diff --git a/td/generate/TlDocumentationGenerator.php b/td/generate/TlDocumentationGenerator.php index 7765c9e0d..f30ca382e 100644 --- a/td/generate/TlDocumentationGenerator.php +++ b/td/generate/TlDocumentationGenerator.php @@ -212,14 +212,14 @@ abstract class TlDocumentationGenerator $known_fields[$field_name] = $field_type; continue; } - $this->printError("Have no info about field `$field_name`"); + $this->printError("Have no documentation for field `$field_name`"); } foreach ($info as $name => $value) { if (!$value) { - $this->printError("info[$name] for $class_name is empty"); + $this->printError("Documentation for field $name of $class_name is empty"); } elseif (($value[0] < 'A' || $value[0] > 'Z') && ($value[0] < '0' || $value[0] > '9')) { - $this->printError("info[$name] for $class_name doesn't begins with capital letter"); + $this->printError("Documentation for field $name of $class_name doesn't begin with a capital letter"); } } @@ -235,7 +235,7 @@ abstract class TlDocumentationGenerator } foreach (array_diff_key($info, $known_fields) as $field_name => $field_info) { - $this->printError("Have info about unexisted field `$field_name`"); + $this->printError("Have info about nonexistent field `$field_name`"); } if (array_keys($info) !== array_keys($known_fields)) { diff --git a/td/generate/scheme/secret_api.tl b/td/generate/scheme/secret_api.tl index 35d6b6575..25231eb26 100644 --- a/td/generate/scheme/secret_api.tl +++ b/td/generate/scheme/secret_api.tl @@ -15,12 +15,12 @@ vector {t:Type} # [ t ] = Vector t; decryptedMessage8#1f814f1f random_id:long random_bytes:bytes message:string media:DecryptedMessageMedia = DecryptedMessage; decryptedMessageService8#aa48327d random_id:long random_bytes:bytes action:DecryptedMessageAction = DecryptedMessage; decryptedMessageMediaEmpty#89f5c4a = DecryptedMessageMedia; -decryptedMessageMediaPhoto23#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia; +decryptedMessageMediaPhoto8#32798a8c thumb:bytes thumb_w:int thumb_h:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia; decryptedMessageMediaVideo8#4cee6ef3 thumb:bytes thumb_w:int thumb_h:int duration:int w:int h:int size:int key:bytes iv:bytes = DecryptedMessageMedia; decryptedMessageMediaGeoPoint#35480a59 lat:double long:double = DecryptedMessageMedia; decryptedMessageMediaContact#588a0a97 phone_number:string first_name:string last_name:string user_id:int = DecryptedMessageMedia; decryptedMessageActionSetMessageTTL#a1733aec ttl_seconds:int = DecryptedMessageAction; -decryptedMessageMediaDocument23#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia; +decryptedMessageMediaDocument8#b095434b thumb:bytes thumb_w:int thumb_h:int file_name:string mime_type:string size:int key:bytes iv:bytes = DecryptedMessageMedia; decryptedMessageMediaAudio8#6080758f duration:int size:int key:bytes iv:bytes = DecryptedMessageMedia; decryptedMessageActionReadMessages#c4f40be random_ids:Vector = DecryptedMessageAction; decryptedMessageActionDeleteMessages#65614304 random_ids:Vector = DecryptedMessageAction; @@ -59,7 +59,7 @@ decryptedMessageActionNoop#a82fdd63 = DecryptedMessageAction; documentAttributeImageSize#6c37c15c w:int h:int = DocumentAttribute; documentAttributeAnimated#11b58939 = DocumentAttribute; documentAttributeSticker23#fb0a5727 = DocumentAttribute; -documentAttributeVideo#5910cccb duration:int w:int h:int = DocumentAttribute; +documentAttributeVideo23#5910cccb duration:int w:int h:int = DocumentAttribute; documentAttributeAudio23#51448e5 duration:int = DocumentAttribute; documentAttributeFilename#15590068 file_name:string = DocumentAttribute; photoSizeEmpty#e17e23c type:string = PhotoSize; @@ -105,7 +105,7 @@ decryptedMessageMediaWebPage#e50511d8 url:string = DecryptedMessageMedia; sendMessageRecordRoundAction#88f27fbc = SendMessageAction; sendMessageUploadRoundAction#bb718624 = SendMessageAction; -documentAttributeVideo66#ef02ce6 flags:# round_message:flags.0?true duration:int w:int h:int = DocumentAttribute; +documentAttributeVideo#ef02ce6 flags:# round_message:flags.0?true duration:int w:int h:int = DocumentAttribute; // layer 73 diff --git a/td/generate/scheme/td_api.tl b/td/generate/scheme/td_api.tl index cd555914e..59256eb93 100644 --- a/td/generate/scheme/td_api.tl +++ b/td/generate/scheme/td_api.tl @@ -66,7 +66,7 @@ textEntity offset:int32 length:int32 type:TextEntityType = TextEntity; textEntities entities:vector = TextEntities; //@description A text with some entities @text The text @entities Entities contained in the text. Entities can be nested, but must not mutually intersect with each other. -//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and to be contained in all other entities. All other entities can't contain each other +//-Pre, Code and PreCode entities can't contain other entities. Bold, Italic, Underline, Strikethrough, and Spoiler entities can contain and can be part of any other entities. All other entities can't contain each other formattedText text:string entities:vector = FormattedText; @@ -163,9 +163,6 @@ remoteFile id:string unique_id:string is_uploading_active:Bool is_uploading_comp //@remote Information about the remote copy of the file file id:int32 size:int53 expected_size:int53 local:localFile remote:remoteFile = File; -//@description Represents a list of files @files List of files -files files:vector = Files; - //@class InputFile @description Points to a file @@ -323,9 +320,9 @@ sticker set_id:int64 width:int32 height:int32 emoji:string format:StickerFormat video duration:int32 width:int32 height:int32 file_name:string mime_type:string has_stickers:Bool supports_streaming:Bool minithumbnail:minithumbnail thumbnail:thumbnail video:file = Video; //@description Describes a video note. The video must be equal in width and height, cropped to a circle, and stored in MPEG4 format @duration Duration of the video, in seconds; as defined by the sender -//@length Video width and height; as defined by the sender @minithumbnail Video minithumbnail; may be null -//@thumbnail Video thumbnail in JPEG format; as defined by the sender; may be null @video File containing the video -videoNote duration:int32 length:int32 minithumbnail:minithumbnail thumbnail:thumbnail video:file = VideoNote; +//@waveform A waveform representation of the video note's audio in 5-bit format; may be empty if unknown @length Video width and height; as defined by the sender @minithumbnail Video minithumbnail; may be null +//@thumbnail Video thumbnail in JPEG format; as defined by the sender; may be null @speech_recognition_result Result of speech recognition in the video note; may be null @video File containing the video +videoNote duration:int32 waveform:bytes length:int32 minithumbnail:minithumbnail thumbnail:thumbnail speech_recognition_result:SpeechRecognitionResult video:file = VideoNote; //@description Describes a voice note. The voice note must be encoded with the Opus codec, and stored inside an OGG container. Voice notes can have only a single audio channel //@duration Duration of the voice note, in seconds; as defined by the sender @waveform A waveform representation of the voice note in 5-bit format @@ -334,9 +331,11 @@ voiceNote duration:int32 waveform:bytes mime_type:string speech_recognition_resu //@description Describes an animated or custom representation of an emoji //@sticker Sticker for the emoji; may be null if yet unknown for a custom emoji. If the sticker is a custom emoji, it can have arbitrary format different from stickerFormatTgs +//@sticker_width Expected width of the sticker, which can be used if the sticker is null +//@sticker_height Expected height of the sticker, which can be used if the sticker is null //@fitzpatrick_type Emoji modifier fitzpatrick type; 0-6; 0 if none //@sound File containing the sound to be played when the sticker is clicked; may be null. The sound is encoded with the Opus codec, and stored inside an OGG container -animatedEmoji sticker:sticker fitzpatrick_type:int32 sound:file = AnimatedEmoji; +animatedEmoji sticker:sticker sticker_width:int32 sticker_height:int32 fitzpatrick_type:int32 sound:file = AnimatedEmoji; //@description Describes a user contact @phone_number Phone number of the user @first_name First name of the user; 1-255 characters in length @last_name Last name of the user @vcard Additional data about the user in a form of vCard; 0-2048 bytes in length @user_id Identifier of the user, if known; otherwise 0 contact phone_number:string first_name:string last_name:string vcard:string user_id:int53 = Contact; @@ -467,7 +466,8 @@ inputChatPhotoAnimation animation:InputFile main_frame_timestamp:double = InputC //@can_change_info True, if the user can change the chat title, photo, and other settings //@can_invite_users True, if the user can invite new users to the chat //@can_pin_messages True, if the user can pin messages -chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool = ChatPermissions; +//@can_manage_topics True, if the user can manage topics +chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_polls:Bool can_send_other_messages:Bool can_add_web_page_previews:Bool can_change_info:Bool can_invite_users:Bool can_pin_messages:Bool can_manage_topics:Bool = ChatPermissions; //@description Describes rights of the administrator //@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 supergroups and ignore slow mode. Implied by any other privilege; applicable to supergroups and channels only @@ -478,10 +478,11 @@ chatPermissions can_send_messages:Bool can_send_media_messages:Bool can_send_pol //@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; always true for channels //@can_pin_messages True, if the administrator can pin messages; applicable to basic groups and supergroups only +//@can_manage_topics True, if the administrator can manage topics; applicable to forum 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_video_chats True, if the administrator can manage video chats //@is_anonymous True, if the administrator isn't shown in the chat member list and sends messages anonymously; applicable to supergroups only -chatAdministratorRights 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_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; +chatAdministratorRights 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_manage_topics:Bool can_promote_members:Bool can_manage_video_chats:Bool is_anonymous:Bool = ChatAdministratorRights; //@description Describes an option for buying Telegram Premium to a user @@ -493,6 +494,7 @@ chatAdministratorRights can_manage_chat:Bool can_change_info:Bool can_post_messa //@payment_link An internal link to be opened for buying Telegram Premium to the user if store payment isn't possible; may be null if direct payment isn't available premiumPaymentOption currency:string amount:int53 discount_percentage:int32 month_count:int32 store_product_id:string payment_link:InternalLinkType = PremiumPaymentOption; + //@description Describes a custom emoji to be shown instead of the Telegram Premium badge @custom_emoji_id Identifier of the custom emoji in stickerFormatTgs format. If the custom emoji belongs to the sticker set GetOption("themed_emoji_statuses_sticker_set_id"), then it's color must be changed to the color of the Telegram Premium badge emojiStatus custom_emoji_id:int64 = EmojiStatus; @@ -500,11 +502,18 @@ emojiStatus custom_emoji_id:int64 = EmojiStatus; emojiStatuses emoji_statuses:vector = EmojiStatuses; +//@description Describes usernames assigned to a user, a supergroup, or a channel +//@active_usernames List of active usernames; the first one must be shown as the primary username. The order of active usernames can be changed with reorderActiveUsernames or reorderSupergroupActiveUsernames +//@disabled_usernames List of currently disabled usernames; the username can be activated with toggleUsernameIsActive/toggleSupergroupUsernameIsActive +//@editable_username The active username, which can be changed with setUsername/setSupergroupUsername +usernames active_usernames:vector disabled_usernames:vector editable_username:string = Usernames; + + //@description Represents a user //@id User identifier //@first_name First name of the user //@last_name Last name of the user -//@username Username of the user +//@usernames Usernames of the user; may be null //@phone_number Phone number of the user //@status Current online status of the user //@profile_photo Profile photo of the user; may be null @@ -521,7 +530,7 @@ emojiStatuses emoji_statuses:vector = EmojiStatuses; //@type Type of the user //@language_code IETF language tag of the user's language; only available to bots //@added_to_attachment_menu True, if the user added the current bot to attachment menu; only available to bots -user id:int53 first_name:string last_name:string username:string phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; +user id:int53 first_name:string last_name:string usernames:usernames phone_number:string status:UserStatus profile_photo:profilePhoto emoji_status:emojiStatus is_contact:Bool is_mutual_contact:Bool is_verified:Bool is_premium:Bool is_support:Bool restriction_reason:string is_scam:Bool is_fake:Bool have_access:Bool type:UserType language_code:string added_to_attachment_menu:Bool = User; //@description Contains information about a bot @@ -536,7 +545,7 @@ user id:int53 first_name:string last_name:string username:string phone_number:st botInfo share_text:string description:string photo:photo animation:animation menu_button:botMenuButton commands:vector default_group_administrator_rights:chatAdministratorRights default_channel_administrator_rights:chatAdministratorRights = BotInfo; //@description Contains full information about a user -//@photo User profile photo; may be null +//@photo User profile photo; may be null if empty or unknown. If non-null, then it is the same photo as in user.profile_photo and chat.photo //@is_blocked True, if the user is blocked by the current user //@can_be_called True, if the user can be called //@supports_video_calls True, if a video call can be created with the user @@ -719,7 +728,7 @@ chatJoinRequestsInfo total_count:int32 user_ids:vector = ChatJoinRequests basicGroup id:int53 member_count:int32 status:ChatMemberStatus is_active:Bool upgraded_to_supergroup_id:int53 = BasicGroup; //@description Contains full information about a basic group -//@photo Chat photo; may be null +//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo //@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 @@ -730,9 +739,9 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@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 //@id Supergroup or channel identifier -//@username Username of the supergroup or channel; empty for private supergroups or channels +//@usernames Usernames of the supergroup or channel; may be null //@date Point in time (Unix timestamp) when the current user joined, or the point in time when the supergroup or channel was created, in case the user is not a member -//@status Status of the current user in the supergroup or channel; custom title will be always empty +//@status Status of the current user in the supergroup or channel; custom title will always be empty //@member_count Number of members in the supergroup or channel; 0 if unknown. Currently, it is guaranteed to be known only if the supergroup or channel was received through searchPublicChats, searchChatsNearby, getInactiveSupergroupChats, getSuitableDiscussionChats, getGroupsInCommon, or getUserPrivacySettingRules //@has_linked_chat True, if the channel has a discussion group, or the supergroup is the designated discussion group for a channel //@has_location True, if the supergroup is connected to a location, i.e. the supergroup is a location-based supergroup @@ -742,14 +751,15 @@ basicGroupFullInfo photo:chatPhoto description:string creator_user_id:int53 memb //@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 the number of members +//@is_forum True, if the supergroup must be shown as a forum by default //@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 or channel as a scam //@is_fake True, if many users reported this supergroup or channel as a fake account -supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_verified:Bool restriction_reason:string is_scam:Bool is_fake:Bool = Supergroup; +supergroup id:int53 usernames:usernames date:int32 status:ChatMemberStatus member_count:int32 has_linked_chat:Bool has_location:Bool sign_messages:Bool join_to_send_messages:Bool join_by_request:Bool is_slow_mode_enabled:Bool is_channel:Bool is_broadcast_group:Bool is_forum: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 +//@photo Chat photo; may be null if empty or unknown. If non-null, then it is the same photo as in chat.photo //@param_description Supergroup or channel description //@member_count Number of members in the supergroup or channel; 0 if unknown //@administrator_count Number of privileged users in the supergroup or channel; 0 if unknown @@ -763,7 +773,7 @@ supergroup id:int53 username:string date:int32 status:ChatMemberStatus member_co //@can_set_sticker_set True, if the supergroup sticker set can be changed //@can_set_location True, if the supergroup location can be changed //@can_get_statistics True, if the supergroup or channel statistics are available -//@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 +//@is_all_history_available True, if new chat members will have access to old messages. In public, discussion, of forum groups and all channels, old messages are always available, so this option affects only private non-forum 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 Primary invite link for the chat; may be null. For chat administrators with can_invite_users right only @@ -809,6 +819,13 @@ messageSenderChat chat_id:int53 = MessageSender; messageSenders total_count:int32 senders:vector = MessageSenders; +//@description Represents a message sender, which can be used to send messages in a chat @sender Available message senders @needs_premium True, if Telegram Premium is needed to use the message sender +chatMessageSender sender:MessageSender needs_premium:Bool = ChatMessageSender; + +//@description Represents a list of message senders, which can be used to send messages in a chat @senders List of available message senders +chatMessageSenders senders:vector = ChatMessageSenders; + + //@class MessageForwardOrigin @description Contains information about the origin of a forwarded message //@description The message was originally sent by a known user @sender_user_id Identifier of the user that originally sent the message @@ -911,6 +928,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@can_report_reactions True, if reactions on the message can be reported through reportMessageReactions //@has_timestamped_media True, if media timestamp entities refers to a media in this message as opposed to a media in the replied message //@is_channel_post True, if the message is a channel post. All messages to channels are channel posts, all other messages are not channel posts +//@is_topic_message True, if the message is a forum topic message //@contains_unread_mention True, if the message contains an unread mention for the current user //@date Point in time (Unix timestamp) when the message was sent //@edit_date Point in time (Unix timestamp) when the message was last edited @@ -928,7 +946,7 @@ messageSendingStateFailed error_code:int32 error_message:string can_retry:Bool n //@restriction_reason If non-empty, contains a human-readable description of the reason why access to this message must be restricted //@content Content of the message //@reply_markup Reply markup for the message; may be null -message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; +message id:int53 sender_id:MessageSender chat_id:int53 sending_state:MessageSendingState scheduling_state:MessageSchedulingState is_outgoing:Bool is_pinned:Bool can_be_edited:Bool can_be_forwarded:Bool can_be_saved:Bool can_be_deleted_only_for_self:Bool can_be_deleted_for_all_users:Bool can_get_added_reactions:Bool can_get_statistics:Bool can_get_message_thread:Bool can_get_viewers:Bool can_get_media_timestamp_links:Bool can_report_reactions:Bool has_timestamped_media:Bool is_channel_post:Bool is_topic_message:Bool contains_unread_mention:Bool date:int32 edit_date:int32 forward_info:messageForwardInfo interaction_info:messageInteractionInfo unread_reactions:vector reply_in_chat_id:int53 reply_to_message_id:int53 message_thread_id:int53 ttl:int32 ttl_expires_in:double via_bot_user_id:int53 author_signature:string media_album_id:int64 restriction_reason:string content:MessageContent reply_markup:ReplyMarkup = Message; //@description Contains a list of messages @total_count Approximate total number of messages found @messages List of messages; messages may be null messages total_count:int32 messages:vector = Messages; @@ -954,9 +972,13 @@ messageCalendar total_count:int32 days:vector = MessageCalen //@is_recommended True, if the message needs to be labeled as "recommended" instead of "sponsored" //@sponsor_chat_id Sponsor chat identifier; 0 if the sponsor chat is accessible through an invite link //@sponsor_chat_info Information about the sponsor chat; may be null unless sponsor_chat_id == 0 +//@show_chat_photo True, if the sponsor's chat photo must be shown //@link An internal link to be opened when the sponsored message is clicked; may be null if the sponsor chat needs to be opened instead //@content Content of the message. Currently, can be only of the type messageText -sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo link:InternalLinkType content:MessageContent = SponsoredMessage; +sponsoredMessage message_id:int53 is_recommended:Bool sponsor_chat_id:int53 sponsor_chat_info:chatInviteLinkInfo show_chat_photo:Bool link:InternalLinkType content:MessageContent = SponsoredMessage; + +//@description Contains a list of sponsored messages @messages List of sponsored messages @messages_between The minimum number of messages between shown sponsored messages, or 0 if only one sponsored message must be shown after all ordinary messages +sponsoredMessages messages:vector messages_between:int32 = SponsoredMessages; //@description Describes a file added to file download list @@ -1156,7 +1178,7 @@ chatsNearby users_nearby:vector supergroups_nearby:vector draft_message:draftMessage = MessageThreadInfo; +//@description Describes a forum topic icon @color Color of the topic icon in RGB format @custom_emoji_id Unique identifier of the custom emoji shown on the topic icon; 0 if none +forumTopicIcon color:int32 custom_emoji_id:int64 = ForumTopicIcon; + +//@description Contains basic information about a forum topic +//@message_thread_id Message thread identifier of the topic +//@name Name of the topic +//@icon Icon of the topic +//@creation_date Date the topic was created +//@creator_id Identifier of the creator of the topic +//@is_outgoing True, if the topic was created by the current user +//@is_closed True, if the topic is closed +forumTopicInfo message_thread_id:int53 name:string icon:forumTopicIcon creation_date:int32 creator_id:MessageSender is_outgoing:Bool is_closed:Bool = ForumTopicInfo; + +//@description Describes a forum topic +//@info Basic information about the topic +//@last_message Last message in the topic; may be null +//@is_pinned True, if the topic is pinned in the topic list +//@unread_count Number of unread messages in the topic +//@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 topic +//@unread_reaction_count Number of messages with unread reactions in the topic +//@notification_settings Notification settings for the topic +//@draft_message A draft of a message in the topic; may be null +forumTopic info:forumTopicInfo last_message:message is_pinned:Bool unread_count:int32 last_read_inbox_message_id:int53 last_read_outbox_message_id:int53 unread_mention_count:int32 unread_reaction_count:int32 notification_settings:chatNotificationSettings draft_message:draftMessage = ForumTopic; + + //@class RichText @description Describes a text object inside an instant-view web page //@description A plain text @text Text @@ -1648,7 +1697,7 @@ paymentResult success:Bool verification_url:string = PaymentResult; paymentReceipt title:string description:formattedText photo:photo date:int32 seller_bot_user_id:int53 payment_provider_user_id:int53 invoice:invoice order_info:orderInfo shipping_option:shippingOption credentials_title:string tip_amount:int53 = PaymentReceipt; -//@class InputInvoice @description Describe an invoice to process +//@class InputInvoice @description Describes an invoice to process //@description An invoice from a message of the type messageInvoice @chat_id Chat identifier of the message @message_id Message identifier inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice; @@ -1657,6 +1706,27 @@ inputInvoiceMessage chat_id:int53 message_id:int53 = InputInvoice; inputInvoiceName name:string = InputInvoice; +//@class MessageExtendedMedia @description Describes a media, which is attached to an invoice + +//@description The media is hidden until the invoice is paid +//@width Media width; 0 if unknown +//@height Media height; 0 if unknown +//@duration Media duration; 0 if unknown +//@minithumbnail Media minithumbnail; may be null +//@caption Media caption +messageExtendedMediaPreview width:int32 height:int32 duration:int32 minithumbnail:minithumbnail caption:formattedText = MessageExtendedMedia; + +//@description The media is a photo @photo The photo @caption Photo caption +messageExtendedMediaPhoto photo:photo caption:formattedText = MessageExtendedMedia; + +//@description The media is a video @video The video @caption Photo caption +messageExtendedMediaVideo video:video caption:formattedText = MessageExtendedMedia; + +//@description The media is unuspported @caption Media caption +messageExtendedMediaUnsupported caption:formattedText = MessageExtendedMedia; + + + //@description File with the date it was uploaded @file The file @date Point in time (Unix timestamp) when the file was uploaded datedFile file:file date:int32 = DatedFile; @@ -1974,7 +2044,8 @@ messagePoll poll:poll = MessageContent; //@description A message with an invoice from a bot @title Product title @param_description Product description @photo Product photo; may be null @currency Currency for the product price @total_amount Product total price in the smallest units of the currency //@start_parameter Unique invoice bot start_parameter. To share an invoice use the URL https://t.me/{bot_username}?start={start_parameter} @is_test True, if the invoice is a test invoice //@need_shipping_address True, if the shipping address must be specified @receipt_message_id The identifier of the message with the receipt, after the product has been purchased -messageInvoice title:string description:formattedText photo:photo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 = MessageContent; +//@extended_media Extended media attached to the invoice; may be null +messageInvoice title:string description:formattedText photo:photo currency:string total_amount:int53 start_parameter:string is_test:Bool need_shipping_address:Bool receipt_message_id:int53 extended_media:MessageExtendedMedia = MessageContent; //@description A message with information about an ended call @is_video True, if the call was a video call @discard_reason Reason why the call was discarded @duration Call duration, in seconds messageCall is_video:Bool discard_reason:CallDiscardReason duration:int32 = MessageContent; @@ -2036,13 +2107,22 @@ messageChatSetTheme theme_name:string = MessageContent; //@description The TTL (Time To Live) setting for messages in the chat has been changed @ttl New message TTL messageChatSetTtl ttl:int32 = MessageContent; +//@description A forum topic has been created @name Name of the topic @icon Icon of the topic +messageForumTopicCreated name:string icon:forumTopicIcon = MessageContent; + +//@description A forum topic has been edited @name If non-empty, the new name of the topic @edit_icon_custom_emoji_id True, if icon's custom_emoji_id is changed @icon_custom_emoji_id New unique identifier of the custom emoji shown on the topic icon; 0 if none. Must be ignored if edit_icon_custom_emoji_id is false +messageForumTopicEdited name:string edit_icon_custom_emoji_id:Bool icon_custom_emoji_id:int64 = MessageContent; + +//@description A forum topic has been closed or opened @is_closed True if the topic was closed or reopened +messageForumTopicIsClosedToggled is_closed:Bool = MessageContent; + //@description A non-standard action has happened in the chat @text Message text to be shown in the chat messageCustomServiceAction text:string = MessageContent; //@description A new high score was achieved in a game @game_message_id Identifier of the message with the game, can be an identifier of a deleted message @game_id Identifier of the game; may be different from the games presented in the message with the game @score New score messageGameScore game_message_id:int53 game_id:int64 score:int32 = MessageContent; -//@description A payment has been completed @invoice_chat_id Identifier of the chat, containing the corresponding invoice message; 0 if unknown @invoice_message_id Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message +//@description A payment has been completed @invoice_chat_id Identifier of the chat, containing the corresponding invoice message @invoice_message_id Identifier of the message with the corresponding invoice; can be 0 or an identifier of a deleted message //@currency Currency for the price of the product @total_amount Total price for the product, in the smallest units of the currency //@is_recurring True, if this is a recurring payment @is_first_recurring True, if this is the first recurring payment @invoice_name Name of the invoice; may be empty if unknown messagePaymentSuccessful invoice_chat_id:int53 invoice_message_id:int53 currency:string total_amount:int53 is_recurring:Bool is_first_recurring:Bool invoice_name:string = MessageContent; @@ -2084,7 +2164,7 @@ messageUnsupported = MessageContent; //@class TextEntityType @description Represents a part of the text which must be formatted differently -//@description A mention of a user by their username +//@description A mention of a user, a supergroup, or a channel by their username textEntityTypeMention = TextEntityType; //@description A hashtag text, beginning with "#" @@ -2190,7 +2270,7 @@ inputMessageAnimation animation:InputFile thumbnail:inputThumbnail added_sticker //@performer Performer of the audio; 0-64 characters, may be replaced by the server @caption Audio caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters inputMessageAudio audio:InputFile album_cover_thumbnail:inputThumbnail duration:int32 title:string performer:string caption:formattedText = InputMessageContent; -//@description A document message (general file) @document Document to be sent @thumbnail Document thumbnail; pass null to skip thumbnail uploading @disable_content_type_detection If true, automatic file type detection will be disabled and the document will be always sent as file. Always true for files sent to secret chats @caption Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters +//@description A document message (general file) @document Document to be sent @thumbnail Document thumbnail; pass null to skip thumbnail uploading @disable_content_type_detection If true, automatic file type detection will be disabled and the document will always be sent as file. Always true for files sent to secret chats @caption Document caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters inputMessageDocument document:InputFile thumbnail:inputThumbnail disable_content_type_detection:Bool caption:formattedText = InputMessageContent; //@description A photo message @photo Photo to send. The photo must be at most 10 MB in size. The photo's width and height must not exceed 10000 in total. Width and height ratio must be at most 20 @thumbnail Photo thumbnail to be sent; pass null to skip thumbnail uploading. The thumbnail is sent to the other party only in secret chats @added_sticker_file_ids File identifiers of the stickers added to the photo, if applicable @width Photo width @height Photo height @caption Photo caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters @@ -2208,7 +2288,7 @@ inputMessageVideo video:InputFile thumbnail:inputThumbnail added_sticker_file_id //@description A video note message @video_note Video note to be sent @thumbnail Video thumbnail; pass null to skip thumbnail uploading @duration Duration of the video, in seconds @length Video width and height; must be positive and not greater than 640 inputMessageVideoNote video_note:InputFile thumbnail:inputThumbnail duration:int32 length:int32 = InputMessageContent; -//@description A voice note message @voice_note Voice note to be sent @duration Duration of the voice note, in seconds @waveform Waveform representation of the voice note, in 5-bit format @caption Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters +//@description A voice note message @voice_note Voice note to be sent @duration Duration of the voice note, in seconds @waveform Waveform representation of the voice note in 5-bit format @caption Voice note caption; pass null to use an empty caption; 0-GetOption("message_caption_length_max") characters inputMessageVoiceNote voice_note:InputFile duration:int32 waveform:bytes caption:formattedText = InputMessageContent; //@description A message with a location @location Location to be sent @live_period Period for which the location can be updated, in seconds; must be between 60 and 86400 for a live location and 0 otherwise @@ -2232,7 +2312,8 @@ inputMessageGame bot_user_id:int53 game_short_name:string = InputMessageContent; //@photo_url Product photo URL; optional @photo_size Product photo size @photo_width Product photo width @photo_height Product photo height //@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 deep link parameter for the generation of this invoice. If empty, it would be possible to pay directly from forwards of the invoice message -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; +//@extended_media_content The content of extended media attached to the invoice. The content of the message to be sent. Must be one of the following types: inputMessagePhoto, inputMessageVideo +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 extended_media_content:InputMessageContent = 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 //@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 @@ -2901,9 +2982,12 @@ chatEventStickerSetChanged old_sticker_set_id:int64 new_sticker_set_id:int64 = C //@description The chat title was changed @old_title Previous chat title @new_title New chat title chatEventTitleChanged old_title:string new_title:string = ChatEventAction; -//@description The chat username was changed @old_username Previous chat username @new_username New chat username +//@description The chat editable username was changed @old_username Previous chat username @new_username New chat username chatEventUsernameChanged old_username:string new_username:string = ChatEventAction; +//@description The chat active usernames were changed @old_usernames Previous list of active usernames @new_usernames New list of active usernames +chatEventActiveUsernamesChanged old_usernames:vector new_usernames:vector = ChatEventAction; + //@description The has_protected_content setting of a channel was toggled @has_protected_content New value of has_protected_content chatEventHasProtectedContentToggled has_protected_content:Bool = ChatEventAction; @@ -2940,6 +3024,24 @@ chatEventVideoChatParticipantIsMutedToggled participant_id:MessageSender is_mute //@description A video chat participant volume level was changed @participant_id Identifier of the affected group call participant @volume_level New value of volume_level; 1-20000 in hundreds of percents chatEventVideoChatParticipantVolumeLevelChanged participant_id:MessageSender volume_level:int32 = ChatEventAction; +//@description The is_forum setting of a channel was toggled @is_forum New value of is_forum +chatEventIsForumToggled is_forum:Bool = ChatEventAction; + +//@description A new forum topic was created @topic_info Information about the topic +chatEventForumTopicCreated topic_info:forumTopicInfo = ChatEventAction; + +//@description A forum topic was edited @old_topic_info Old information about the topic @new_topic_info New information about the topic +chatEventForumTopicEdited old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction; + +//@description A forum topic was closed or reopened @topic_info New information about the topic +chatEventForumTopicToggleIsClosed topic_info:forumTopicInfo = ChatEventAction; + +//@description A forum topic was deleted @topic_info Information about the topic +chatEventForumTopicDeleted topic_info:forumTopicInfo = ChatEventAction; + +//@description A pinned forum topic was changed @old_topic_info Information about the old pinned topic; may be null @new_topic_info Information about the new pinned topic; may be null +chatEventForumTopicPinned old_topic_info:forumTopicInfo new_topic_info:forumTopicInfo = ChatEventAction; + //@description Represents a chat event @id Chat event identifier @date Point in time (Unix timestamp) when the event happened @member_id Identifier of the user or chat who performed the action @action The action chatEvent id:int64 date:int32 member_id:MessageSender action:ChatEventAction = ChatEvent; @@ -2959,7 +3061,8 @@ chatEvents events:vector = ChatEvents; //@setting_changes True, if changes in chat settings need to be returned //@invite_link_changes True, if changes to invite links need to be returned //@video_chat_changes True, if video chat actions need to 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 invite_link_changes:Bool video_chat_changes:Bool = ChatEventLogFilters; +//@forum_changes True, if forum-related actions need to 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 invite_link_changes:Bool video_chat_changes:Bool forum_changes:Bool = ChatEventLogFilters; //@class LanguagePackStringValue @description Represents the value of a string in a language pack @@ -3067,6 +3170,9 @@ premiumFeatureEmojiStatus = PremiumFeature; //@description Profile photo animation on message and chat screens premiumFeatureAnimatedProfilePhoto = PremiumFeature; +//@description The ability to set a custom emoji as a forum topic icon +premiumFeatureForumTopicIcon = PremiumFeature; + //@description Allowed to set a premium appllication icons premiumFeatureAppIcons = PremiumFeature; @@ -3160,7 +3266,7 @@ pushReceiverId id:int64 = PushReceiverId; backgroundFillSolid color:int32 = BackgroundFill; //@description Describes a gradient fill of a background @top_color A top color of the background in the RGB24 format @bottom_color A bottom color of the background in the RGB24 format -//@rotation_angle Clockwise rotation angle of the gradient, in degrees; 0-359. Must be always divisible by 45 +//@rotation_angle Clockwise rotation angle of the gradient, in degrees; 0-359. Must always be divisible by 45 backgroundFillGradient top_color:int32 bottom_color:int32 rotation_angle:int32 = BackgroundFill; //@description Describes a freeform gradient fill of a background @colors A list of 3 or 4 colors of the freeform gradients in the RGB24 format @@ -3739,8 +3845,8 @@ internalLinkTypeFilterSettings = InternalLinkType; //@bot_username Username of the bot that owns the game @game_short_name Short name of the game internalLinkTypeGame bot_username:string game_short_name:string = InternalLinkType; -//@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link @url URL to be passed to getWebPageInstantView -internalLinkTypeInstantView url:string = InternalLinkType; +//@description The link must be opened in an Instant View. Call getWebPageInstantView with the given URL to process the link @url URL to be passed to getWebPageInstantView @fallback_url An URL to open if getWebPageInstantView fails +internalLinkTypeInstantView url:string fallback_url:string = InternalLinkType; //@description The link is a link to an invoice. Call getPaymentForm with the given invoice name to process the link @invoice_name Name of the invoice internalLinkTypeInvoice invoice_name:string = InternalLinkType; @@ -3820,11 +3926,11 @@ messageLink link:string is_public:Bool = MessageLink; //@description Contains information about a link to a message in a chat //@is_public True, if the link is a public link for a message in a chat //@chat_id If found, identifier of the chat to which the message belongs, 0 otherwise +//@message_thread_id If found, identifier of the message thread in which to open the message, or which to open in case of a missing message //@message If found, the linked message; may be null //@media_timestamp Timestamp from which the video/audio/video note/voice note playing must start, in seconds; 0 if not specified. The media can be in the message content or in its web page preview //@for_album True, if the whole media album to which the message belongs is linked -//@for_comment True, if the message is linked as a channel post comment or from a message thread -messageLinkInfo is_public:Bool chat_id:int53 message:message media_timestamp:int32 for_album:Bool for_comment:Bool = MessageLinkInfo; +messageLinkInfo is_public:Bool chat_id:int53 message_thread_id:int53 message:message media_timestamp:int32 for_album:Bool = MessageLinkInfo; //@description Contains a part of a file @data File bytes @@ -4352,6 +4458,9 @@ updateChatFilters chat_filters:vector main_chat_list_position:in //@description The number of online group members has changed. This update with non-zero number of online group members is sent only for currently opened chats. There is no guarantee that it will be sent just after the number of online users has changed @chat_id Identifier of the chat @online_member_count New number of online members in the chat, or 0 if unknown updateChatOnlineMemberCount chat_id:int53 online_member_count:int32 = Update; +//@description Basic information about a topic in a forum chat was changed @chat_id Chat identifier @info New information about the topic +updateForumTopicInfo chat_id:int53 info:forumTopicInfo = Update; + //@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; @@ -4917,11 +5026,12 @@ getMessageThreadHistory chat_id:int53 message_id:int53 from_message_id:int53 off //@chat_id Chat identifier @remove_from_chat_list Pass true to remove the chat from all chat lists @revoke Pass true 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. For group chats this will release the username and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat @chat_id Chat identifier +//@description Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be applied to the chat @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 must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit +//-(searchSecretMessages must be used instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit. +//-A combination of query, sender_id, filter and message_thread_id search criteria is expected to be supported, only if it is required for Telegram official application implementation //@chat_id Identifier of the chat in which to search messages //@query Query to search for //@sender_id Identifier of the sender of messages to search for; pass null to search for messages from any sender. Not supported in secret chats @@ -4993,6 +5103,12 @@ getChatMessageCalendar chat_id:int53 filter:SearchMessagesFilter from_message_id //@description Returns approximate number of messages of the specified type in the chat @chat_id Identifier of the chat in which to count messages @filter Filter for message content; searchMessagesFilterEmpty is unsupported in this function @return_local Pass true to get the number of messages without sending network requests, or -1 if the number of messages is unknown locally getChatMessageCount chat_id:int53 filter:SearchMessagesFilter return_local:Bool = Count; +//@description Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat. Cannot be used in secret chats +//@chat_id Identifier of the chat in which to find message position @message_id Message identifier +//@filter Filter for message content; searchMessagesFilterEmpty, searchMessagesFilterUnreadMention, searchMessagesFilterUnreadReaction, and searchMessagesFilterFailedToSend are unsupported in this function +//@message_thread_id If not 0, only messages in the specified thread will be considered; supergroups only +getChatMessagePosition chat_id:int53 message_id:int53 filter:SearchMessagesFilter message_thread_id:int53 = Count; + //@description Returns all scheduled messages in a chat. The messages are returned in a reverse chronological order (i.e., in order of decreasing message_id) @chat_id Chat identifier getChatScheduledMessages chat_id:int53 = Messages; @@ -5003,8 +5119,8 @@ getChatScheduledMessages chat_id:int53 = Messages; //@limit The maximum number of messages to be returned; must be positive and can't be greater than 100. For optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit getMessagePublicForwards chat_id:int53 message_id:int53 offset:string limit:int32 = FoundMessages; -//@description Returns sponsored message to be shown in a chat; for channel chats only. Returns a 404 error if there is no sponsored message in the chat @chat_id Identifier of the chat -getChatSponsoredMessage chat_id:int53 = SponsoredMessage; +//@description Returns sponsored messages to be shown in a chat; for channel chats only @chat_id Identifier of the chat +getChatSponsoredMessages chat_id:int53 = SponsoredMessages; //@description Removes an active notification from notification list. Needs to be called only if the notification is removed by the current user @notification_group_id Identifier of notification group to which the notification belongs @notification_id Identifier of removed notification @@ -5019,8 +5135,8 @@ removeNotificationGroup notification_group_id:int32 max_notification_id:int32 = //@message_id Identifier of the message //@media_timestamp If not 0, timestamp from which the video/audio/video note/voice note playing must start, in seconds. The media can be in the message content or in its web page preview //@for_album Pass true to create a link for the whole media album -//@for_comment Pass true to create a link to the message as a channel post comment, or from a message thread -getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool for_comment:Bool = MessageLink; +//@in_message_thread Pass true to create a link to the message as a channel post comment, in a message thread, or a forum topic +getMessageLink chat_id:int53 message_id:int53 media_timestamp:int32 for_album:Bool in_message_thread:Bool = MessageLink; //@description Returns an HTML code for embedding the message. Available only for messages in supergroups and channels with a username //@chat_id Identifier of the chat to which the message belongs @@ -5038,17 +5154,17 @@ getMessageLinkInfo url:string = MessageLinkInfo; //@to_language_code A two-letter ISO 639-1 language code of the language to which the message is translated translateText text:string from_language_code:string to_language_code:string = Text; -//@description Recognizes speech in a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if the voice note is too long to be recognized +//@description Recognizes speech in a video note or a voice note message. The message must be successfully sent and must not be scheduled. May return an error with a message "MSG_VOICE_TOO_LONG" if media duration is too big to be recognized //@chat_id Identifier of the chat to which the message belongs //@message_id Identifier of the message recognizeSpeech chat_id:int53 message_id:int53 = Ok; -//@description Rates recognized speech in a voice note message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message @is_good Pass true if the speech recognition is good +//@description Rates recognized speech in a video note or a voice note message @chat_id Identifier of the chat to which the message belongs @message_id Identifier of the message @is_good Pass true if the speech recognition is good rateSpeechRecognition chat_id:int53 message_id:int53 is_good:Bool = Ok; //@description Returns list of message sender identifiers, which can be used to send messages in a chat @chat_id Chat identifier -getChatAvailableMessageSenders chat_id:int53 = MessageSenders; +getChatAvailableMessageSenders chat_id:int53 = ChatMessageSenders; //@description Selects a message sender to send messages in a chat @chat_id Chat identifier @message_sender_id New message sender for the chat setChatMessageSender chat_id:int53 message_sender_id:MessageSender = Ok; @@ -5087,13 +5203,14 @@ sendInlineQueryResultMessage chat_id:int53 message_thread_id:int53 reply_to_mess //@description Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in message_ids. If a message can't be forwarded, null will be returned instead of the message //@chat_id Identifier of the chat to which to forward messages +//@message_thread_id If not 0, a message thread identifier in which the message will be sent; for forum threads only //@from_chat_id Identifier of the chat from which to forward messages //@message_ids Identifiers of the messages to forward. Message identifiers must be in a strictly increasing order. At most 100 messages can be forwarded simultaneously //@options Options to be used to send the messages; pass null to use default options //@send_copy Pass true to copy content of the messages without reference to the original sender. Always true if the messages are forwarded to a secret chat or are local //@remove_caption Pass true to remove media captions of message copies. Ignored if send_copy is false //@only_preview Pass true to get fake messages instead of actually forwarding them -forwardMessages chat_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; +forwardMessages chat_id:int53 message_thread_id:int53 from_chat_id:int53 message_ids:vector options:messageSendOptions send_copy:Bool remove_caption:Bool only_preview:Bool = Messages; //@description Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. //-If a message is re-sent, the corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers passed in message_ids. If a message can't be re-sent, null will be returned instead of the message @@ -5197,11 +5314,39 @@ editInlineMessageReplyMarkup inline_message_id:string reply_markup:ReplyMarkup = editMessageSchedulingState chat_id:int53 message_id:int53 scheduling_state:MessageSchedulingState = Ok; +//@description Returns list of custom emojis, which can be used as forum topic icon by all users +getForumTopicDefaultIcons = Stickers; + +//@description Creates a topic in a forum supergroup chat; requires can_manage_topics rights in the supergroup +//@chat_id Identifier of the chat +//@name Name of the topic; 1-128 characters +//@icon Icon of the topic. Icon color must be one of 0x6FB9F0, 0xFFD67E, 0xCB86DB, 0x8EEE98, 0xFF93B2, or 0xFB6F5F. Telegram Premium users can use any custom emoji as topic icon, other users can use only a custom emoji returned by getForumTopicDefaultIcons +createForumTopic chat_id:int53 name:string icon:forumTopicIcon = ForumTopicInfo; + +//@description Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup unless the user is creator of the topic +//@chat_id Identifier of the chat +//@message_thread_id Message thread identifier of the forum topic +//@name New name of the topic; 1-128 characters +//@icon_custom_emoji_id Identifier of the new custom emoji for topic icon. Telegram Premium users can use any custom emoji, other users can use only a custom emoji returned by getForumTopicDefaultIcons +editForumTopic chat_id:int53 message_thread_id:int53 name:string icon_custom_emoji_id:int64 = Ok; + +//@description Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator rights in the supergroup unless the user is creator of the topic +//@chat_id Identifier of the chat +//@message_thread_id Message thread identifier of the forum topic +//@is_closed Pass true to close the topic; pass false to reopen it +toggleForumTopicIsClosed chat_id:int53 message_thread_id:int53 is_closed:Bool = Ok; + +//@description Deletes all messages in a forum topic; requires can_delete_messages administrator rights in the supergroup unless the user is creator of the topic, the topic has no messages from other users and has at most 11 messages +//@chat_id Identifier of the chat +//@message_thread_id Message thread identifier of the forum topic +deleteForumTopic chat_id:int53 message_thread_id:int53 = Ok; + + //@description Returns information about a emoji reaction. Returns a 404 error if the reaction is not found @emoji Text representation of the reaction getEmojiReaction emoji:string = EmojiReaction; -//@description Returns TGS files with generic animations for custom emoji reactions -getCustomEmojiReactionAnimations = Files; +//@description Returns TGS stickers with generic animations for custom emoji reactions +getCustomEmojiReactionAnimations = Stickers; //@description Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions, updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message //@chat_id Identifier of the chat to which the message belongs @@ -5238,10 +5383,10 @@ getMessageAddedReactions chat_id:int53 message_id:int53 reaction_type:ReactionTy setDefaultReactionType reaction_type:ReactionType = Ok; -//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) contained in the text. Can be called synchronously @text The text in which to look for entites +//@description Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in the text. Can be called synchronously @text The text in which to look for entites getTextEntities text:string = TextEntities; -//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities contained in the text. Can be called synchronously @text The text to parse @parse_mode Text parse mode +//@description Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, Code, Pre, PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously @text The text to parse @parse_mode Text parse mode parseTextEntities text:string parse_mode:TextParseMode = FormattedText; //@description Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously @@ -5347,8 +5492,9 @@ sendWebAppData bot_user_id:int53 button_text:string data:string = Ok; //@url The URL from an inlineKeyboardButtonTypeWebApp button, a botMenuButton button, or an internalLinkTypeAttachmentMenuBot link, or an empty string otherwise //@theme Preferred Web App theme; pass null to use the default theme //@application_name Short name of the application; 0-64 English letters, digits, and underscores +//@message_thread_id If not 0, a message thread identifier in which the message will be sent //@reply_to_message_id Identifier of the replied message for the message sent by the Web App; 0 if none -openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string reply_to_message_id:int53 = WebAppInfo; +openWebApp chat_id:int53 bot_user_id:int53 url:string theme:themeParameters application_name:string message_thread_id:int53 reply_to_message_id:int53 = WebAppInfo; //@description Informs TDLib that a previously opened Web App was closed @web_app_launch_id Identifier of Web App launch, received from openWebApp closeWebApp web_app_launch_id:int64 = Ok; @@ -5432,9 +5578,15 @@ getExternalLink link:string allow_write_access:Bool = HttpUrl; //@description Marks all mentions in a chat as read @chat_id Chat identifier readAllChatMentions chat_id:int53 = Ok; -//@description Marks all reactions in a chat as read @chat_id Chat identifier +//@description Marks all mentions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which mentions are marked as read +readAllMessageThreadMentions chat_id:int53 message_thread_id:int53 = Ok; + +//@description Marks all reactions in a chat or a forum topic as read @chat_id Chat identifier readAllChatReactions chat_id:int53 = Ok; +//@description Marks all reactions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which reactions are marked as read +readAllMessageThreadReactions chat_id:int53 message_thread_id:int53 = Ok; + //@description Returns an existing chat corresponding to a given user @user_id User identifier @force Pass true to create the chat without a network request. In this case all information about the chat except its type, title and photo can be incorrect createPrivateChat user_id:int53 force:Bool = Chat; @@ -5564,6 +5716,10 @@ unpinChatMessage chat_id:int53 message_id:int53 = Ok; //@description Removes all pinned messages from a chat; requires can_pin_messages rights in the group or can_edit_messages rights in the channel @chat_id Identifier of the chat unpinAllChatMessages chat_id:int53 = Ok; +//@description Removes all pinned messages from a forum topic; requires can_pin_messages rights in the supergroup @chat_id Identifier of the chat +//@message_thread_id Message thread identifier in which messages will be unpinned +unpinAllMessageThreadMessages chat_id:int53 message_thread_id:int53 = Ok; + //@description Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return an error with a message "INVITE_REQUEST_SENT" if only a join request was created @chat_id Chat identifier joinChat chat_id:int53 = Ok; @@ -5600,7 +5756,7 @@ transferChatOwnership chat_id:int53 user_id:int53 password:string = Ok; //@description Returns information about a single member of a chat @chat_id Chat identifier @member_id Member identifier getChatMember chat_id:int53 member_id:MessageSender = ChatMember; -//@description Searches for a specified query in the first name, last name and username of the members of a specified chat. Requires administrator rights in channels +//@description Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires administrator rights in channels //@chat_id Chat identifier //@query Query to search for //@limit The maximum number of users to be returned; up to 200 @@ -6045,12 +6201,12 @@ sharePhoneNumber user_id:int53 = Ok; getUserProfilePhotos user_id:int53 offset:int32 limit:int32 = ChatPhotos; -//@description Returns stickers from the installed sticker sets that correspond to a given emoji. If the emoji is non-empty, then favorite, recently used or trending stickers may also be returned -//@sticker_type Type of the sticker sets to return -//@emoji String representation of emoji. If empty, returns all known installed stickers +//@description Returns stickers from the installed sticker sets that correspond to a given emoji or can be found by sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be returned +//@sticker_type Type of the stickers to return +//@query Search query; an emoji or a keyword prefix. If empty, returns all known installed stickers //@limit The maximum number of stickers to be returned -//@chat_id Chat identifier for which to return stickers. Available custom emoji may be different for different chats -getStickers sticker_type:StickerType emoji:string limit:int32 chat_id:int53 = Stickers; +//@chat_id Chat identifier for which to return stickers. Available custom emoji stickers may be different for different chats +getStickers sticker_type:StickerType query:string limit:int32 chat_id:int53 = Stickers; //@description Searches for stickers from public sticker sets that correspond to a given emoji @emoji String representation of emoji; must be non-empty @limit The maximum number of stickers to be returned; 0-100 searchStickers emoji:string limit:int32 = Stickers; @@ -6174,9 +6330,15 @@ setName first_name:string last_name:string = Ok; //@description Changes the bio of the current user @bio The new value of the user bio; 0-GetOption("bio_length_max") characters without line feeds setBio bio:string = Ok; -//@description Changes the username of the current user @username The new value of the username. Use an empty string to remove the username +//@description Changes the editable username of the current user @username The new value of the username. Use an empty string to remove the username. The username can't be completely removed if there is another active or disabled username setUsername username:string = Ok; +//@description Changes active state for a username of the current user. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached @username The username to change @is_active Pass true to activate the username; pass false to disable it +toggleUsernameIsActive username:string is_active:Bool = Ok; + +//@description Changes order of active usernames of the current user @usernames The new order of active usernames. All currently active usernames must be specified +reorderActiveUsernames usernames:vector = Ok; + //@description Changes the emoji status of the current user; for Telegram Premium users only //@emoji_status New emoji status; pass null to switch to the default badge //@duration Duration of the status, in seconds; pass 0 to keep the status active until it will be changed manually @@ -6256,9 +6418,18 @@ disconnectWebsite website_id:int64 = Ok; 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 +//@description Changes the editable 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. The username can't be completely removed if there is another active or disabled username setSupergroupUsername supergroup_id:int53 username:string = Ok; +//@description Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel. The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached @supergroup_id Identifier of the supergroup or channel @username The username to change @is_active Pass true to activate the username; pass false to disable it +toggleSupergroupUsernameIsActive supergroup_id:int53 username:string is_active:Bool = Ok; + +//@description Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel +disableAllSupergroupUsernames supergroup_id:int53 = Ok; + +//@description Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel @supergroup_id Identifier of the supergroup or channel @usernames The new order of active usernames. All currently active usernames must be specified +reorderSupergroupActiveUsernames supergroup_id:int53 usernames:vector = Ok; + //@description Changes the sticker set of a supergroup; requires can_change_info administrator right @supergroup_id Identifier of the supergroup @sticker_set_id New value of the supergroup sticker set identifier. Use 0 to remove the supergroup sticker set setSupergroupStickerSet supergroup_id:int53 sticker_set_id:int64 = Ok; @@ -6274,6 +6445,9 @@ toggleSupergroupJoinByRequest supergroup_id:int53 join_by_request:Bool = Ok; //@description Toggles whether the message history of a supergroup is available to new members; requires can_change_info administrator right @supergroup_id The identifier of the supergroup @is_all_history_available The new value of is_all_history_available toggleSupergroupIsAllHistoryAvailable supergroup_id:int53 is_all_history_available:Bool = Ok; +//@description Toggles whether the supergroup is a forum; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup @is_forum New value of is_forum. A supergroup can be converted to a forum, only if it has at least GetOption("forum_member_count_min") members +toggleSupergroupIsForum supergroup_id:int53 is_forum:Bool = Ok; + //@description Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup @supergroup_id Identifier of the supergroup toggleSupergroupIsBroadcastGroup supergroup_id:int53 = Ok; diff --git a/td/generate/scheme/telegram_api.tl b/td/generate/scheme/telegram_api.tl index 4f17c4aa8..2abe99df1 100644 --- a/td/generate/scheme/telegram_api.tl +++ b/td/generate/scheme/telegram_api.tl @@ -59,7 +59,7 @@ inputMediaVenue#c13d1c11 geo_point:InputGeoPoint title:string address:string pro inputMediaPhotoExternal#e5bbfe1a flags:# url:string ttl_seconds:flags.0?int = InputMedia; inputMediaDocumentExternal#fb52dc99 flags:# url:string ttl_seconds:flags.0?int = InputMedia; inputMediaGame#d33f43f3 id:InputGame = InputMedia; -inputMediaInvoice#d9799874 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string = InputMedia; +inputMediaInvoice#8eb5a6d5 flags:# title:string description:string photo:flags.0?InputWebDocument invoice:Invoice payload:bytes provider:string provider_data:DataJSON start_param:flags.1?string extended_media:flags.2?InputMedia = InputMedia; inputMediaGeoLive#971fa843 flags:# stopped:flags.0?true geo_point:InputGeoPoint heading:flags.2?int period:flags.1?int proximity_notification_radius:flags.3?int = InputMedia; inputMediaPoll#f94e5f1 flags:# poll:Poll correct_answers:flags.0?Vector solution:flags.1?string solution_entities:flags.1?Vector = InputMedia; inputMediaDice#e66fbf7b emoticon:string = InputMedia; @@ -101,7 +101,7 @@ storage.fileMp4#b3cea0e4 = storage.FileType; storage.fileWebp#1081464c = storage.FileType; userEmpty#d3bc4b7a id:long = User; -user#5d99adee 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 bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus = User; +user#8f97c628 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 bot_attach_menu:flags.27?true premium:flags.28?true attach_menu_enabled:flags.29?true flags2:# id:long access_hash:flags.0?long first_name:flags.1?string last_name:flags.2?string username:flags.3?string phone:flags.4?string photo:flags.5?UserProfilePhoto status:flags.6?UserStatus bot_info_version:flags.14?int restriction_reason:flags.18?Vector bot_inline_placeholder:flags.19?string lang_code:flags.22?string emoji_status:flags.30?EmojiStatus usernames:flags2.0?Vector = User; userProfilePhotoEmpty#4f11bae1 = UserProfilePhoto; userProfilePhoto#82d1f706 flags:# has_video:flags.0?true photo_id:long stripped_thumb:flags.1?bytes dc_id:int = UserProfilePhoto; @@ -116,7 +116,7 @@ userStatusLastMonth#77ebc742 = UserStatus; chatEmpty#29562865 id:long = Chat; chat#41cbf256 flags:# creator:flags.0?true left:flags.2?true deactivated:flags.5?true call_active:flags.23?true call_not_empty:flags.24?true noforwards:flags.25?true id:long title:string photo:ChatPhoto participants_count:int date:int version:int migrated_to:flags.6?InputChannel admin_rights:flags.14?ChatAdminRights default_banned_rights:flags.18?ChatBannedRights = Chat; chatForbidden#6592a1a7 id:long title:string = Chat; -channel#8261ac61 flags:# creator:flags.0?true left:flags.2?true broadcast:flags.5?true verified:flags.7?true megagroup:flags.8?true restricted:flags.9?true signatures:flags.11?true min:flags.12?true scam:flags.19?true has_link:flags.20?true has_geo:flags.21?true slowmode_enabled:flags.22?true call_active:flags.23?true call_not_empty:flags.24?true fake:flags.25?true gigagroup:flags.26?true noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date: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#83259464 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 noforwards:flags.27?true join_to_send:flags.28?true join_request:flags.29?true forum:flags.30?true flags2:# id:long access_hash:flags.13?long title:string username:flags.6?string photo:ChatPhoto date: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 usernames:flags2.0?Vector = Chat; channelForbidden#17d493d5 flags:# broadcast:flags.5?true megagroup:flags.8?true id:long access_hash:long title:string until_date:flags.16?int = Chat; chatFull#c9d31138 flags:# can_set_username:flags.7?true has_scheduled:flags.8?true id:long about:string participants:ChatParticipants chat_photo:flags.2?Photo notify_settings:PeerNotifySettings exported_invite:flags.13?ExportedChatInvite bot_info:flags.3?Vector pinned_msg_id:flags.6?int folder_id:flags.11?int call:flags.12?InputGroupCall ttl_period:flags.14?int groupcall_default_join_as:flags.15?Peer theme_emoticon:flags.16?string requests_pending:flags.17?int recent_requesters:flags.17?Vector available_reactions:flags.18?ChatReactions = ChatFull; @@ -145,7 +145,7 @@ messageMediaDocument#9cb070d7 flags:# nopremium:flags.3?true document:flags.0?Do messageMediaWebPage#a32dd600 webpage:WebPage = MessageMedia; messageMediaVenue#2ec0533f geo:GeoPoint title:string address:string provider:string venue_id:string venue_type:string = MessageMedia; messageMediaGame#fdb19008 game:Game = MessageMedia; -messageMediaInvoice#84551347 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string = MessageMedia; +messageMediaInvoice#f6a548d3 flags:# shipping_address_requested:flags.1?true test:flags.3?true title:string description:string photo:flags.0?WebDocument receipt_msg_id:flags.2?int currency:string total_amount:long start_param:string extended_media:flags.4?MessageExtendedMedia = MessageMedia; messageMediaGeoLive#b940c666 flags:# geo:GeoPoint heading:flags.0?int period:int proximity_notification_radius:flags.1?int = MessageMedia; messageMediaPoll#4bd6e798 poll:Poll results:PollResults = MessageMedia; messageMediaDice#3f7ee58b value:int emoticon:string = MessageMedia; @@ -183,6 +183,8 @@ messageActionChatJoinedByRequest#ebbca3cb = MessageAction; messageActionWebViewDataSentMe#47dd8079 text:string data:string = MessageAction; messageActionWebViewDataSent#b4c38cb5 text:string = MessageAction; messageActionGiftPremium#aba0f5c6 currency:string amount:long months:int = MessageAction; +messageActionTopicCreate#d999256 flags:# title:string icon_color:int icon_emoji_id:flags.0?long = MessageAction; +messageActionTopicEdit#b18a431c flags:# title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool = MessageAction; dialog#a8edd0f5 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 unread_reactions_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; @@ -211,6 +213,7 @@ inputNotifyPeer#b8bc5b0c peer:InputPeer = InputNotifyPeer; inputNotifyUsers#193b4417 = InputNotifyPeer; inputNotifyChats#4a95e84e = InputNotifyPeer; inputNotifyBroadcasts#b1db7c7e = InputNotifyPeer; +inputNotifyForumTopic#5c467992 peer:InputPeer top_msg_id:int = InputNotifyPeer; inputPeerNotifySettings#df1f002b flags:# show_previews:flags.0?Bool silent:flags.1?Bool mute_until:flags.2?int sound:flags.3?NotificationSound = InputPeerNotifySettings; @@ -289,7 +292,7 @@ updateUserTyping#c01e857f user_id:long action:SendMessageAction = Update; updateChatUserTyping#83487af0 chat_id:long from_id:Peer action:SendMessageAction = Update; updateChatParticipants#7761198 participants:ChatParticipants = Update; updateUserStatus#e5bdf8de user_id:long status:UserStatus = Update; -updateUserName#c3f202e0 user_id:long first_name:string last_name:string username:string = Update; +updateUserName#a7848924 user_id:long first_name:string last_name:string usernames:Vector = Update; updateUserPhoto#f227868c user_id:long date:int photo:UserProfilePhoto previous:Bool = Update; updateNewEncryptedMessage#12bcbd9a message:EncryptedMessage qts:int = Update; updateEncryptedChatTyping#1710f156 chat_id:int = Update; @@ -324,7 +327,7 @@ updateBotCallbackQuery#b9cfc48d flags:# query_id:long user_id:long peer:Peer msg updateEditMessage#e40370a3 message:Message pts:int pts_count:int = Update; updateInlineBotCallbackQuery#691e9052 flags:# query_id:long user_id:long msg_id:InputBotInlineMessageID chat_instance:long data:flags.0?bytes game_short_name:flags.1?string = Update; updateReadChannelOutbox#b75f99a9 channel_id:long max_id:int = Update; -updateDraftMessage#ee2bb969 peer:Peer draft:DraftMessage = Update; +updateDraftMessage#1b49ec6d flags:# peer:Peer top_msg_id:flags.0?int draft:DraftMessage = Update; updateReadFeaturedStickers#571d2742 = Update; updateRecentStickers#9a422c20 = Update; updateConfig#a229dd06 = Update; @@ -340,7 +343,7 @@ updatePhoneCall#ab0f6b1e phone_call:PhoneCall = Update; updateLangPackTooLong#46560264 lang_code:string = Update; updateLangPack#56022f4d difference:LangPackDifference = Update; updateFavedStickers#e511996d = Update; -updateChannelReadMessagesContents#44bdd535 channel_id:long messages:Vector = Update; +updateChannelReadMessagesContents#ea29055d flags:# channel_id:long top_msg_id:flags.0?int messages:Vector = Update; updateContactsReset#7084a7be = Update; updateChannelAvailableMessages#b23fc698 channel_id:long available_min_id:int = Update; updateDialogUnreadMark#e16459c3 flags:# unread:flags.0?true peer:DialogPeer = Update; @@ -377,7 +380,7 @@ updateGroupCallConnection#b783982 flags:# presentation:flags.0?true params:DataJ updateBotCommands#4d712f2e peer:Peer bot_id:long commands:Vector = Update; updatePendingJoinRequests#7063c3db peer:Peer requests_pending:int recent_requesters:Vector = Update; updateBotChatInviteRequester#11dfa986 peer:Peer date:int user_id:long about:string invite:ExportedChatInvite qts:int = Update; -updateMessageReactions#154798c3 peer:Peer msg_id:int reactions:MessageReactions = Update; +updateMessageReactions#5e1b3cb8 flags:# peer:Peer msg_id:int top_msg_id:flags.0?int reactions:MessageReactions = Update; updateAttachMenuBots#17b7a20b = Update; updateWebViewResultSent#1592b79d query_id:long = Update; updateBotMenuButton#14b85813 bot_id:long button:BotMenuButton = Update; @@ -388,6 +391,8 @@ updateUserEmojiStatus#28373599 user_id:long emoji_status:EmojiStatus = Update; updateRecentEmojiStatuses#30f443db = Update; updateRecentReactions#6f7863f4 = Update; updateMoveStickerSetToTop#86fccf85 flags:# masks:flags.0?true emojis:flags.1?true stickerset:long = Update; +updateMessageExtendedMedia#5a73a98c peer:Peer msg_id:int extended_media:MessageExtendedMedia = Update; +updateChannelPinnedTopic#f694b0ae flags:# channel_id:long topic_id:flags.0?int = Update; updates.state#a56c2a3e pts:int qts:int date:int seq:int unread_count:int = updates.State; @@ -460,6 +465,7 @@ notifyPeer#9fd40bd8 peer:Peer = NotifyPeer; notifyUsers#b4c83b4c = NotifyPeer; notifyChats#c007cec3 = NotifyPeer; notifyBroadcasts#d612e8ef = NotifyPeer; +notifyForumTopic#226e6308 peer:Peer top_msg_id:int = NotifyPeer; sendMessageTypingAction#16bf744e = SendMessageAction; sendMessageCancelAction#fd5ec8f5 = SendMessageAction; @@ -578,10 +584,11 @@ inputStickerSetAnimatedEmojiAnimations#cde3739 = InputStickerSet; inputStickerSetPremiumGifts#c88b3b02 = InputStickerSet; inputStickerSetEmojiGenericAnimations#4c4d4ce = InputStickerSet; inputStickerSetEmojiDefaultStatuses#29d0f5ee = InputStickerSet; +inputStickerSetEmojiDefaultTopicIcons#44c1f8e9 = InputStickerSet; stickerSet#2dd14edc flags:# archived:flags.1?true official:flags.2?true masks:flags.3?true animated:flags.5?true videos:flags.6?true emojis:flags.7?true installed_date:flags.0?int id:long access_hash:long title:string short_name:string thumbs:flags.4?Vector thumb_dc_id:flags.4?int thumb_version:flags.4?int thumb_document_id:flags.8?long count:int hash:int = StickerSet; -messages.stickerSet#b60a24a6 set:StickerSet packs:Vector documents:Vector = messages.StickerSet; +messages.stickerSet#6e153f16 set:StickerSet packs:Vector keywords:Vector documents:Vector = messages.StickerSet; messages.stickerSetNotModified#d3f924eb = messages.StickerSet; botCommand#c27ac8c7 command:string description:string = BotCommand; @@ -760,7 +767,7 @@ messages.stickerSetInstallResultArchive#35e410a8 sets:Vector stickerSetCovered#6410a5d2 set:StickerSet cover:Document = StickerSetCovered; stickerSetMultiCovered#3407e51b set:StickerSet covers:Vector = StickerSetCovered; -stickerSetFullCovered#1aed5ee5 set:StickerSet packs:Vector documents:Vector = StickerSetCovered; +stickerSetFullCovered#40d13c0e set:StickerSet packs:Vector keywords:Vector documents:Vector = StickerSetCovered; maskCoords#aed6dbb2 n:int x:double y:double zoom:double = MaskCoords; @@ -942,12 +949,18 @@ channelAdminLogEventActionParticipantJoinByRequest#afb6144a invite:ExportedChatI channelAdminLogEventActionToggleNoForwards#cb2ac766 new_value:Bool = ChannelAdminLogEventAction; channelAdminLogEventActionSendMessage#278f2868 message:Message = ChannelAdminLogEventAction; channelAdminLogEventActionChangeAvailableReactions#be4e0ef8 prev_value:ChatReactions new_value:ChatReactions = ChannelAdminLogEventAction; +channelAdminLogEventActionChangeUsernames#f04fb3a9 prev_value:Vector new_value:Vector = ChannelAdminLogEventAction; +channelAdminLogEventActionToggleForum#2cc6383 new_value:Bool = ChannelAdminLogEventAction; +channelAdminLogEventActionCreateTopic#58707d28 topic:ForumTopic = ChannelAdminLogEventAction; +channelAdminLogEventActionEditTopic#f06fe208 prev_topic:ForumTopic new_topic:ForumTopic = ChannelAdminLogEventAction; +channelAdminLogEventActionDeleteTopic#ae168909 topic:ForumTopic = ChannelAdminLogEventAction; +channelAdminLogEventActionPinTopic#5d8d353b flags:# prev_topic:flags.0?ForumTopic new_topic:flags.1?ForumTopic = ChannelAdminLogEventAction; channelAdminLogEvent#1fad68cd id:long date:int user_id:long 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 invites:flags.15?true send:flags.16?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 send:flags.16?true forums:flags.17?true = ChannelAdminLogEventsFilter; popularContact#5ce14175 client_id:long importers:int = PopularContact; @@ -1105,9 +1118,9 @@ 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 other:flags.12?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 manage_topics:flags.13?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; +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 manage_topics:flags.18?true until_date:int = ChatBannedRights; inputWallPaper#e630b979 id:long access_hash:long = InputWallPaper; inputWallPaperSlug#72091c80 slug:string = InputWallPaper; @@ -1238,7 +1251,7 @@ messages.messageViews#b6c4f543 views:Vector chats:Vector use messages.discussionMessage#a6341782 flags:# messages:Vector max_id:flags.0?int read_inbox_max_id:flags.1?int read_outbox_max_id:flags.2?int unread_count:int chats:Vector users:Vector = messages.DiscussionMessage; -messageReplyHeader#a6d57763 flags:# reply_to_scheduled:flags.2?true reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader; +messageReplyHeader#a6d57763 flags:# reply_to_scheduled:flags.2?true forum_topic:flags.3?true reply_to_msg_id:int reply_to_peer_id:flags.0?Peer reply_to_top_id:flags.1?int = MessageReplyHeader; messageReplies#83d60fc2 flags:# comments:flags.0?true replies:int replies_pts:int recent_repliers:flags.1?Vector channel_id:flags.0?long max_id:flags.2?int read_max_id:flags.3?int = MessageReplies; @@ -1306,9 +1319,10 @@ account.resetPasswordFailedWait#e3779861 retry_date:int = account.ResetPasswordR account.resetPasswordRequestedWait#e9effc7d until_date:int = account.ResetPasswordResult; account.resetPasswordOk#e926d63e = account.ResetPasswordResult; -sponsoredMessage#3a836df8 flags:# recommended:flags.5?true random_id:bytes from_id:flags.3?Peer chat_invite:flags.4?ChatInvite chat_invite_hash:flags.4?string channel_post:flags.2?int start_param:flags.0?string message:string entities:flags.1?Vector = SponsoredMessage; +sponsoredMessage#3a836df8 flags:# recommended:flags.5?true show_peer_photo:flags.6?true random_id:bytes from_id:flags.3?Peer chat_invite:flags.4?ChatInvite chat_invite_hash:flags.4?string channel_post:flags.2?int start_param:flags.0?string message:string entities:flags.1?Vector = SponsoredMessage; -messages.sponsoredMessages#65a4c7d5 messages:Vector chats:Vector users:Vector = messages.SponsoredMessages; +messages.sponsoredMessages#c9ee1d87 flags:# posts_between:flags.0?int messages:Vector chats:Vector users:Vector = messages.SponsoredMessages; +messages.sponsoredMessagesEmpty#1839490f = messages.SponsoredMessages; searchResultsCalendarPeriod#c9b0539f date:int min_msg_id:int max_msg_id:int count:int = SearchResultsCalendarPeriod; @@ -1318,7 +1332,7 @@ searchResultPosition#7f648b67 msg_id:int date:int offset:int = SearchResultsPosi messages.searchResultsPositions#53b22baf count:int positions:Vector = messages.SearchResultsPositions; -channels.sendAsPeers#8356cda9 peers:Vector chats:Vector users:Vector = channels.SendAsPeers; +channels.sendAsPeers#f496b0c6 peers:Vector chats:Vector users:Vector = channels.SendAsPeers; users.userFull#3b6d152e full_user:UserFull chats:Vector users:Vector = users.UserFull; @@ -1433,6 +1447,20 @@ account.emailVerifiedLogin#e1bb0d61 email:string sent_code:auth.SentCode = accou premiumSubscriptionOption#b6f11ebe flags:# current:flags.1?true can_purchase_upgrade:flags.2?true months:int currency:string amount:long bot_url:string store_product:flags.0?string = PremiumSubscriptionOption; +sendAsPeer#b81c7034 flags:# premium_required:flags.0?true peer:Peer = SendAsPeer; + +messageExtendedMediaPreview#ad628cc8 flags:# w:flags.0?int h:flags.0?int thumb:flags.1?PhotoSize video_duration:flags.2?int = MessageExtendedMedia; +messageExtendedMedia#ee479c64 media:MessageMedia = MessageExtendedMedia; + +stickerKeyword#fcfeb29c document_id:long keyword:Vector = StickerKeyword; + +username#b4073647 flags:# editable:flags.0?true active:flags.1?true username:string = Username; + +forumTopicDeleted#23f109b id:int = ForumTopic; +forumTopic#71701da9 flags:# my:flags.1?true closed:flags.2?true pinned:flags.3?true id:int date:int title:string icon_color:int icon_emoji_id:flags.0?long top_message:int read_inbox_max_id:int read_outbox_max_id:int unread_count:int unread_mentions_count:int unread_reactions_count:int from_id:Peer notify_settings:PeerNotifySettings draft:flags.4?DraftMessage = ForumTopic; + +messages.forumTopics#367617d3 flags:# order_by_create_date:flags.0?true count:int topics:Vector messages:Vector chats:Vector users:Vector pts:int = messages.ForumTopics; + ---functions--- invokeAfterMsg#cb9f372d {X:Type} msg_id:long query:!X = X; @@ -1523,7 +1551,7 @@ account.createTheme#652e4400 flags:# slug:string title:string document:flags.2?I account.updateTheme#2bf40ccc flags:# format:string theme:InputTheme slug:flags.0?string title:flags.1?string document:flags.2?InputDocument settings:flags.3?Vector = Theme; account.saveTheme#f257106c theme:InputTheme unsave:Bool = Bool; account.installTheme#c727bb3b flags:# dark:flags.0?true theme:flags.1?InputTheme format:flags.2?string base_theme:flags.3?BaseTheme = Bool; -account.getTheme#8d9d742b format:string theme:InputTheme document_id:long = Theme; +account.getTheme#3a5869ec format:string theme:InputTheme = Theme; account.getThemes#7206e458 format:string hash:long = account.Themes; account.setContentSettings#b574b16b flags:# sensitive_enabled:flags.0?true = Bool; account.getContentSettings#8b9b4dae = account.ContentSettings; @@ -1543,6 +1571,8 @@ account.updateEmojiStatus#fbd3de6b emoji_status:EmojiStatus = Bool; account.getDefaultEmojiStatuses#d6753386 hash:long = account.EmojiStatuses; account.getRecentEmojiStatuses#f578105 hash:long = account.EmojiStatuses; account.clearRecentEmojiStatuses#18201aae = Bool; +account.reorderUsernames#ef500eab order:Vector = Bool; +account.toggleUsername#58d6b376 username:string active:Bool = Bool; users.getUsers#d91a548 id:Vector = Vector; users.getFullUser#b60f5918 id:InputUser = users.UserFull; @@ -1579,9 +1609,9 @@ messages.deleteHistory#b08f922a flags:# just_clear:flags.0?true revoke:flags.1?t messages.deleteMessages#e58e95d2 flags:# revoke:flags.0?true id:Vector = messages.AffectedMessages; messages.receivedMessages#5a954c0 max_id:int = Vector; messages.setTyping#58943ee2 flags:# peer:InputPeer top_msg_id:flags.0?int action:SendMessageAction = Bool; -messages.sendMessage#d9d75a4 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; -messages.sendMedia#e25ff8e0 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; -messages.forwardMessages#cc30290b flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; +messages.sendMessage#1cc20387 flags:# no_webpage:flags.1?true silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; +messages.sendMedia#7547c966 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int media:InputMedia message:string random_id:long reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; +messages.forwardMessages#c661bbc4 flags:# silent:flags.5?true background:flags.6?true with_my_score:flags.8?true drop_author:flags.11?true drop_media_captions:flags.12?true noforwards:flags.14?true from_peer:InputPeer id:Vector random_id:Vector to_peer:InputPeer top_msg_id:flags.9?int schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; messages.reportSpam#cf1592db peer:InputPeer = Bool; messages.getPeerSettings#efd9a6a2 peer:InputPeer = messages.PeerSettings; messages.report#8953ab4e peer:InputPeer id:Vector reason:ReportReason message:string = Bool; @@ -1624,14 +1654,14 @@ messages.getSavedGifs#5cf09635 hash:long = messages.SavedGifs; messages.saveGif#327a30cb id:InputDocument unsave:Bool = Bool; messages.getInlineBotResults#514e999d flags:# bot:InputUser peer:InputPeer geo_point:flags.0?InputGeoPoint query:string offset:string = messages.BotResults; messages.setInlineBotResults#eb5ea206 flags:# gallery:flags.0?true private:flags.1?true query_id:long results:Vector cache_time:int next_offset:flags.2?string switch_pm:flags.3?InlineBotSwitchPM = Bool; -messages.sendInlineBotResult#7aa11297 flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; +messages.sendInlineBotResult#d3fbdccb flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true hide_via:flags.11?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int random_id:long query_id:long id:string schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; messages.getMessageEditData#fda68d36 peer:InputPeer id:int = messages.MessageEditData; messages.editMessage#48f71778 flags:# no_webpage:flags.1?true peer:InputPeer id:int message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector schedule_date:flags.15?int = Updates; messages.editInlineBotMessage#83557dba flags:# no_webpage:flags.1?true id:InputBotInlineMessageID message:flags.11?string media:flags.14?InputMedia reply_markup:flags.2?ReplyMarkup entities:flags.3?Vector = Bool; messages.getBotCallbackAnswer#9342ca07 flags:# game:flags.1?true peer:InputPeer msg_id:int data:flags.0?bytes password:flags.2?InputCheckPasswordSRP = messages.BotCallbackAnswer; messages.setBotCallbackAnswer#d58f130a flags:# alert:flags.1?true query_id:long message:flags.0?string url:flags.2?string cache_time:int = Bool; messages.getPeerDialogs#e470bcfd peers:Vector = messages.PeerDialogs; -messages.saveDraft#bc39e14b flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int peer:InputPeer message:string entities:flags.3?Vector = Bool; +messages.saveDraft#b4331e3f flags:# no_webpage:flags.1?true reply_to_msg_id:flags.0?int top_msg_id:flags.2?int peer:InputPeer message:string entities:flags.3?Vector = Bool; messages.getAllDrafts#6a3f8d65 = Updates; messages.getFeaturedStickers#64780b14 hash:long = messages.FeaturedStickers; messages.readFeaturedStickers#5b118126 id:Vector = Bool; @@ -1657,10 +1687,10 @@ messages.uploadMedia#519bc2b1 peer:InputPeer media:InputMedia = MessageMedia; messages.sendScreenshotNotification#c97df020 peer:InputPeer reply_to_msg_id:int random_id:long = Updates; messages.getFavedStickers#4f1aaa9 hash:long = messages.FavedStickers; messages.faveSticker#b9ffc55b id:InputDocument unfave:Bool = Bool; -messages.getUnreadMentions#46578472 peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; -messages.readMentions#f0189d3 peer:InputPeer = messages.AffectedHistory; +messages.getUnreadMentions#f107e790 flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +messages.readMentions#36e5bf4d flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory; messages.getRecentLocations#702a40e0 peer:InputPeer limit:int hash:long = messages.Messages; -messages.sendMultiMedia#f803138f flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int multi_media:Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; +messages.sendMultiMedia#b6f11a1c flags:# silent:flags.5?true background:flags.6?true clear_draft:flags.7?true noforwards:flags.14?true update_stickersets_order:flags.15?true peer:InputPeer reply_to_msg_id:flags.0?int top_msg_id:flags.9?int multi_media:Vector schedule_date:flags.10?int send_as:flags.13?InputPeer = Updates; messages.uploadEncryptedFile#5057c497 peer:InputEncryptedChat file:InputEncryptedFile = EncryptedFile; messages.searchStickerSets#35705b8a flags:# exclude_featured:flags.0?true q:string hash:long = messages.FoundStickerSets; messages.getSplitRanges#1cff7e08 = Vector; @@ -1677,7 +1707,7 @@ messages.getEmojiKeywords#35a0e062 lang_code:string = EmojiKeywordsDifference; messages.getEmojiKeywordsDifference#1508b6af lang_code:string from_version:int = EmojiKeywordsDifference; messages.getEmojiKeywordsLanguages#4e9963b2 lang_codes:Vector = Vector; messages.getEmojiURL#d5b10c26 lang_code:string = EmojiURL; -messages.getSearchCounters#732eef00 peer:InputPeer filters:Vector = Vector; +messages.getSearchCounters#ae7cc1 flags:# peer:InputPeer top_msg_id:flags.0?int filters:Vector = Vector; messages.requestUrlAuth#198fb446 flags:# peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult; messages.acceptUrlAuth#b12c7125 flags:# write_allowed:flags.0?true peer:flags.1?InputPeer msg_id:flags.1?int button_id:flags.1?int url:flags.2?string = UrlAuthResult; messages.hidePeerSettingsBar#4facb138 peer:InputPeer = Bool; @@ -1695,7 +1725,7 @@ messages.getOldFeaturedStickers#7ed094a1 offset:int limit:int hash:long = messag messages.getReplies#22ddd30c peer:InputPeer msg_id:int offset_id:int offset_date:int add_offset:int limit:int max_id:int min_id:int hash:long = messages.Messages; messages.getDiscussionMessage#446972fd peer:InputPeer msg_id:int = messages.DiscussionMessage; messages.readDiscussion#f731a9f4 peer:InputPeer msg_id:int read_max_id:int = Bool; -messages.unpinAllMessages#f025bc8b peer:InputPeer = messages.AffectedHistory; +messages.unpinAllMessages#ee22b9a8 flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory; messages.deleteChat#5bd0ee50 chat_id:long = Bool; messages.deletePhoneCallHistory#f9cbe409 flags:# revoke:flags.0?true = messages.AffectedFoundMessages; messages.checkHistoryImport#43fe19f3 import_head:string = messages.HistoryImportParsed; @@ -1726,14 +1756,14 @@ messages.setChatAvailableReactions#feb16771 peer:InputPeer available_reactions:C messages.getAvailableReactions#18dea0ac hash:int = messages.AvailableReactions; messages.setDefaultReaction#4f47a016 reaction:Reaction = Bool; messages.translateText#24ce6dee flags:# peer:flags.0?InputPeer msg_id:flags.0?int text:flags.1?string from_lang:flags.2?string to_lang:string = messages.TranslatedText; -messages.getUnreadReactions#e85bae1a peer:InputPeer offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; -messages.readReactions#82e251d7 peer:InputPeer = messages.AffectedHistory; +messages.getUnreadReactions#3223495b flags:# peer:InputPeer top_msg_id:flags.0?int offset_id:int add_offset:int limit:int max_id:int min_id:int = messages.Messages; +messages.readReactions#54aa7f8e flags:# peer:InputPeer top_msg_id:flags.0?int = messages.AffectedHistory; messages.searchSentMedia#107e31a0 q:string filter:MessagesFilter limit:int = messages.Messages; messages.getAttachMenuBots#16fcc2cb hash:long = AttachMenuBots; messages.getAttachMenuBot#77216192 bot:InputUser = AttachMenuBotsBot; messages.toggleBotInAttachMenu#1aee33af bot:InputUser enabled:Bool = Bool; -messages.requestWebView#fc87a53c flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to_msg_id:flags.0?int send_as:flags.13?InputPeer = WebViewResult; -messages.prolongWebView#ea5fbcce flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int send_as:flags.13?InputPeer = Bool; +messages.requestWebView#178b480b flags:# from_bot_menu:flags.4?true silent:flags.5?true peer:InputPeer bot:InputUser url:flags.1?string start_param:flags.3?string theme_params:flags.2?DataJSON platform:string reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = WebViewResult; +messages.prolongWebView#7ff34309 flags:# silent:flags.5?true peer:InputPeer bot:InputUser query_id:long reply_to_msg_id:flags.0?int top_msg_id:flags.9?int send_as:flags.13?InputPeer = Bool; messages.requestSimpleWebView#299bec8e flags:# bot:InputUser url:string theme_params:flags.0?DataJSON platform:string = SimpleWebViewResult; messages.sendWebViewResultMessage#a4314f5 bot_query_id:string result:InputBotInlineResult = WebViewMessageSent; messages.sendWebViewData#dc0242c8 bot:InputUser random_id:long button_text:string data:string = Updates; @@ -1746,6 +1776,7 @@ messages.reportReaction#3f64c076 peer:InputPeer id:int reaction_peer:InputPeer = messages.getTopReactions#bb8125ba limit:int hash:long = messages.Reactions; messages.getRecentReactions#39461db2 limit:int hash:long = messages.Reactions; messages.clearRecentReactions#9dfeefb4 = Bool; +messages.getExtendedMedia#84f80814 peer:InputPeer id:Vector = Updates; updates.getState#edd4882a = updates.State; updates.getDifference#25939651 flags:# pts:int pts_total_limit:flags.0?int date:int qts:int = updates.Difference; @@ -1830,6 +1861,16 @@ channels.getSendAs#dc770ee peer:InputPeer = channels.SendAsPeers; channels.deleteParticipantHistory#367544db channel:InputChannel participant:InputPeer = messages.AffectedHistory; channels.toggleJoinToSend#e4cb9580 channel:InputChannel enabled:Bool = Updates; channels.toggleJoinRequest#4c2985b6 channel:InputChannel enabled:Bool = Updates; +channels.reorderUsernames#b45ced1d channel:InputChannel order:Vector = Bool; +channels.toggleUsername#50f24105 channel:InputChannel username:string active:Bool = Bool; +channels.deactivateAllUsernames#a245dd3 channel:InputChannel = Bool; +channels.toggleForum#a4298b29 channel:InputChannel enabled:Bool = Updates; +channels.createForumTopic#f40c0224 flags:# channel:InputChannel title:string icon_color:flags.0?int icon_emoji_id:flags.3?long random_id:long send_as:flags.2?InputPeer = Updates; +channels.getForumTopics#de560d1 flags:# channel:InputChannel q:flags.0?string offset_date:int offset_id:int offset_topic:int limit:int = messages.ForumTopics; +channels.getForumTopicsByID#b0831eb9 channel:InputChannel topics:Vector = messages.ForumTopics; +channels.editForumTopic#6c883e2d flags:# channel:InputChannel topic_id:int title:flags.0?string icon_emoji_id:flags.1?long closed:flags.2?Bool = Updates; +channels.updatePinnedForumTopic#6c2d9026 channel:InputChannel topic_id:int pinned:Bool = Updates; +channels.deleteTopicHistory#34435f2d channel:InputChannel top_msg_id:int = messages.AffectedHistory; bots.sendCustomRequest#aa2769ed custom_method:string params:DataJSON = DataJSON; bots.answerWebhookJSONQuery#e6213f4d query_id:long data:DataJSON = Bool; diff --git a/td/generate/tl_writer_java.cpp b/td/generate/tl_writer_java.cpp index f20c6a04b..7c61de318 100644 --- a/td/generate/tl_writer_java.cpp +++ b/td/generate/tl_writer_java.cpp @@ -202,6 +202,10 @@ std::string TD_TL_writer_java::gen_output_begin() const { " } catch (UnsatisfiedLinkError e) {\n" " e.printStackTrace();\n" + " }\n" + " }\n\n" + " private " + + tl_name + + "() {\n" " }\n\n"; } diff --git a/td/mtproto/SessionConnection.cpp b/td/mtproto/SessionConnection.cpp index bb7b6670c..c9be563b7 100644 --- a/td/mtproto/SessionConnection.cpp +++ b/td/mtproto/SessionConnection.cpp @@ -1042,7 +1042,7 @@ Status SessionConnection::do_flush() { auto start_time = Time::now(); auto result = raw_connection_->flush(auth_data_->get_auth_key(), *this); auto elapsed_time = Time::now() - start_time; - if (elapsed_time >= 0.01) { + if (elapsed_time >= 0.1) { LOG(ERROR) << "RawConnection::flush took " << elapsed_time << " seconds, written " << last_write_size_ << " bytes, read " << last_read_size_ << " bytes and returned " << result; } diff --git a/td/telegram/AnimationsManager.cpp b/td/telegram/AnimationsManager.cpp index a861c0179..08e06a0dd 100644 --- a/td/telegram/AnimationsManager.cpp +++ b/td/telegram/AnimationsManager.cpp @@ -179,7 +179,7 @@ FileId AnimationsManager::on_get_animation(unique_ptr new_animation, CHECK(a->file_id == file_id); if (a->mime_type != new_animation->mime_type) { LOG(DEBUG) << "Animation " << file_id << " info has changed"; - a->mime_type = new_animation->mime_type; + a->mime_type = std::move(new_animation->mime_type); } if (a->file_name != new_animation->file_name) { LOG(DEBUG) << "Animation " << file_id << " file name has changed"; @@ -205,7 +205,7 @@ FileId AnimationsManager::on_get_animation(unique_ptr new_animation, LOG(INFO) << "Animation " << file_id << " thumbnail has changed from " << a->thumbnail << " to " << new_animation->thumbnail; } - a->thumbnail = new_animation->thumbnail; + a->thumbnail = std::move(new_animation->thumbnail); } if (a->animated_thumbnail != new_animation->animated_thumbnail) { if (!a->animated_thumbnail.file_id.is_valid()) { @@ -214,7 +214,7 @@ FileId AnimationsManager::on_get_animation(unique_ptr new_animation, LOG(INFO) << "Animation " << file_id << " animated thumbnail has changed from " << a->animated_thumbnail << " to " << new_animation->animated_thumbnail; } - a->animated_thumbnail = new_animation->animated_thumbnail; + a->animated_thumbnail = std::move(new_animation->animated_thumbnail); } if (a->has_stickers != new_animation->has_stickers && new_animation->has_stickers) { a->has_stickers = new_animation->has_stickers; @@ -389,7 +389,7 @@ SecretInputMedia AnimationsManager::get_secret_input_media(FileId animation_file attributes.push_back(make_tl_object(animation->file_name)); } if (animation->duration != 0 && animation->mime_type == "video/mp4") { - attributes.push_back(make_tl_object( + attributes.push_back(make_tl_object( 0, false, animation->duration, animation->dimensions.width, animation->dimensions.height)); } if (animation->dimensions.width != 0 && animation->dimensions.height != 0) { diff --git a/td/telegram/AttachMenuManager.cpp b/td/telegram/AttachMenuManager.cpp index c52ca42c5..840e47e6d 100644 --- a/td/telegram/AttachMenuManager.cpp +++ b/td/telegram/AttachMenuManager.cpp @@ -39,6 +39,7 @@ class RequestWebViewQuery final : public Td::ResultHandler { Promise> promise_; DialogId dialog_id_; UserId bot_user_id_; + MessageId top_thread_message_id_; MessageId reply_to_message_id_; DialogId as_dialog_id_; bool from_attach_menu_ = false; @@ -49,8 +50,8 @@ class RequestWebViewQuery final : public Td::ResultHandler { } void send(DialogId dialog_id, UserId bot_user_id, tl_object_ptr &&input_user, string &&url, - td_api::object_ptr &&theme, string &&platform, MessageId reply_to_message_id, - bool silent, DialogId as_dialog_id) { + td_api::object_ptr &&theme, string &&platform, MessageId top_thread_message_id, + MessageId reply_to_message_id, bool silent, DialogId as_dialog_id) { dialog_id_ = dialog_id; bot_user_id_ = bot_user_id; reply_to_message_id_ = reply_to_message_id; @@ -86,6 +87,10 @@ class RequestWebViewQuery final : public Td::ResultHandler { flags |= telegram_api::messages_requestWebView::THEME_PARAMS_MASK; } + if (top_thread_message_id.is_valid()) { + flags |= telegram_api::messages_requestWebView::TOP_MSG_ID_MASK; + } + if (reply_to_message_id.is_valid()) { flags |= telegram_api::messages_requestWebView::REPLY_TO_MSG_ID_MASK; } @@ -105,7 +110,7 @@ class RequestWebViewQuery final : public Td::ResultHandler { send_query(G()->net_query_creator().create(telegram_api::messages_requestWebView( flags, false /*ignored*/, false /*ignored*/, std::move(input_peer), std::move(input_user), url, start_parameter, std::move(theme_parameters), platform, reply_to_message_id.get_server_message_id().get(), - std::move(as_input_peer)))); + top_thread_message_id.get_server_message_id().get(), std::move(as_input_peer)))); } void on_result(BufferSlice packet) final { @@ -115,8 +120,8 @@ class RequestWebViewQuery final : public Td::ResultHandler { } auto ptr = result_ptr.move_as_ok(); - td_->attach_menu_manager_->open_web_view(ptr->query_id_, dialog_id_, bot_user_id_, reply_to_message_id_, - as_dialog_id_); + td_->attach_menu_manager_->open_web_view(ptr->query_id_, dialog_id_, bot_user_id_, top_thread_message_id_, + reply_to_message_id_, as_dialog_id_); promise_.set_value(td_api::make_object(ptr->query_id_, ptr->url_)); } @@ -134,8 +139,8 @@ class ProlongWebViewQuery final : public Td::ResultHandler { DialogId dialog_id_; public: - void send(DialogId dialog_id, UserId bot_user_id, int64 query_id, MessageId reply_to_message_id, bool silent, - DialogId as_dialog_id) { + void send(DialogId dialog_id, UserId bot_user_id, int64 query_id, MessageId top_thread_message_id, + MessageId reply_to_message_id, bool silent, DialogId as_dialog_id) { dialog_id_ = dialog_id; auto input_peer = td_->messages_manager_->get_input_peer(dialog_id, AccessRights::Write); @@ -149,6 +154,10 @@ class ProlongWebViewQuery final : public Td::ResultHandler { flags |= telegram_api::messages_prolongWebView::REPLY_TO_MSG_ID_MASK; } + if (top_thread_message_id.is_valid()) { + flags |= telegram_api::messages_prolongWebView::TOP_MSG_ID_MASK; + } + if (silent) { flags |= telegram_api::messages_prolongWebView::SILENT_MASK; } @@ -163,7 +172,8 @@ class ProlongWebViewQuery final : public Td::ResultHandler { send_query(G()->net_query_creator().create(telegram_api::messages_prolongWebView( flags, false /*ignored*/, std::move(input_peer), r_input_user.move_as_ok(), query_id, - reply_to_message_id.get_server_message_id().get(), std::move(as_input_peer)))); + reply_to_message_id.get_server_message_id().get(), top_thread_message_id.get_server_message_id().get(), + std::move(as_input_peer)))); } void on_result(BufferSlice packet) final { @@ -585,9 +595,9 @@ void AttachMenuManager::ping_web_view() { for (const auto &it : opened_web_views_) { const auto &opened_web_view = it.second; bool silent = td_->messages_manager_->get_dialog_silent_send_message(opened_web_view.dialog_id_); - td_->create_handler()->send(opened_web_view.dialog_id_, opened_web_view.bot_user_id_, it.first, - opened_web_view.reply_to_message_id_, silent, - opened_web_view.as_dialog_id_); + td_->create_handler()->send( + opened_web_view.dialog_id_, opened_web_view.bot_user_id_, it.first, opened_web_view.top_thread_message_id_, + opened_web_view.reply_to_message_id_, silent, opened_web_view.as_dialog_id_); } schedule_ping_web_view(); @@ -599,9 +609,10 @@ void AttachMenuManager::schedule_ping_web_view() { ping_web_view_timeout_.set_timeout_in(PING_WEB_VIEW_TIMEOUT); } -void AttachMenuManager::request_web_view(DialogId dialog_id, UserId bot_user_id, MessageId reply_to_message_id, - string &&url, td_api::object_ptr &&theme, - string &&platform, Promise> &&promise) { +void AttachMenuManager::request_web_view(DialogId dialog_id, UserId bot_user_id, MessageId top_thread_message_id, + MessageId reply_to_message_id, string &&url, + td_api::object_ptr &&theme, string &&platform, + Promise> &&promise) { TRY_STATUS_PROMISE(promise, td_->contacts_manager_->get_bot_data(bot_user_id)); TRY_RESULT_PROMISE(promise, input_user, td_->contacts_manager_->get_input_user(bot_user_id)); @@ -630,17 +641,23 @@ void AttachMenuManager::request_web_view(DialogId dialog_id, UserId bot_user_id, !td_->messages_manager_->have_message_force({dialog_id, reply_to_message_id}, "request_web_view")) { reply_to_message_id = MessageId(); } + if (!top_thread_message_id.is_valid() || !top_thread_message_id.is_server() || + dialog_id.get_type() != DialogType::Channel || + !td_->contacts_manager_->is_megagroup_channel(dialog_id.get_channel_id())) { + top_thread_message_id = MessageId(); + } bool silent = td_->messages_manager_->get_dialog_silent_send_message(dialog_id); DialogId as_dialog_id = td_->messages_manager_->get_dialog_default_send_message_as_dialog_id(dialog_id); td_->create_handler(std::move(promise)) ->send(dialog_id, bot_user_id, std::move(input_user), std::move(url), std::move(theme), std::move(platform), - reply_to_message_id, silent, as_dialog_id); + top_thread_message_id, reply_to_message_id, silent, as_dialog_id); } void AttachMenuManager::open_web_view(int64 query_id, DialogId dialog_id, UserId bot_user_id, - MessageId reply_to_message_id, DialogId as_dialog_id) { + MessageId top_thread_message_id, MessageId reply_to_message_id, + DialogId as_dialog_id) { if (query_id == 0) { LOG(ERROR) << "Receive Web App query identifier == 0"; return; @@ -652,6 +669,7 @@ void AttachMenuManager::open_web_view(int64 query_id, DialogId dialog_id, UserId OpenedWebView opened_web_view; opened_web_view.dialog_id_ = dialog_id; opened_web_view.bot_user_id_ = bot_user_id; + opened_web_view.top_thread_message_id_ = top_thread_message_id; opened_web_view.reply_to_message_id_ = reply_to_message_id; opened_web_view.as_dialog_id_ = as_dialog_id; opened_web_views_.emplace(query_id, std::move(opened_web_view)); diff --git a/td/telegram/AttachMenuManager.h b/td/telegram/AttachMenuManager.h index 3110aaaa6..197dfbae8 100644 --- a/td/telegram/AttachMenuManager.h +++ b/td/telegram/AttachMenuManager.h @@ -32,12 +32,13 @@ class AttachMenuManager final : public Actor { void init(); - void request_web_view(DialogId dialog_id, UserId bot_user_id, MessageId reply_to_message_id, string &&url, + void request_web_view(DialogId dialog_id, UserId bot_user_id, MessageId top_thread_message_id, + MessageId reply_to_message_id, string &&url, td_api::object_ptr &&theme, string &&platform, Promise> &&promise); - void open_web_view(int64 query_id, DialogId dialog_id, UserId bot_user_id, MessageId reply_to_message_id, - DialogId as_dialog_id); + void open_web_view(int64 query_id, DialogId dialog_id, UserId bot_user_id, MessageId top_thread_message_id, + MessageId reply_to_message_id, DialogId as_dialog_id); void close_web_view(int64 query_id, Promise &&promise); @@ -154,6 +155,7 @@ class AttachMenuManager final : public Actor { struct OpenedWebView { DialogId dialog_id_; UserId bot_user_id_; + MessageId top_thread_message_id_; MessageId reply_to_message_id_; DialogId as_dialog_id_; }; diff --git a/td/telegram/AudiosManager.cpp b/td/telegram/AudiosManager.cpp index fbc89ce22..f6aacf1fb 100644 --- a/td/telegram/AudiosManager.cpp +++ b/td/telegram/AudiosManager.cpp @@ -101,13 +101,13 @@ FileId AudiosManager::on_get_audio(unique_ptr