Merge commit 'eb80924dad30af4e6d8385d058bb7e847174df5e'

This commit is contained in:
Andrea Cavalli 2020-12-02 23:31:03 +01:00
commit b47fab11cd
14 changed files with 47 additions and 28 deletions

View File

@ -1,4 +1,4 @@
Changes in 1.7.0:
Changes in 1.7.0 (28 Nov 2020):
* Added a new simplified JSON interface in which updates and responses to requests from all TDLib instances
are received in the same thread:
@ -287,8 +287,11 @@ Changes in 1.7.0:
* Added the field `progressive_sizes` to the class `photo` to allow partial progressive JPEG photo download.
* Added the field `redirect_stderr` to the class `logStreamFile` to allow explicit control over stderr redirection to
the log file.
* Added the read-only option "can_archive_and_mute_new_chats_from_unknown_users", which can be used to check, whether
the option "archive_and_mute_new_chats_from_unknown_users" can be changed.
* Added the writable option "archive_and_mute_new_chats_from_unknown_users", which can be used to automatically archive
and mute new chats from non-contacts. The option can be set only if the change was suggested by the server.
and mute new chats from non-contacts. The option can be set only if the option
"can_archive_and_mute_new_chats_from_unknown_users" is true.
* Added the writable option "message_unload_delay", which can be used to change the minimum delay before messages are
unloaded from the memory.
* Added the writable option "disable_persistent_network_statistics", which can be used to disable persistent

View File

@ -1,6 +1,6 @@
cmake_minimum_required(VERSION 3.0.2 FATAL_ERROR)
project(TDLib VERSION 1.6.10 LANGUAGES CXX C)
project(TDLib VERSION 1.7.0 LANGUAGES CXX C)
if (NOT DEFINED CMAKE_MODULE_PATH)
set(CMAKE_MODULE_PATH "")

View File

@ -214,7 +214,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.6.10 REQUIRED)
find_package(Td 1.7.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).

View File

