|
|
|
|
@ -11,6 +11,7 @@
|
|
|
|
|
#include "telegram-bot-api/WebhookActor.h"
|
|
|
|
|
|
|
|
|
|
#include "td/telegram/ClientActor.h"
|
|
|
|
|
#include "td/telegram/td_api.h"
|
|
|
|
|
|
|
|
|
|
#include "td/actor/actor.h"
|
|
|
|
|
#include "td/actor/PromiseFuture.h"
|
|
|
|
|
@ -35,12 +36,12 @@ struct ClientParameters;
|
|
|
|
|
|
|
|
|
|
namespace td_api = td::td_api;
|
|
|
|
|
|
|
|
|
|
class Client : public WebhookActor::Callback {
|
|
|
|
|
class Client final : public WebhookActor::Callback {
|
|
|
|
|
public:
|
|
|
|
|
Client(td::ActorShared<> parent, const td::string &bot_token, bool is_test_dc, td::int64 tqueue_id,
|
|
|
|
|
std::shared_ptr<const ClientParameters> parameters, td::ActorId<BotStatActor> stat_actor);
|
|
|
|
|
|
|
|
|
|
void send(PromisedQueryPtr query) override;
|
|
|
|
|
void send(PromisedQueryPtr query) final;
|
|
|
|
|
|
|
|
|
|
void close();
|
|
|
|
|
|
|
|
|
|
@ -519,11 +520,11 @@ class Client : public WebhookActor::Callback {
|
|
|
|
|
Status process_get_webhook_info_query(PromisedQueryPtr &query);
|
|
|
|
|
Status process_get_file_query(PromisedQueryPtr &query);
|
|
|
|
|
|
|
|
|
|
void webhook_verified(td::string cached_ip_address) override;
|
|
|
|
|
void webhook_success() override;
|
|
|
|
|
void webhook_error(Status status) override;
|
|
|
|
|
void webhook_closed(Status status) override;
|
|
|
|
|
void hangup_shared() override;
|
|
|
|
|
void webhook_verified(td::string cached_ip_address) final;
|
|
|
|
|
void webhook_success() final;
|
|
|
|
|
void webhook_error(Status status) final;
|
|
|
|
|
void webhook_closed(Status status) final;
|
|
|
|
|
void hangup_shared() final;
|
|
|
|
|
int32 get_webhook_max_connections(const Query *query) const;
|
|
|
|
|
static bool get_webhook_fix_ip_address(const Query *query);
|
|
|
|
|
void do_set_webhook(PromisedQueryPtr query, bool was_deleted);
|
|
|
|
|
@ -562,13 +563,13 @@ class Client : public WebhookActor::Callback {
|
|
|
|
|
|
|
|
|
|
void long_poll_wakeup(bool force_flag);
|
|
|
|
|
|
|
|
|
|
void start_up() override;
|
|
|
|
|
void start_up() final;
|
|
|
|
|
|
|
|
|
|
void raw_event(const td::Event::Raw &event) override;
|
|
|
|
|
void raw_event(const td::Event::Raw &event) final;
|
|
|
|
|
|
|
|
|
|
void loop() override;
|
|
|
|
|
void loop() final;
|
|
|
|
|
|
|
|
|
|
void timeout_expired() override;
|
|
|
|
|
void timeout_expired() final;
|
|
|
|
|
|
|
|
|
|
struct UserInfo {
|
|
|
|
|
enum class Type { Regular, Deleted, Bot, Unknown };
|
|
|
|
|
|