-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathtelegramtools.h
62 lines (52 loc) · 2.88 KB
/
telegramtools.h
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#ifndef TELEGRAMTOOLS_H
#define TELEGRAMTOOLS_H
#include "telegramqml_global.h"
#include "telegramenums.h"
#include "private/tqmlmessageobject.h"
#include <telegram/types/types.h>
#include <QByteArray>
#include <functional>
#include <QJSValue>
class UserObject;
class TQmlMessageObject;
class TelegramTypeQObject;
class TELEGRAMQMLSHARED_EXPORT TelegramTools
{
public:
static QByteArray identifier(const Peer &peer);
static QByteArray identifier(qint32 peerType, qint32 peerId);
static QByteArray identifier(const InputPeer &peer);
static QByteArray identifier(const Dialog &dialog);
static QByteArray identifier(const Dialog &dialog, qint32 messageId);
static QByteArray identifier(const Peer &peer, qint32 messageId);
static QByteArray identifier(const Message &message);
static QByteArray identifier(const Chat &chat);
static QByteArray identifier(const User &user);
static QByteArray identifier(const UserFull &user);
static QByteArray identifier(const ChatFull &chat);
static QByteArray identifier(const StickerSet &stickerSet);
static QByteArray identifier(const Document &document);
static QByteArray identifier(class SecretChat *secretChat);
static class InputPeer chatInputPeer(const Chat &chat);
static class InputPeer userInputPeer(const User &user);
static class InputPeer peerInputPeer(const Peer &peer, qint64 accessHash);
static class InputPeer secretChatInputPeer(class SecretChat *secretChat);
static class SecretChat *inputPeerSecretChat(const InputPeer &inputPeer, class TelegramEngine *engine);
static class Peer chatPeer(const Chat &chat);
static class Peer userPeer(const User &user);
static class Peer dialogPeer(const Dialog &dialog);
static class Peer messagePeer(const Message &message);
static class Peer messagePeer(const SecretChatMessage &message);
static class Peer inputPeerPeer(const InputPeer &inputPeer);
static class InputMedia mediaInputMedia(const MessageMedia &media);
static Message secretMessageMessage(const SecretChatMessage &smsg, class TelegramEngine *engine);
static MessageMedia decryptedMediaMessageMedia(const DecryptedMessageMedia &dmedia, const EncryptedFile &efile = EncryptedFile::typeEncryptedFileEmpty);
static MessageAction decryptedActionMessageAction(const DecryptedMessageAction &daction);
static qint64 generateRandomId();
static QString convertErrorToText(const QString &error);
static TelegramEnums::MessageType messageType(TQmlMessageObject *msg);
static TelegramTypeQObject *objectRoot(TelegramTypeQObject *object);
static void analizeUpdatesType(const UpdatesType &updates, class TelegramEngine *engine, std::function<void (const Update &update)> callback, const Message &sentMsg = Message::null);
static QString userStatus(UserObject *user, std::function<QString (const QDateTime &)> dateConversationMethod);
};
#endif // TELEGRAMTOOLS_H