Merge remote-tracking branch 'td/master'

This commit is contained in:
Andrea Cavalli 2022-03-16 19:19:55 +01:00
commit b791b36a30
6 changed files with 14 additions and 6 deletions

View File

@ -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 "")

View File

@ -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).

View File

@ -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)

View File

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

View File

@ -3274,9 +3274,17 @@ Result<vector<MessageEntity>> 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;

View File

@ -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<NetQueryStats> net_query_stats;