diff --git a/CHANGELOG.md b/CHANGELOG.md index 69b84a1e1..5d5f9fe17 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,49 @@ +Changes in 1.2.0: + +* Added support for native .NET bindings through `C++/CLI` and `C++/CX`. + See [using in .NET projects](README.md#using-dotnet) for more details. +* Added a C# example. See [README](example/csharp/README.md) for build and usage instructions. +* Added a build and usage example of TDLib SDK for Universal Windows Platform. See + [README](example/uwp/README.md) for detailed build and usage instructions. +* Added a Swift example. See [README](example/swift/README.md) for build and usage instructions. +* Added an example of building TDLib for iOS, watchOS, tvOS, and also macOS. See [README](example/ios/README.md) for + detailed build instructions. +* Added README to [C++](example/cpp/README.md) and [python](example/python/README.md) examples. +* Link Time Optimization is disabled by default. Use `-DTD_ENABLE_LTO=ON` CMake option and CMake >= 3.9 to enable it. +* `updateNotificationSettings` is now automatically sent when the mute time expires for a chat. +* Added automatic sending of a corresponding `chatAction` when a file is being uploaded. +* `updateUserChatAction` with `chatActionCancel` is now automatically sent when the timeout expires for an action. +* Authorizatiion states `authorizationStateWaitCode` and `authorizationStateWaitPassword` are now saved between + library restarts for 5 minutes. +* Added new message content type `messageWebsiteConnected`. +* Added new text entity types `textEntityTypeCashtag` and `textEntityTypePhoneNumber`. +* Added new update `updateUnreadMessageCount`, enabled when message database is used. +* Method `joinChatByInviteLink` now returns the joined `Chat`. +* Method `getWebPagePreview` now accepts `formattedText` instead of plain `string`. +* Added field `phone_number` to `authenticationCodeInfo`, which contains a phone number that is being authenticated. +* Added field `is_secret` to `messageAnimation`, `messagePhoto`, `messageVideo` and `messageVideoNote` classes, + which denotes whether the thumbnail for the content must be blurred and the content must be shown only while tapped. +* Added field `expires_in` to `messageLocation` for live locations. +* Added flag `can_be_reported` to `chat` class. +* Added flag `supports_streaming` to classes `video` and `inputMessageVideo`. +* Added parameter `message_ids` to `reportChat`, which can be used to report specific messages. +* Added method `checkChatUsername` for checking whether a username can be set for a chat. +* Added method `getRepliedMessage`, which returns a message that is replied by a given message. +* Added method `getChatPinnedMessage`, which returns the pinned message from a chat. +* Added method `searchStickers` to search by emoji for popular stickers suggested by the server. +* Added method `searchStickerSets` to search by title and name for popular sticker sets suggested by the server. +* Added method `searchInstalledStickerSets` to search by title and name for installed sticker sets. +* Added methods for handling connected websites: `getConnectedWebsites`, `disconnectWebsite` and + `disconnectAllWebsites`. +* Added method `getCountryCode`, which uses current user IP to identify their country. +* Added option `t_me_url`. +* Fixed `BlackBerry` spelling in `deviceTokenBlackBerryPush`. +* Fixed return type of `getChatMessageByDate` method, which is `Message` and not `Messages`. +* Ensured that updateOption("my_id") comes before `updateAuthorizationState` with `authorizationStateReady`. +* Numerous optimizations and bug fixes. + +----------------------------------------------------------------------------------------------------------------------- + Changes in 1.1.1: * Fixed C JSON bindings compilation error. * Fixed locale-dependent JSON generation. diff --git a/CMakeLists.txt b/CMakeLists.txt index 0bf0dd1dd..5e2a62602 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR) -project(TDLib VERSION 1.1.6 LANGUAGES CXX C) +project(TDLib VERSION 1.2.0 LANGUAGES CXX C) # Prevent in-source build get_filename_component(TD_REAL_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}" REALPATH) @@ -45,11 +45,11 @@ if (POLICY CMP0069) if (IPO_SUPPORTED) # set_property(DIRECTORY PROPERTY INTERPROCEDURAL_OPTIMIZATION TRUE) do not work? string(REPLACE ";" " " CXX_FLAGS_IPO "${CMAKE_CXX_COMPILE_OPTIONS_IPO}") - message(STATUS "Use link time CXX optimization options: ${CXX_FLAGS_IPO}") + message(STATUS "Use link time optimization CXX options: ${CXX_FLAGS_IPO}") set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} ${CXX_FLAGS_IPO}") string(REPLACE ";" " " C_FLAGS_IPO "${CMAKE_C_COMPILE_OPTIONS_IPO}") - message(STATUS "Use link time C optimization options: ${C_FLAGS_IPO}") + message(STATUS "Use link time optimization C options: ${C_FLAGS_IPO}") set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} ${C_FLAGS_IPO}") string(REPLACE ";" " " LINK_FLAGS_IPO "${CMAKE_CXX_LINK_OPTIONS_IPO}") diff --git a/README.md b/README.md index 9d9b0bbd1..9e9a6529a 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,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.1.6 REQUIRED) +find_package(Td 1.2.0 REQUIRED) target_link_libraries(YourTarget PRIVATE Td::TdStatic) ``` See [example/cpp/CMakeLists.txt](https://github.com/tdlib/td/tree/master/example/cpp/CMakeLists.txt). diff --git a/example/cpp/CMakeLists.txt b/example/cpp/CMakeLists.txt index 3afa2298e..3e7794d4f 100644 --- a/example/cpp/CMakeLists.txt +++ b/example/cpp/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR) project(TdExample VERSION 1.0 LANGUAGES CXX) -find_package(Td 1.1.6 REQUIRED) +find_package(Td 1.2.0 REQUIRED) add_executable(tdjson_example tdjson_example.cpp) target_link_libraries(tdjson_example PRIVATE Td::TdJson) diff --git a/example/uwp/extension.vsixmanifest b/example/uwp/extension.vsixmanifest index 43f15573e..cfcfdb57a 100644 --- a/example/uwp/extension.vsixmanifest +++ b/example/uwp/extension.vsixmanifest @@ -1,6 +1,6 @@ - + TDLib for Universal Windows Platform TDLib is a library for building Telegram clients https://core.telegram.org/tdlib diff --git a/td/telegram/Td.cpp b/td/telegram/Td.cpp index 9627ba20c..a150e6cca 100644 --- a/td/telegram/Td.cpp +++ b/td/telegram/Td.cpp @@ -4466,7 +4466,7 @@ Status Td::init(DbKey key) { }; send_closure( actor_id(this), &Td::send_update, - make_tl_object("version", make_tl_object(tdlib_version))); + make_tl_object("version", make_tl_object(TDLIB_VERSION))); G()->set_shared_config( std::make_unique(G()->td_db()->get_config_pmc(), std::make_unique())); @@ -4829,7 +4829,7 @@ Status Td::set_parameters(td_api::object_ptr parameters } if (options.api_id != 21724) { options.application_version += ", TDLib "; - options.application_version += tdlib_version; + options.application_version += TDLIB_VERSION; } G()->set_mtproto_header(std::make_unique(options)); @@ -6544,7 +6544,7 @@ void Td::on_request(uint64 id, td_api::getOption &request) { break; case 'v': if (request.name_ == "version") { - option_value = make_tl_object(tdlib_version); + option_value = make_tl_object(TDLIB_VERSION); } break; } @@ -7031,6 +7031,6 @@ void Td::on_request(uint64 id, td_api::testCallVectorStringObject &request) { #undef CREATE_REQUEST #undef CREATE_REQUEST_PROMISE -constexpr const char *Td::tdlib_version; +constexpr const char *Td::TDLIB_VERSION; } // namespace td diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 99eb386cf..69595ef15 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -193,7 +193,7 @@ class Td final : public NetQueryCallback { static td_api::object_ptr static_request(td_api::object_ptr function); private: - static constexpr const char *tdlib_version = "1.1.6"; + static constexpr const char *TDLIB_VERSION = "1.2.0"; static constexpr int64 ONLINE_ALARM_ID = 0; static constexpr int32 ONLINE_TIMEOUT = 240; static constexpr int64 PING_SERVER_ALARM_ID = -1;