Minor fixes.

GitOrigin-RevId: ef4e2cfe4f198caec26daf04423eb26afedde5bb
This commit is contained in:
levlam 2020-09-24 19:15:42 +03:00
parent e0adaebb91
commit 90ee4bd63c
15 changed files with 25 additions and 20 deletions

View File

@ -1975,7 +1975,7 @@ callProtocol udp_p2p:Bool udp_reflector:Bool min_layer:int32 max_layer:int32 lib
//@description A Telegram call reflector @peer_tag A peer tag to be used with the reflector //@description A Telegram call reflector @peer_tag A peer tag to be used with the reflector
callServerTypeTelegramReflector peer_tag:bytes = CallServerType; callServerTypeTelegramReflector peer_tag:bytes = CallServerType;
//@description A WebRTC server @username Username to be used for authentification @password Authentication password @supports_turn True, if the server supports TURN @supports_stun True, if the server supports STUN //@description A WebRTC server @username Username to be used for authentication @password Authentication password @supports_turn True, if the server supports TURN @supports_stun True, if the server supports STUN
callServerTypeWebrtc username:string password:string supports_turn:Bool supports_stun:Bool = CallServerType; callServerTypeWebrtc username:string password:string supports_turn:Bool supports_stun:Bool = CallServerType;

View File

