Minor improvements.

This commit is contained in:
levlam 2021-06-02 15:43:56 +03:00
parent dd687b2f82
commit 8db4febd4c
21 changed files with 26 additions and 27 deletions

View File

@ -39,6 +39,6 @@ This may take a while, because TDLib will be built about 10 times.
Resulting library for iOS will work on any architecture (armv7, armv7s, arm64) and even on a simulator.
We use [CMake/iOS.cmake](https://github.com/tdlib/td/blob/master/CMake/iOS.cmake) toolchain, other toolchains may work too.
Built libraries will be store in `tdjson` directory.
Built libraries will be stored in `tdjson` directory.
Documentation for all available classes and methods can be found at https://core.telegram.org/tdlib/docs.

View File

@ -17,11 +17,11 @@
#include "td/telegram/Global.h"
#include "td/telegram/logevent/LogEvent.h"
#include "td/telegram/misc.h"
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/Td.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/td_api.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/PromiseFuture.h"

View File

@ -10,6 +10,7 @@
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
#include "td/utils/Slice.h"
#include "td/utils/Status.h"
#include "td/utils/StringBuilder.h"

View File

@ -21,6 +21,7 @@
#include "td/utils/MpscPollableQueue.h"
#include "td/utils/port/RwMutex.h"
#include "td/utils/port/thread.h"
#include "td/utils/Slice.h"
#include <algorithm>
#include <atomic>

View File

@ -253,7 +253,7 @@ class ClientManager final {
* None of the TDLib methods can be called from the callback.
* By default the callback is not set.
*
* \param[in] max_verbosity_level Maximum verbosity level of messages for which the callback will be called.
* \param[in] max_verbosity_level The maximum verbosity level of messages for which the callback will be called.
* \param[in] callback Callback that will be called when a message is added to the internal TDLib log.
* Pass nullptr to remove the callback.
*/

View File

@ -121,7 +121,7 @@ public:
/// Sets the callback that will be called when a message is added to the internal TDLib log.
/// None of the TDLib methods can be called from the callback.
/// </summary>
/// <param name="max_verbosity_level">Maximum verbosity level of messages for which the callback will be called.</param>
/// <param name="max_verbosity_level">The maximum verbosity level of messages for which the callback will be called.</param>
/// <param name="callback">Callback that will be called when a message is added to the internal TDLib log.
/// Pass null to remove the callback.</param>
static void SetLogMessageCallback(std::int32_t max_verbosity_level, LogMessageCallback^ callback) {

View File

@ -10,7 +10,6 @@
#include "td/telegram/LinkManager.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
namespace td {

View File

@ -10,7 +10,6 @@
#include "td/telegram/telegram_api.h"
#include "td/utils/common.h"
#include "td/utils/Status.h"
namespace td {

View File

@ -6,12 +6,14 @@
//
#include "td/telegram/LinkManager.h"
#include "td/telegram/AccessRights.h"
#include "td/telegram/ChannelId.h"
#include "td/telegram/ConfigShared.h"
#include "td/telegram/ContactsManager.h"
#include "td/telegram/Global.h"
#include "td/telegram/MessageEntity.h"
#include "td/telegram/MessagesManager.h"
#include "td/telegram/ServerMessageId.h"
#include "td/telegram/Td.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
@ -25,6 +27,7 @@
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/StringBuilder.h"
namespace td {

View File

@ -12,8 +12,6 @@
#include "td/telegram/td_api.h"
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/Slice.h"
#include <mutex>

View File

@ -32,9 +32,9 @@
#include "td/utils/algorithm.h"
#include "td/utils/ExitGuard.h"
#include "td/utils/FileLog.h"
#include "td/utils/NullLog.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h"
#include "td/utils/NullLog.h"
#include "td/utils/port/detail/NativeFd.h"
#include "td/utils/TsLog.h"

View File

@ -11,6 +11,8 @@
#include "td/telegram/UserId.h"
#include "td/utils/common.h"
#include "td/utils/Slice.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/StackAllocator.h"
#include "td/utils/tl_helpers.h"
#include "td/utils/tl_storers.h"

View File

@ -31,7 +31,7 @@ class SecretChatsManager : public Actor {
public:
explicit SecretChatsManager(ActorShared<> parent);
// Proxy query to corrensponding SecretChatActor
// proxy query to corrensponding SecretChatActor
void on_update_chat(tl_object_ptr<telegram_api::updateEncryption> update);
void on_new_message(tl_object_ptr<telegram_api::EncryptedMessage> &&message_ptr, Promise<Unit> &&promise);
@ -47,7 +47,7 @@ class SecretChatsManager : public Actor {
void notify_screenshot_taken(SecretChatId secret_chat_id, Promise<> promise);
void send_set_ttl_message(SecretChatId secret_chat_id, int32 ttl, int64 random_id, Promise<> promise);
// Binlog replay
// binlog replay
void replay_binlog_event(BinlogEvent &&binlog_event);
void binlog_replay_finish();

View File

@ -29,8 +29,8 @@
#include "td/telegram/StickerSetId.hpp"
#include "td/telegram/StickersManager.hpp"
#include "td/telegram/Td.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/td_api.h"
#include "td/telegram/TdDb.h"
#include "td/telegram/telegram_api.h"
#include "td/actor/MultiPromise.h"

View File

@ -8,8 +8,8 @@
#include "td/telegram/AuthManager.h"
#include "td/telegram/files/FileManager.h"
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/secret_api.h"
#include "td/telegram/SecretChatActor.h"
#include "td/telegram/Td.h"
#include "td/telegram/td_api.h"
#include "td/telegram/telegram_api.h"

View File

@ -12,8 +12,8 @@
#include "td/net/HttpQuery.h"
#include "td/net/HttpReader.h"
#include "td/telegram/ClientActor.h"
#include "td/telegram/Client.h"
#include "td/telegram/ClientActor.h"
#include "td/telegram/Td.h" // for VERBOSITY_NAME(td_requests)
#include "td/telegram/td_api_json.h"

View File

@ -26,11 +26,9 @@
#include "td/utils/ScopeGuard.h"
#include "td/utils/Slice.h"
#include "td/utils/SliceBuilder.h"
#include "td/utils/StackAllocator.h"
#include "td/utils/Status.h"
#include "td/utils/tl_helpers.h"
#include "td/utils/tl_parsers.h"
#include "td/utils/tl_storers.h"
namespace td {

View File

@ -7,8 +7,6 @@
#pragma once
#include "td/utils/common.h"
#include "td/utils/Slice.h"
#include "td/utils/Status.h"
namespace td {

View File

@ -174,7 +174,7 @@ typedef void (*td_log_message_callback_ptr)(int verbosity_level, const char *mes
* None of the TDLib methods can be called from the callback.
* By default the callback is not set.
*
* \param[in] max_verbosity_level Maximum verbosity level of messages for which the callback will be called.
* \param[in] max_verbosity_level The maximum verbosity level of messages for which the callback will be called.
* \param[in] callback Callback that will be called when a message is added to the internal TDLib log.
* Pass nullptr to remove the callback.
*/

View File

@ -64,7 +64,7 @@ BufferSlice BinlogEvent::create_raw(uint64 id, int32 type, int32 flags, const St
tl_storer.store_storer(storer);
CHECK(tl_storer.get_buf() == raw_event.as_slice().uend() - TAIL_SIZE);
tl_storer.store_int(::td::crc32(raw_event.as_slice().truncate(raw_event.size() - TAIL_SIZE)));
tl_storer.store_int(crc32(raw_event.as_slice().truncate(raw_event.size() - TAIL_SIZE)));
return raw_event;
}

View File

@ -23,12 +23,12 @@ class CombinedLog : public LogInterface {
second_ = second;
}
void set_first_verbosity_level(int verbosity_level) {
first_verbosity_level_ = verbosity_level;
void set_first_verbosity_level(int new_verbosity_level) {
first_verbosity_level_ = new_verbosity_level;
}
void set_second_verbosity_level(int verbosity_level) {
second_verbosity_level_ = verbosity_level;
void set_second_verbosity_level(int new_verbosity_level) {
second_verbosity_level_ = new_verbosity_level;
}
const LogInterface *get_first() const {
@ -74,10 +74,10 @@ class CombinedLog : public LogInterface {
vector<string> get_file_paths() final {
vector<string> result;
if (first_) {
td::append(result, first_->get_file_paths());
::td::append(result, first_->get_file_paths());
}
if (second_) {
td::append(result, second_->get_file_paths());
::td::append(result, second_->get_file_paths());
}
return result;
}