Move dummyUpdate/updateSentMessage to UpdatesManager.

This commit is contained in:
levlam 2021-01-16 01:51:01 +03:00
parent 004876dcf0
commit 0e961b0be7
3 changed files with 55 additions and 56 deletions

View File

@ -83,11 +83,6 @@
namespace td {
void dummyUpdate::store(TlStorerToString &s, const char *field_name) const {
s.store_class_begin(field_name, "dummyUpdate");
s.store_class_end();
}
class GetDialogFiltersQuery : public Td::ResultHandler {
Promise<vector<tl_object_ptr<telegram_api::dialogFilter>>> promise_;

View File

@ -67,7 +67,6 @@
#include "td/utils/Slice.h"
#include "td/utils/Status.h"
#include "td/utils/StringBuilder.h"
#include "td/utils/tl_storers.h"
#include <array>
#include <functional>
@ -94,56 +93,6 @@ class MultiSequenceDispatcher;
class Td;
class dummyUpdate : public telegram_api::Update {
public:
static constexpr int32 ID = 1234567891;
int32 get_id() const override {
return ID;
}
void store(TlStorerUnsafe &s) const override {
UNREACHABLE();
}
void store(TlStorerCalcLength &s) const override {
UNREACHABLE();
}
void store(TlStorerToString &s, const char *field_name) const override;
};
class updateSentMessage : public telegram_api::Update {
public:
int64 random_id_;
MessageId message_id_;
int32 date_;
updateSentMessage(int64 random_id, MessageId message_id, int32 date)
: random_id_(random_id), message_id_(message_id), date_(date) {
}
static constexpr int32 ID = 1234567890;
int32 get_id() const override {
return ID;
}
void store(TlStorerUnsafe &s) const override {
UNREACHABLE();
}
void store(TlStorerCalcLength &s) const override {
UNREACHABLE();
}
void store(TlStorerToString &s, const char *field_name) const override {
s.store_class_begin(field_name, "updateSentMessage");
s.store_field("random_id", random_id_);
s.store_field("message_id", message_id_.get());
s.store_field("date", date_);
s.store_class_end();
}
};
class MessagesManager : public Actor {
public:
// static constexpr int32 MESSAGE_FLAG_IS_UNREAD = 1 << 0;

View File

@ -10,6 +10,7 @@
#include "td/telegram/ChatId.h"
#include "td/telegram/DialogId.h"
#include "td/telegram/InputGroupCallId.h"
#include "td/telegram/MessageId.h"
#include "td/telegram/PtsManager.h"
#include "td/telegram/telegram_api.h"
#include "td/telegram/UserId.h"
@ -20,6 +21,7 @@
#include "td/utils/common.h"
#include "td/utils/logging.h"
#include "td/utils/tl_storers.h"
#include <map>
#include <unordered_set>
@ -30,6 +32,59 @@ extern int VERBOSITY_NAME(get_difference);
class Td;
class dummyUpdate : public telegram_api::Update {
public:
static constexpr int32 ID = 1234567891;
int32 get_id() const override {
return ID;
}
void store(TlStorerUnsafe &s) const override {
UNREACHABLE();
}
void store(TlStorerCalcLength &s) const override {
UNREACHABLE();
}
void store(TlStorerToString &s, const char *field_name) const override {
s.store_class_begin(field_name, "dummyUpdate");
s.store_class_end();
}
};
class updateSentMessage : public telegram_api::Update {
public:
int64 random_id_;
MessageId message_id_;
int32 date_;
updateSentMessage(int64 random_id, MessageId message_id, int32 date)
: random_id_(random_id), message_id_(message_id), date_(date) {
}
static constexpr int32 ID = 1234567890;
int32 get_id() const override {
return ID;
}
void store(TlStorerUnsafe &s) const override {
UNREACHABLE();
}
void store(TlStorerCalcLength &s) const override {
UNREACHABLE();
}
void store(TlStorerToString &s, const char *field_name) const override {
s.store_class_begin(field_name, "updateSentMessage");
s.store_field("random_id", random_id_);
s.store_field("message_id", message_id_.get());
s.store_field("date", date_);
s.store_class_end();
}
};
class UpdatesManager : public Actor {
public:
UpdatesManager(Td *td, ActorShared<> parent);