@ -60,7 +60,6 @@
#include <algorithm> #include <algorithm>
#include <limits> #include <limits>
#include <tuple> #include <tuple>
#include <type_traits>
#include <utility> #include <utility>
namespace td { namespace td {

View File

@ -12,9 +12,12 @@
#include "td/telegram/telegram_api.h" #include "td/telegram/telegram_api.h"
#include "td/utils/buffer.h" #include "td/utils/buffer.h"
#include "td/utils/logging.h"
#include "td/utils/misc.h" #include "td/utils/misc.h"
#include "td/utils/Random.h" #include "td/utils/Random.h"
#include "td/utils/Slice.h"
#include "td/utils/Status.h" #include "td/utils/Status.h"
#include "td/utils/Time.h"
namespace td { namespace td {

View File

@ -23,7 +23,7 @@ class Td;
class CountryInfoManager : public Actor { class CountryInfoManager : public Actor {
public: public:
explicit CountryInfoManager(Td *td, ActorShared<> parent); CountryInfoManager(Td *td, ActorShared<> parent);
void get_countries(Promise<td_api::object_ptr<td_api::countries>> &&promise); void get_countries(Promise<td_api::object_ptr<td_api::countries>> &&promise);

View File

@ -11,6 +11,7 @@
#include "td/telegram/Td.h" #include "td/telegram/Td.h"
#include "td/telegram/WebPagesManager.h" #include "td/telegram/WebPagesManager.h"
#include "td/utils/common.h"
#include "td/utils/logging.h" #include "td/utils/logging.h"
namespace td { namespace td {

View File

@ -7,6 +7,7 @@
#pragma once #pragma once
#include "td/telegram/MessageEntity.h" #include "td/telegram/MessageEntity.h"
#include "td/telegram/MessageId.h"
#include "td/telegram/ReplyMarkup.h" #include "td/telegram/ReplyMarkup.h"
#include "td/utils/common.h" #include "td/utils/common.h"

View File

@ -6,7 +6,10 @@
// //
#include "td/telegram/MessageReplyInfo.h" #include "td/telegram/MessageReplyInfo.h"
#include "td/telegram/ServerMessageId.h"
#include "td/utils/logging.h" #include "td/utils/logging.h"
#include "td/utils/misc.h"
namespace td { namespace td {
@ -51,7 +54,8 @@ MessageReplyInfo::MessageReplyInfo(tl_object_ptr<telegram_api::messageReplies> &
last_read_inbox_message_id = MessageId(ServerMessageId(reply_info->read_max_id_)); last_read_inbox_message_id = MessageId(ServerMessageId(reply_info->read_max_id_));
} }
if (last_read_inbox_message_id > max_message_id) { if (last_read_inbox_message_id > max_message_id) {
LOG(ERROR) << "Receive last_read_inbox_message_id = " << last_read_inbox_message_id << ", but max_message_id = " << max_message_id; LOG(ERROR) << "Receive last_read_inbox_message_id = " << last_read_inbox_message_id
<< ", but max_message_id = " << max_message_id;
max_message_id = last_read_inbox_message_id; max_message_id = last_read_inbox_message_id;
} }
} }

View File

@ -396,7 +396,6 @@ class GetDialogUnreadMarksQuery : public Td::ResultHandler {
}; };
class GetDiscussionMessageQuery : public Td::ResultHandler { class GetDiscussionMessageQuery : public Td::ResultHandler {
private:
Promise<vector<FullMessageId>> promise_; Promise<vector<FullMessageId>> promise_;
DialogId dialog_id_; DialogId dialog_id_;
MessageId message_id_; MessageId message_id_;

View File

@ -1157,11 +1157,11 @@ class MessagesManager : public Actor {
MessageId reply_markup_message_id; MessageId reply_markup_message_id;
DialogNotificationSettings notification_settings; DialogNotificationSettings notification_settings;
unique_ptr<DraftMessage> draft_message; unique_ptr<DraftMessage> draft_message;
LogeventIdWithGeneration save_draft_message_log_event_id; LogEventIdWithGeneration save_draft_message_log_event_id;
LogeventIdWithGeneration save_notification_settings_log_event_id; LogEventIdWithGeneration save_notification_settings_log_event_id;
std::unordered_map<int64, LogeventIdWithGeneration> read_history_log_event_ids; std::unordered_map<int64, LogEventIdWithGeneration> read_history_log_event_ids;
std::unordered_set<MessageId, MessageIdHash> updated_read_history_message_ids; std::unordered_set<MessageId, MessageIdHash> updated_read_history_message_ids;
LogeventIdWithGeneration set_folder_id_log_event_id; LogEventIdWithGeneration set_folder_id_log_event_id;
FolderId folder_id; FolderId folder_id;
vector<DialogListId> dialog_list_ids; // TODO replace with mask vector<DialogListId> dialog_list_ids; // TODO replace with mask

View File

@ -9,7 +9,6 @@
#include "td/utils/format.h" #include "td/utils/format.h"
#include "td/utils/logging.h" #include "td/utils/logging.h"
#include "td/utils/misc.h" #include "td/utils/misc.h"
#include "td/utils/ScopeGuard.h"
#include <limits> #include <limits>
#include <numeric> #include <numeric>

View File

@ -12,10 +12,11 @@
#include "tddb/td/db/binlog/BinlogHelper.h" #include "tddb/td/db/binlog/BinlogHelper.h"
#include "td/utils/logging.h" #include "td/utils/logging.h"
#include "td/utils/Status.h"
namespace td { namespace td {
void add_log_event(LogeventIdWithGeneration &log_event_id, const Storer &storer, uint32 type, Slice name) { void add_log_event(LogEventIdWithGeneration &log_event_id, const Storer &storer, uint32 type, Slice name) {
LOG(INFO) << "Save " << name << " to binlog"; LOG(INFO) << "Save " << name << " to binlog";
if (log_event_id.log_event_id == 0) { if (log_event_id.log_event_id == 0) {
log_event_id.log_event_id = binlog_add(G()->td_db()->get_binlog(), type, storer); log_event_id.log_event_id = binlog_add(G()->td_db()->get_binlog(), type, storer);
@ -27,7 +28,7 @@ void add_log_event(LogeventIdWithGeneration &log_event_id, const Storer &storer,
log_event_id.generation++; log_event_id.generation++;
} }
void delete_log_event(LogeventIdWithGeneration &log_event_id, uint64 generation, Slice name) { void delete_log_event(LogEventIdWithGeneration &log_event_id, uint64 generation, Slice name) {
LOG(INFO) << "Finish to process " << name << " log event " << log_event_id.log_event_id << " with generation " LOG(INFO) << "Finish to process " << name << " log event " << log_event_id.log_event_id << " with generation "
<< generation; << generation;
if (log_event_id.generation == generation) { if (log_event_id.generation == generation) {

View File

@ -9,20 +9,21 @@
#include "td/actor/PromiseFuture.h" #include "td/actor/PromiseFuture.h"
#include "td/utils/common.h" #include "td/utils/common.h"
#include "td/utils/Status.h" #include "td/utils/Slice.h"
#include "td/utils/StorerBase.h"
#include "td/utils/Time.h" #include "td/utils/Time.h"
#include "td/utils/tl_helpers.h" #include "td/utils/tl_helpers.h"
namespace td { namespace td {
struct LogeventIdWithGeneration { struct LogEventIdWithGeneration {
uint64 log_event_id = 0; uint64 log_event_id = 0;
uint64 generation = 0; uint64 generation = 0;
}; };
void add_log_event(LogeventIdWithGeneration &log_event_id, const Storer &storer, uint32 type, Slice name); void add_log_event(LogEventIdWithGeneration &log_event_id, const Storer &storer, uint32 type, Slice name);
void delete_log_event(LogeventIdWithGeneration &log_event_id, uint64 generation, Slice name); void delete_log_event(LogEventIdWithGeneration &log_event_id, uint64 generation, Slice name);
Promise<Unit> get_erase_log_event_promise(uint64 log_event_id, Promise<Unit> promise = Promise<Unit>()); Promise<Unit> get_erase_log_event_promise(uint64 log_event_id, Promise<Unit> promise = Promise<Unit>());

View File

@ -127,7 +127,6 @@ class Session final
// Do not invalidate iterators of these two containers! // Do not invalidate iterators of these two containers!
// TODO: better data structures // TODO: better data structures
struct PriorityQueue { struct PriorityQueue {
public:
void push(NetQueryPtr query); void push(NetQueryPtr query);
NetQueryPtr pop(); NetQueryPtr pop();
bool empty() const; bool empty() const;

View File

@ -128,8 +128,7 @@ ActorId<SelfT> Actor::actor_id(SelfT *self) {
template <class SelfT> template <class SelfT>
ActorShared<SelfT> Actor::actor_shared(SelfT *self, uint64 id) { ActorShared<SelfT> Actor::actor_shared(SelfT *self, uint64 id) {
CHECK(static_cast<Actor *>(self) == this); CHECK(static_cast<Actor *>(self) == this);
// TODO replace with CHECK CHECK(id != 0);
LOG_IF(ERROR, id == 0) << "ActorShared with token 0 must not be created";
return ActorShared<SelfT>(actor_id(self), id); return ActorShared<SelfT>(actor_id(self), id);
} }

View File

@ -13,7 +13,6 @@
#include "td/utils/port/wstring_convert.h" #include "td/utils/port/wstring_convert.h"
#endif #endif
#include <cstring>
#include <unordered_map> #include <unordered_map>
#if TD_PORT_WINDOWS && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP) #if TD_PORT_WINDOWS && WINAPI_FAMILY_PARTITION(WINAPI_PARTITION_DESKTOP)