diff --git a/CMakeLists.txt b/CMakeLists.txt index f0717c58f..53273b10d 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.1 LANGUAGES CXX C) +project(TDLib VERSION 1.8.2 LANGUAGES CXX C) if (NOT DEFINED CMAKE_MODULE_PATH) set(CMAKE_MODULE_PATH "") diff --git a/README.md b/README.md index 55a06b992..53ba953cd 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.1 REQUIRED) +find_package(Td 1.8.2 REQUIRED) target_link_libraries(YourTarget PRIVATE Td::TdStatic) ``` See [example/cpp/CMakeLists.txt](https://github.com/tdlight-team/tdlight/tree/master/example/cpp/CMakeLists.txt). diff --git a/example/cpp/CMakeLists.txt b/example/cpp/CMakeLists.txt index 061ec0be0..5a68d2593 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.1 REQUIRED) +find_package(Td 1.8.2 REQUIRED) add_executable(tdjson_example tdjson_example.cpp) target_link_libraries(tdjson_example PRIVATE Td::TdJson) diff --git a/example/uwp/extension.vsixmanifest b/example/uwp/extension.vsixmanifest index 3f66403ae..628f3019b 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/MessageEntity.cpp b/td/telegram/MessageEntity.cpp index 74b835548..25d3f8d98 100644 --- a/td/telegram/MessageEntity.cpp +++ b/td/telegram/MessageEntity.cpp @@ -3274,9 +3274,17 @@ Result> get_message_entities(const ContactsManager *contac if (!clean_input_string(entity->url_)) { return Status::Error(400, "MessageEntityTextUrl.url must be encoded in UTF-8"); } + auto user_id = LinkManager::get_link_user_id(entity->url_); + if (user_id.is_valid()) { + if (contacts_manager != nullptr && !contacts_manager->have_input_user(user_id)) { + return Status::Error(400, "Have no access to the user"); + } + entities.emplace_back(offset, length, user_id); + break; + } auto r_url = LinkManager::check_link(entity->url_); if (r_url.is_error()) { - return Status::Error(400, PSTRING() << "Wrong message input_entity: " << r_url.error().message()); + return Status::Error(400, PSTRING() << "Wrong URL entity specified: " << r_url.error().message()); } entities.emplace_back(MessageEntity::Type::TextUrl, offset, length, r_url.move_as_ok()); break; diff --git a/td/telegram/Td.h b/td/telegram/Td.h index 747637958..490f688e9 100644 --- a/td/telegram/Td.h +++ b/td/telegram/Td.h @@ -106,7 +106,7 @@ class Td final : public Actor { Td &operator=(Td &&) = delete; ~Td() final; - static constexpr const char *TDLIB_VERSION = "1.8.1"; + static constexpr const char *TDLIB_VERSION = "1.8.2"; struct Options { std::shared_ptr net_query_stats;