-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTdClientWrapper.hpp
46 lines (37 loc) · 1006 Bytes
/
TdClientWrapper.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#ifndef TDCLIENTWRAPPER_HPP
#define TDCLIENTWRAPPER_HPP
#include "td/telegram/td_log.h"
#include "td/telegram/td_api.h"
#include "td/telegram/td_api.hpp"
#include <QObject>
#include <QVariantMap>
#include "src/ReceiveObject.hpp"
#include "src/ParserObject.hpp"
#include <QTimer>
class TdClientWrapper : public QObject
{
Q_OBJECT
void *client;
bool are_authorized_{false};
bool need_restart_{false};
std::uint64_t current_query_id_{0};
std::uint64_t authentication_query_id_{0};
ReceiveObject *receiveObject;
ParserObject *parserObject;
QThread *thread;
QThread *parserThread;
QTimer timer;
public:
explicit TdClientWrapper(QObject *parent = 0);
void loop();
std::string getResponse();
signals:
void logEmitted(QString log);
void updateNewMessage(QVariantMap msg);
public slots:
void setPhone(QString number);
void setCode(QString code);
void getChats();
void Log(const QString &str);
};
#endif // TDCLIENTWRAPPER_HPP