@ -715,7 +715,7 @@ function onOptionsChanged() {
commands.push('git clone https://github.com/tdlib/td.git');
commands.push('cd td');
// commands.push('git checkout v1.6.0');
commands.push('git checkout v1.7.0');
if (use_vcpkg) {
commands.push('git clone https://github.com/Microsoft/vcpkg.git');

View File

@ -169,7 +169,7 @@ See [project.scarlet](https://github.com/aaugmentum/project.scarlet), [tdlib](ht
TDLib can be used from the Rust programming language through the [JSON](https://github.com/tdlib/td#using-json) interface.
See [tdlib-rs](https://github.com/agnipau/tdlib-rs], which contains automatically generated classes for all TDLib API methods and objects.
See [tdlib-rs](https://github.com/agnipau/tdlib-rs), which contains automatically generated classes for all TDLib API methods and objects.
See [rtdlib](https://github.com/fewensa/rtdlib), [tdlib-rs](https://github.com/d653/tdlib-rs), [tdlib-futures](https://github.com/yuri91/tdlib-futures),
[tdlib-sys](https://github.com/nuxeh/tdlib-sys), [rust-tdlib](https://github.com/lattenwald/rust-tdlib), or

View File

@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 3.1 FATAL_ERROR)
project(TdExample VERSION 1.0 LANGUAGES CXX)
find_package(Td 1.6.10 REQUIRED)
find_package(Td 1.7.0 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.6.10" Language="en-US" Publisher="Telegram LLC" />
<Identity Id="Telegram.Td.UWP" Version="1.7.0" 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

@ -1,7 +1,7 @@
{
"name": "tdweb",
"version": "1.6.9",
"description": "Javascript interface for TDLib (telegram library)",
"version": "1.7.0",
"description": "JavaScript interface for TDLib (Telegram library)",
"main": "dist/tdweb.js",
"repository": {
"type": "git",

View File

@ -649,7 +649,7 @@ messageForwardOriginHiddenUser sender_name:string = MessageForwardOrigin;
//@description The message was originally a post in a channel
//@chat_id Identifier of the chat from which the message was originally forwarded
//@message_id Message identifier of the original message; 0 if unknown
//@message_id Message identifier of the original message
//@author_signature Original post author signature
messageForwardOriginChannel chat_id:int53 message_id:int53 author_signature:string = MessageForwardOrigin;

View File

@ -1483,6 +1483,7 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
string animation_search_provider;
string animation_search_emojis;
vector<SuggestedAction> suggested_actions;
bool can_archive_and_mute_new_chats_from_unknown_users = false;
if (config->get_id() == telegram_api::jsonObject::ID) {
for (auto &key_value : static_cast<telegram_api::jsonObject *>(config.get())->value_) {
Slice key = key_value->key_;
@ -1630,6 +1631,15 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
}
continue;
}
if (key == "autoarchive_setting_available") {
if (value->get_id() == telegram_api::jsonBool::ID) {
can_archive_and_mute_new_chats_from_unknown_users =
std::move(static_cast<telegram_api::jsonBool *>(value)->value_);
} else {
LOG(ERROR) << "Receive unexpected autoarchive_setting_available " << to_string(*value);
}
continue;
}
new_values.push_back(std::move(key_value));
}
@ -1677,6 +1687,12 @@ void ConfigManager::process_app_config(tl_object_ptr<telegram_api::JSONValue> &c
} else {
shared_config.set_option_string("animation_search_emojis", animation_search_emojis);
}
if (!can_archive_and_mute_new_chats_from_unknown_users) {
shared_config.set_option_empty("can_archive_and_mute_new_chats_from_unknown_users");
} else {
shared_config.set_option_boolean("can_archive_and_mute_new_chats_from_unknown_users",
can_archive_and_mute_new_chats_from_unknown_users);
}
shared_config.set_option_empty("default_ton_blockchain_config");
shared_config.set_option_empty("default_ton_blockchain_name");

View File

@ -165,12 +165,12 @@ tl_object_ptr<telegram_api::SendMessageAction> DialogAction::get_input_send_mess
return make_tl_object<telegram_api::sendMessageGeoLocationAction>();
case Type::ChoosingContact:
return make_tl_object<telegram_api::sendMessageChooseContactAction>();
case Type::StartPlayingGame:
return make_tl_object<telegram_api::sendMessageGamePlayAction>();
case Type::RecordingVideoNote:
return make_tl_object<telegram_api::sendMessageRecordRoundAction>();
case Type::UploadingVideoNote:
return make_tl_object<telegram_api::sendMessageUploadRoundAction>(progress_);
case Type::StartPlayingGame:
return make_tl_object<telegram_api::sendMessageTypingAction>();
default:
UNREACHABLE();
return nullptr;
@ -199,12 +199,12 @@ tl_object_ptr<secret_api::SendMessageAction> DialogAction::get_secret_input_send
return make_tl_object<secret_api::sendMessageGeoLocationAction>();
case Type::ChoosingContact:
return make_tl_object<secret_api::sendMessageChooseContactAction>();
case Type::StartPlayingGame:
return make_tl_object<secret_api::sendMessageTypingAction>();
case Type::RecordingVideoNote:
return make_tl_object<secret_api::sendMessageRecordRoundAction>();
case Type::UploadingVideoNote:
return make_tl_object<secret_api::sendMessageUploadRoundAction>();
case Type::StartPlayingGame:
return make_tl_object<secret_api::sendMessageTypingAction>();
default:
UNREACHABLE();
return nullptr;

View File

@ -1880,9 +1880,9 @@ void StickersManager::reload_installed_sticker_sets(bool is_masks, bool force) {
}
auto &next_load_time = next_installed_sticker_sets_load_time_[is_masks];
if (!td_->auth_manager_->is_bot() && next_load_time >= -9e9 && (next_load_time < Time::now() || force)) {
if (!td_->auth_manager_->is_bot() && next_load_time >= 0 && (next_load_time < Time::now() || force)) {
LOG_IF(INFO, force) << "Reload sticker sets";
next_load_time = -1e10;
next_load_time = -1;
td_->create_handler<GetAllStickersQuery>()->send(is_masks, installed_sticker_sets_hash_[is_masks]);
}
}
@ -1893,9 +1893,9 @@ void StickersManager::reload_featured_sticker_sets(bool force) {
}
auto &next_load_time = next_featured_sticker_sets_load_time_;
if (!td_->auth_manager_->is_bot() && next_load_time >= -9e9 && (next_load_time < Time::now() || force)) {
if (!td_->auth_manager_->is_bot() && next_load_time >= 0 && (next_load_time < Time::now() || force)) {
LOG_IF(INFO, force) << "Reload trending sticker sets";
next_load_time = -1e10;
next_load_time = -1;
td_->create_handler<GetFeaturedStickerSetsQuery>()->send(featured_sticker_sets_hash_);
}
}
@ -5018,9 +5018,9 @@ void StickersManager::reload_recent_stickers(bool is_attached, bool force) {
}
auto &next_load_time = next_recent_stickers_load_time_[is_attached];
if (!td_->auth_manager_->is_bot() && next_load_time >= -9e9 && (next_load_time < Time::now() || force)) {
if (!td_->auth_manager_->is_bot() && next_load_time >= 0 && (next_load_time < Time::now() || force)) {
LOG_IF(INFO, force) << "Reload recent " << (is_attached ? "attached " : "") << "stickers";
next_load_time = -1e10;
next_load_time = -1;
td_->create_handler<GetRecentStickersQuery>()->send(false, is_attached, recent_stickers_hash_[is_attached]);
}
}
@ -5441,9 +5441,9 @@ void StickersManager::reload_favorite_stickers(bool force) {
}
auto &next_load_time = next_favorite_stickers_load_time_;
if (!td_->auth_manager_->is_bot() && next_load_time >= -9e9 && (next_load_time < Time::now() || force)) {
if (!td_->auth_manager_->is_bot() && next_load_time >= 0 && (next_load_time < Time::now() || force)) {
LOG_IF(INFO, force) << "Reload favorite stickers";
next_load_time = -1e10;
next_load_time = -1;
td_->create_handler<GetFavedStickersQuery>()->send(false, get_favorite_stickers_hash());
}
}

View File

@ -634,10 +634,10 @@ class StickersManager : public Actor {
vector<FileId> recent_sticker_ids_[2];
vector<FileId> favorite_sticker_ids_;
double next_installed_sticker_sets_load_time_[2] = {-1e10, -1e10};
double next_featured_sticker_sets_load_time_ = -1e10;
double next_recent_stickers_load_time_[2] = {-1e10, -1e10};
double next_favorite_stickers_load_time_ = -1e10;
double next_installed_sticker_sets_load_time_[2] = {0, 0};
double next_featured_sticker_sets_load_time_ = 0;
double next_recent_stickers_load_time_[2] = {0, 0};
double next_favorite_stickers_load_time_ = 0;
int32 installed_sticker_sets_hash_[2] = {0, 0};
int32 featured_sticker_sets_hash_ = 0;

View File

@ -241,7 +241,7 @@ class Td final : public NetQueryCallback {
static td_api::object_ptr<td_api::Object> static_request(td_api::object_ptr<td_api::Function> function);
private:
static constexpr const char *TDLIB_VERSION = "1.6.10";
static constexpr const char *TDLIB_VERSION = "1.7.0";
static constexpr int64 ONLINE_ALARM_ID = 0;
static constexpr int64 PING_SERVER_ALARM_ID = -1;
static constexpr int32 PING_SERVER_TIMEOUT = 300;