#include
class TDLibReceiver : public QThread
{
Q_OBJECT
void run() Q_DECL_OVERRIDE {
receiverLoop();
}
public:
explicit TDLibReceiver(void *tdLibClient, QObject *parent = nullptr);
void setActive(const bool &active);
signals:
void versionDetected(const QString &version);
void authorizationStateChanged(const QString &authorizationState);
void optionUpdated(const QString &optionName, const QVariant &optionValue);
void connectionStateChanged(const QString &connectionState);
void userUpdated(const QVariantMap &userInformation);
void userStatusUpdated(const QString &userId, const QVariantMap &userStatusInformation);
void fileUpdated(const QVariantMap &fileInformation);
void newChatDiscovered(const QVariantMap &chatInformation);
void unreadMessageCountUpdated(const QVariantMap &messageCountInformation);
void unreadChatCountUpdated(const QVariantMap &chatCountInformation);
void chatLastMessageUpdated(const QString &chatId, const QString &order, const QVariantMap &lastMessage);
void chatOrderUpdated(const QString &chatId, const QString &order);
void chatReadInboxUpdated(const QString &chatId, const int &unreadCount);
void basicGroupUpdated(const QString &groupId, const QVariantMap &groupInformation);
void superGroupUpdated(const QString &groupId, const QVariantMap &groupInformation);
void chatOnlineMemberCountUpdated(const QString &chatId, const int &onlineMemberCount);
void messagesReceived(const QVariantList &messages);
void newMessageReceived(const QString &chatId, const QVariantMap &message);
private:
void *tdLibClient;
bool isActive;
void receiverLoop();
void processReceivedDocument(const QJsonDocument &receivedJsonDocument);
void processUpdateOption(const QVariantMap &receivedInformation);
void processUpdateAuthorizationState(const QVariantMap &receivedInformation);
void processUpdateConnectionState(const QVariantMap &receivedInformation);
void processUpdateUser(const QVariantMap &receivedInformation);
void processUpdateUserStatus(const QVariantMap &receivedInformation);
void processUpdateFile(const QVariantMap &receivedInformation);
void processUpdateNewChat(const QVariantMap &receivedInformation);
void processUpdateUnreadMessageCount(const QVariantMap &receivedInformation);
void processUpdateUnreadChatCount(const QVariantMap &receivedInformation);
void processUpdateChatLastMessage(const QVariantMap &receivedInformation);
void processUpdateChatOrder(const QVariantMap &receivedInformation);
void processUpdateChatReadInbox(const QVariantMap &receivedInformation);
void processUpdateBasicGroup(const QVariantMap &receivedInformation);
void processUpdateSuperGroup(const QVariantMap &receivedInformation);
void processChatOnlineMemberCountUpdated(const QVariantMap &receivedInformation);
void processMessages(const QVariantMap &receivedInformation);
void processUpdateNewMessage(const QVariantMap &receivedInformation);
};
#endif // TDLIBRECEIVER_H
|