Merge pull request #103 from monich/const-refs

TDLibWrapper cleanup
This commit is contained in:
Sebastian Wolf 2020-10-26 21:36:01 +01:00 committed by GitHub
commit f2f089d5b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 255 deletions

View file

@ -119,7 +119,7 @@ TDLibReceiver::TDLibReceiver(void *tdLibClient, QObject *parent) : QThread(paren
handlers.insert("users", &TDLibReceiver::processUsers);
}
void TDLibReceiver::setActive(const bool &active)
void TDLibReceiver::setActive(bool active)
{
if (active) {
LOG("Activating receiver loop...");

View file

@ -33,7 +33,7 @@ class TDLibReceiver : public QThread
}
public:
explicit TDLibReceiver(void *tdLibClient, QObject *parent = nullptr);
void setActive(const bool &active);
void setActive(bool active);
signals:
void versionDetected(const QString &version);
@ -48,12 +48,12 @@ signals:
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 QString &lastReadInboxMessageId, const int &unreadCount);
void chatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, int unreadCount);
void chatReadOutboxUpdated(const QString &chatId, const QString &lastReadOutboxMessageId);
void basicGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation);
void superGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation);
void chatOnlineMemberCountUpdated(const QString &chatId, const int &onlineMemberCount);
void messagesReceived(const QVariantList &messages, const int &totalCount);
void chatOnlineMemberCountUpdated(const QString &chatId, int onlineMemberCount);
void messagesReceived(const QVariantList &messages, int totalCount);
void newMessageReceived(const QString &chatId, const QVariantMap &message);
void messageInformation(const QString &messageId, const QVariantMap &message);
void messageSendSucceeded(const QString &messageId, const QString &oldMessageId, const QVariantMap &message);
@ -70,14 +70,14 @@ signals:
void installedStickerSetsUpdated(const QVariantList &stickerSetIds);
void stickerSets(const QVariantList &stickerSets);
void stickerSet(const QVariantMap &stickerSet);
void chatMembers(const QString &extra, const QVariantList &members, const int &totalMembers);
void chatMembers(const QString &extra, const QVariantList &members, int totalMembers);
void userFullInfo(const QVariantMap &userFullInfo);
void userFullInfoUpdated(const QString &userId,const QVariantMap &userFullInfo);
void basicGroupFullInfo(const QString &groupId, const QVariantMap &groupFullInfo);
void basicGroupFullInfoUpdated(const QString &groupId, const QVariantMap &groupFullInfo);
void supergroupFullInfo(const QString &groupId, const QVariantMap &groupFullInfo);
void supergroupFullInfoUpdated(const QString &groupId, const QVariantMap &groupFullInfo);
void userProfilePhotos(const QString &extra, const QVariantList &photos, const int &totalPhotos);
void userProfilePhotos(const QString &extra, const QVariantList &photos, int totalPhotos);
void chatPermissionsUpdated(const QString &chatId, const QVariantMap &chatPermissions);
void chatTitleUpdated(const QString &chatId, const QString &title);
void usersReceived(const QString &extra, const QVariantList &userIds, int totalUsers);

View file

@ -70,41 +70,40 @@ TDLibWrapper::TDLibWrapper(QObject *parent) : QObject(parent)
connect(this->tdLibReceiver, SIGNAL(newChatDiscovered(QVariantMap)), this, SLOT(handleNewChatDiscovered(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(unreadMessageCountUpdated(QVariantMap)), this, SLOT(handleUnreadMessageCountUpdated(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(unreadChatCountUpdated(QVariantMap)), this, SLOT(handleUnreadChatCountUpdated(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatLastMessageUpdated(QString, QString, QVariantMap)), this, SLOT(handleChatLastMessageUpdated(QString, QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatOrderUpdated(QString, QString)), this, SLOT(handleChatOrderUpdated(QString, QString)));
connect(this->tdLibReceiver, SIGNAL(chatReadInboxUpdated(QString, QString, int)), this, SLOT(handleChatReadInboxUpdated(QString, QString, int)));
connect(this->tdLibReceiver, SIGNAL(chatReadOutboxUpdated(QString, QString)), this, SLOT(handleChatReadOutboxUpdated(QString, QString)));
connect(this->tdLibReceiver, SIGNAL(chatLastMessageUpdated(QString, QString, QVariantMap)), this, SIGNAL(chatLastMessageUpdated(QString, QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatOrderUpdated(QString, QString)), this, SIGNAL(chatOrderUpdated(QString, QString)));
connect(this->tdLibReceiver, SIGNAL(chatReadInboxUpdated(QString, QString, int)), this, SIGNAL(chatReadInboxUpdated(QString, QString, int)));
connect(this->tdLibReceiver, SIGNAL(chatReadOutboxUpdated(QString, QString)), this, SIGNAL(chatReadOutboxUpdated(QString, QString)));
connect(this->tdLibReceiver, SIGNAL(basicGroupUpdated(qlonglong, QVariantMap)), this, SLOT(handleBasicGroupUpdated(qlonglong, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(superGroupUpdated(qlonglong, QVariantMap)), this, SLOT(handleSuperGroupUpdated(qlonglong, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatOnlineMemberCountUpdated(QString, int)), this, SLOT(handleChatOnlineMemberCountUpdated(QString, int)));
connect(this->tdLibReceiver, SIGNAL(messagesReceived(QVariantList, int)), this, SLOT(handleMessagesReceived(QVariantList, int)));
connect(this->tdLibReceiver, SIGNAL(newMessageReceived(QString, QVariantMap)), this, SLOT(handleNewMessageReceived(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(messageInformation(QString, QVariantMap)), this, SLOT(handleMessageInformation(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(messageSendSucceeded(QString, QString, QVariantMap)), this, SLOT(handleMessageSendSucceeded(QString, QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(activeNotificationsUpdated(QVariantList)), this, SLOT(handleUpdateActiveNotifications(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(notificationGroupUpdated(QVariantMap)), this, SLOT(handleUpdateNotificationGroup(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(notificationUpdated(QVariantMap)), this, SLOT(handleUpdateNotification(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatNotificationSettingsUpdated(QString, QVariantMap)), this, SLOT(handleChatNotificationSettingsUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(messageContentUpdated(QString, QString, QVariantMap)), this, SLOT(handleMessageContentUpdated(QString, QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(messagesDeleted(QString, QVariantList)), this, SLOT(handleMessagesDeleted(QString, QVariantList)));
connect(this->tdLibReceiver, SIGNAL(chats(QVariantMap)), this, SLOT(handleChats(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chat(QVariantMap)), this, SLOT(handleChat(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(recentStickersUpdated(QVariantList)), this, SLOT(handleRecentStickersUpdated(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(stickers(QVariantList)), this, SLOT(handleStickers(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(installedStickerSetsUpdated(QVariantList)), this, SLOT(handleInstalledStickerSetsUpdated(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(chatOnlineMemberCountUpdated(QString, int)), this, SIGNAL(chatOnlineMemberCountUpdated(QString, int)));
connect(this->tdLibReceiver, SIGNAL(messagesReceived(QVariantList, int)), this, SIGNAL(messagesReceived(QVariantList, int)));
connect(this->tdLibReceiver, SIGNAL(newMessageReceived(QString, QVariantMap)), this, SIGNAL(newMessageReceived(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(messageInformation(QString, QVariantMap)), this, SIGNAL(receivedMessage(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(messageSendSucceeded(QString, QString, QVariantMap)), this, SIGNAL(messageSendSucceeded(QString, QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(activeNotificationsUpdated(QVariantList)), this, SIGNAL(activeNotificationsUpdated(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(notificationGroupUpdated(QVariantMap)), this, SIGNAL(notificationGroupUpdated(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(notificationUpdated(QVariantMap)), this, SIGNAL(notificationUpdated(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatNotificationSettingsUpdated(QString, QVariantMap)), this, SIGNAL(chatNotificationSettingsUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(messageContentUpdated(QString, QString, QVariantMap)), this, SIGNAL(messageContentUpdated(QString, QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(messagesDeleted(QString, QVariantList)), this, SIGNAL(messagesDeleted(QString, QVariantList)));
connect(this->tdLibReceiver, SIGNAL(chats(QVariantMap)), this, SIGNAL(chatsReceived(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chat(QVariantMap)), this, SIGNAL(chatReceived(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(recentStickersUpdated(QVariantList)), this, SIGNAL(recentStickersUpdated(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(stickers(QVariantList)), this, SIGNAL(stickersReceived(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(installedStickerSetsUpdated(QVariantList)), this, SIGNAL(installedStickerSetsUpdated(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(stickerSets(QVariantList)), this, SLOT(handleStickerSets(QVariantList)));
connect(this->tdLibReceiver, SIGNAL(stickerSet(QVariantMap)), this, SLOT(handleStickerSet(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatMembers(QString, QVariantList, int)), this, SLOT(handleChatMembers(QString, QVariantList, int)));
connect(this->tdLibReceiver, SIGNAL(userFullInfo(QVariantMap)), this, SLOT(handleUserFullInfo(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(userFullInfoUpdated(QString, QVariantMap)), this, SLOT(handleUserFullInfoUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(basicGroupFullInfo(QString, QVariantMap)), this, SLOT(handleBasicGroupFullInfo(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(basicGroupFullInfoUpdated(QString, QVariantMap)), this, SLOT(handleBasicGroupFullInfoUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(supergroupFullInfo(QString, QVariantMap)), this, SLOT(handleSupergroupFullInfo(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(supergroupFullInfoUpdated(QString, QVariantMap)), this, SLOT(handleSupergroupFullInfoUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(userProfilePhotos(QString, QVariantList, int)), this, SLOT(handleUserProfilePhotos(QString, QVariantList, int)));
connect(this->tdLibReceiver, SIGNAL(userProfilePhotos(QString, QVariantList, int)), this, SLOT(handleUserProfilePhotos(QString, QVariantList, int)));
connect(this->tdLibReceiver, SIGNAL(chatPermissionsUpdated(QString, QVariantMap)), this, SLOT(handleChatPermissionsUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatTitleUpdated(QString, QString)), this, SLOT(handleChatTitleUpdated(QString, QString)));
connect(this->tdLibReceiver, SIGNAL(stickerSet(QVariantMap)), this, SIGNAL(stickerSetReceived(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatMembers(QString, QVariantList, int)), this, SIGNAL(chatMembersReceived(QString, QVariantList, int)));
connect(this->tdLibReceiver, SIGNAL(userFullInfo(QVariantMap)), this, SIGNAL(userFullInfoReceived(QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(userFullInfoUpdated(QString, QVariantMap)), this, SIGNAL(userFullInfoUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(basicGroupFullInfo(QString, QVariantMap)), this, SIGNAL(basicGroupFullInfoReceived(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(basicGroupFullInfoUpdated(QString, QVariantMap)), this, SIGNAL(basicGroupFullInfoUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(supergroupFullInfo(QString, QVariantMap)), this, SIGNAL(supergroupFullInfoReceived(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(supergroupFullInfoUpdated(QString, QVariantMap)), this, SIGNAL(supergroupFullInfoUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(userProfilePhotos(QString, QVariantList, int)), this, SIGNAL(userProfilePhotosReceived(QString, QVariantList, int)));
connect(this->tdLibReceiver, SIGNAL(chatPermissionsUpdated(QString, QVariantMap)), this, SIGNAL(chatPermissionsUpdated(QString, QVariantMap)));
connect(this->tdLibReceiver, SIGNAL(chatTitleUpdated(QString, QString)), this, SIGNAL(chatTitleUpdated(QString, QString)));
connect(this->tdLibReceiver, SIGNAL(usersReceived(QString, QVariantList, int)), this, SIGNAL(usersReceived(QString, QVariantList, int)));
connect(&emojiSearchWorker, SIGNAL(searchCompleted(QString, QVariantList)), this, SLOT(handleEmojiSearchCompleted(QString, QVariantList)));
@ -245,7 +244,7 @@ void TDLibWrapper::leaveChat(const QString &chatId)
this->sendRequest(requestObject);
}
void TDLibWrapper::getChatHistory(const QString &chatId, const qlonglong &fromMessageId, const int &offset, const int &limit, const bool &onlyLocal)
void TDLibWrapper::getChatHistory(const QString &chatId, const qlonglong &fromMessageId, int offset, int limit, bool onlyLocal)
{
LOG("Retrieving chat history" << chatId << fromMessageId << offset << limit << onlyLocal);
QVariantMap requestObject;
@ -258,7 +257,7 @@ void TDLibWrapper::getChatHistory(const QString &chatId, const qlonglong &fromMe
this->sendRequest(requestObject);
}
void TDLibWrapper::viewMessage(const QString &chatId, const QString &messageId, const bool &force = false)
void TDLibWrapper::viewMessage(const QString &chatId, const QString &messageId, bool force)
{
LOG("Mark message as viewed" << chatId << messageId);
QVariantMap requestObject;
@ -424,7 +423,7 @@ void TDLibWrapper::getMessage(const QString &chatId, const QString &messageId)
this->sendRequest(requestObject);
}
void TDLibWrapper::setOptionInteger(const QString &optionName, const int &optionValue)
void TDLibWrapper::setOptionInteger(const QString &optionName, int optionValue)
{
LOG("Setting integer option" << optionName << optionValue);
QVariantMap requestObject;
@ -474,7 +473,7 @@ void TDLibWrapper::deleteMessages(const QString &chatId, const QVariantList mess
this->sendRequest(requestObject);
}
void TDLibWrapper::getMapThumbnailFile(const QString &chatId, const double &latitude, const double &longitude, const int &width, const int &height)
void TDLibWrapper::getMapThumbnailFile(const QString &chatId, double latitude, double longitude, int width, int height)
{
LOG("Getting Map Thumbnail File" << chatId);
QVariantMap location;
@ -521,7 +520,7 @@ void TDLibWrapper::getStickerSet(const QString &setId)
requestObject.insert("set_id", setId);
this->sendRequest(requestObject);
}
void TDLibWrapper::getSupergroupMembers(const QString &groupId, const int &limit = 200, const int &offset = 0)
void TDLibWrapper::getSupergroupMembers(const QString &groupId, int limit, int offset)
{
LOG("Retrieving SupergroupMembers");
QVariantMap requestObject;
@ -533,7 +532,7 @@ void TDLibWrapper::getSupergroupMembers(const QString &groupId, const int &limit
this->sendRequest(requestObject);
}
void TDLibWrapper::getGroupFullInfo(const QString &groupId, const bool &isSuperGroup)
void TDLibWrapper::getGroupFullInfo(const QString &groupId, bool isSuperGroup)
{
LOG("Retrieving GroupFullInfo");
QVariantMap requestObject;
@ -568,7 +567,7 @@ void TDLibWrapper::createPrivateChat(const QString &userId)
this->sendRequest(requestObject);
}
void TDLibWrapper::getGroupsInCommon(const QString &userId, const int &limit, const int &offset)
void TDLibWrapper::getGroupsInCommon(const QString &userId, int limit, int offset)
{
LOG("Retrieving Groups in Common");
QVariantMap requestObject;
@ -580,7 +579,7 @@ void TDLibWrapper::getGroupsInCommon(const QString &userId, const int &limit, co
this->sendRequest(requestObject);
}
void TDLibWrapper::getUserProfilePhotos(const QString &userId, const int &limit, const int &offset)
void TDLibWrapper::getUserProfilePhotos(const QString &userId, int limit, int offset)
{
LOG("Retrieving User Profile Photos");
QVariantMap requestObject;
@ -603,7 +602,7 @@ void TDLibWrapper::setChatPermissions(const QString &chatId, const QVariantMap &
this->sendRequest(requestObject);
}
void TDLibWrapper::setChatSlowModeDelay(const QString &chatId, const int &delay)
void TDLibWrapper::setChatSlowModeDelay(const QString &chatId, int delay)
{
LOG("Setting Chat Slow Mode Delay");
@ -643,7 +642,7 @@ void TDLibWrapper::setBio(const QString &bio)
this->sendRequest(requestObject);
}
void TDLibWrapper::toggleSupergroupIsAllHistoryAvailable(const QString &groupId, const bool &isAllHistoryAvailable)
void TDLibWrapper::toggleSupergroupIsAllHistoryAvailable(const QString &groupId, bool isAllHistoryAvailable)
{
LOG("Toggling SupergroupIsAllHistoryAvailable");
QVariantMap requestObject;
@ -782,7 +781,7 @@ void TDLibWrapper::openFileOnDevice(const QString &filePath)
}
}
void TDLibWrapper::controlScreenSaver(const bool &enabled)
void TDLibWrapper::controlScreenSaver(bool enabled)
{
LOG("Controlling device screen saver" << enabled);
QDBusConnection dbusConnection = QDBusConnection::connectToBus(QDBusConnection::SystemBus, "system");
@ -943,26 +942,6 @@ void TDLibWrapper::handleUnreadChatCountUpdated(const QVariantMap &chatCountInfo
}
}
void TDLibWrapper::handleChatLastMessageUpdated(const QString &chatId, const QString &order, const QVariantMap &lastMessage)
{
emit chatLastMessageUpdated(chatId, order, lastMessage);
}
void TDLibWrapper::handleChatOrderUpdated(const QString &chatId, const QString &order)
{
emit chatOrderUpdated(chatId, order);
}
void TDLibWrapper::handleChatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, const int &unreadCount)
{
emit chatReadInboxUpdated(chatId, lastReadInboxMessageId, unreadCount);
}
void TDLibWrapper::handleChatReadOutboxUpdated(const QString &chatId, const QString &lastReadOutboxMessageId)
{
emit chatReadOutboxUpdated(chatId, lastReadOutboxMessageId);
}
void TDLibWrapper::handleBasicGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation)
{
emit basicGroupUpdated(updateGroup(groupId, groupInformation, &basicGroups)->groupId);
@ -973,86 +952,6 @@ void TDLibWrapper::handleSuperGroupUpdated(qlonglong groupId, const QVariantMap
emit superGroupUpdated(updateGroup(groupId, groupInformation, &superGroups)->groupId);
}
void TDLibWrapper::handleChatOnlineMemberCountUpdated(const QString &chatId, const int &onlineMemberCount)
{
emit chatOnlineMemberCountUpdated(chatId, onlineMemberCount);
}
void TDLibWrapper::handleMessagesReceived(const QVariantList &messages, const int &totalCount)
{
emit messagesReceived(messages, totalCount);
}
void TDLibWrapper::handleNewMessageReceived(const QString &chatId, const QVariantMap &message)
{
emit newMessageReceived(chatId, message);
}
void TDLibWrapper::handleMessageInformation(const QString &messageId, const QVariantMap &message)
{
emit receivedMessage(messageId, message);
}
void TDLibWrapper::handleMessageSendSucceeded(const QString &messageId, const QString &oldMessageId, const QVariantMap &message)
{
emit messageSendSucceeded(messageId, oldMessageId, message);
}
void TDLibWrapper::handleUpdateActiveNotifications(const QVariantList notificationGroups)
{
emit activeNotificationsUpdated(notificationGroups);
}
void TDLibWrapper::handleUpdateNotificationGroup(const QVariantMap notificationGroupUpdate)
{
emit notificationGroupUpdated(notificationGroupUpdate);
}
void TDLibWrapper::handleUpdateNotification(const QVariantMap updatedNotification)
{
emit notificationUpdated(updatedNotification);
}
void TDLibWrapper::handleChatNotificationSettingsUpdated(const QString &chatId, const QVariantMap &chatNotificationSettings)
{
emit chatNotificationSettingsUpdated(chatId, chatNotificationSettings);
}
void TDLibWrapper::handleMessageContentUpdated(const QString &chatId, const QString &messageId, const QVariantMap &newContent)
{
emit messageContentUpdated(chatId, messageId, newContent);
}
void TDLibWrapper::handleMessagesDeleted(const QString &chatId, const QVariantList &messageIds)
{
emit messagesDeleted(chatId, messageIds);
}
void TDLibWrapper::handleChats(const QVariantMap &chats)
{
emit this->chatsReceived(chats);
}
void TDLibWrapper::handleChat(const QVariantMap &chat)
{
emit this->chatReceived(chat);
}
void TDLibWrapper::handleRecentStickersUpdated(const QVariantList &stickerIds)
{
emit this->recentStickersUpdated(stickerIds);
}
void TDLibWrapper::handleStickers(const QVariantList &stickers)
{
emit this->stickersReceived(stickers);
}
void TDLibWrapper::handleInstalledStickerSetsUpdated(const QVariantList &stickerSetIds)
{
emit this->installedStickerSetsUpdated(stickerSetIds);
}
void TDLibWrapper::handleStickerSets(const QVariantList &stickerSets)
{
QListIterator<QVariant> stickerSetIterator(stickerSets);
@ -1063,67 +962,12 @@ void TDLibWrapper::handleStickerSets(const QVariantList &stickerSets)
emit this->stickerSetsReceived(stickerSets);
}
void TDLibWrapper::handleStickerSet(const QVariantMap &stickerSet)
{
emit stickerSetReceived(stickerSet);
}
void TDLibWrapper::handleEmojiSearchCompleted(const QString &queryString, const QVariantList &resultList)
{
LOG("Emoji search completed" << queryString);
emit emojiSearchSuccessful(resultList);
}
void TDLibWrapper::handleChatMembers(const QString &extra, const QVariantList &members, const int &totalMembers)
{
emit this->chatMembersReceived(extra, members, totalMembers);
}
void TDLibWrapper::handleUserFullInfo(const QVariantMap &userFullInfo)
{
emit this->userFullInfoReceived(userFullInfo);
}
void TDLibWrapper::handleUserFullInfoUpdated(const QString &userId, const QVariantMap &userFullInfo)
{
emit this->userFullInfoUpdated(userId, userFullInfo);
}
void TDLibWrapper::handleBasicGroupFullInfo(const QString &groupId, const QVariantMap &groupFullInfo)
{
emit this->basicGroupFullInfoReceived(groupId, groupFullInfo);
}
void TDLibWrapper::handleBasicGroupFullInfoUpdated(const QString &groupId, const QVariantMap &groupFullInfo)
{
emit this->basicGroupFullInfoUpdated(groupId, groupFullInfo);
}
void TDLibWrapper::handleSupergroupFullInfo(const QString &groupId, const QVariantMap &groupFullInfo)
{
emit this->supergroupFullInfoReceived(groupId, groupFullInfo);
}
void TDLibWrapper::handleSupergroupFullInfoUpdated(const QString &groupId, const QVariantMap &groupFullInfo)
{
emit this->supergroupFullInfoUpdated(groupId, groupFullInfo);
}
void TDLibWrapper::handleUserProfilePhotos(const QString &extra, const QVariantList &photos, const int &totalPhotos)
{
emit this->userProfilePhotosReceived(extra, photos, totalPhotos);
}
void TDLibWrapper::handleChatPermissionsUpdated(const QString &chatId, const QVariantMap &permissions)
{
emit this->chatPermissionsUpdated(chatId, permissions);
}
void TDLibWrapper::handleChatTitleUpdated(const QString &chatId, const QString &title)
{
emit this->chatTitleUpdated(chatId, title);
}
void TDLibWrapper::setInitialParameters()
{
LOG("Sending initial parameters to TD Lib");

View file

@ -99,7 +99,7 @@ public:
Q_INVOKABLE QVariantMap getChat(const QString &chatId);
Q_INVOKABLE void copyFileToDownloads(const QString &filePath);
Q_INVOKABLE void openFileOnDevice(const QString &filePath);
Q_INVOKABLE void controlScreenSaver(const bool &enabled);
Q_INVOKABLE void controlScreenSaver(bool enabled);
DBusAdaptor *getDBusAdaptor();
@ -114,8 +114,8 @@ public:
Q_INVOKABLE void openChat(const QString &chatId);
Q_INVOKABLE void closeChat(const QString &chatId);
Q_INVOKABLE void leaveChat(const QString &chatId);
Q_INVOKABLE void getChatHistory(const QString &chatId, const qlonglong &fromMessageId = 0, const int &offset = 0, const int &limit = 50, const bool &onlyLocal = false);
Q_INVOKABLE void viewMessage(const QString &chatId, const QString &messageId, const bool &force);
Q_INVOKABLE void getChatHistory(const QString &chatId, const qlonglong &fromMessageId = 0, int offset = 0, int limit = 50, bool onlyLocal = false);
Q_INVOKABLE void viewMessage(const QString &chatId, const QString &messageId, bool force);
Q_INVOKABLE void sendTextMessage(const QString &chatId, const QString &message, const QString &replyToMessageId = "0");
Q_INVOKABLE void sendPhotoMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId = "0");
Q_INVOKABLE void sendVideoMessage(const QString &chatId, const QString &filePath, const QString &message, const QString &replyToMessageId = "0");
@ -123,26 +123,26 @@ public:
Q_INVOKABLE void sendStickerMessage(const QString &chatId, const QString &fileId, const QString &replyToMessageId = "0");
Q_INVOKABLE void sendPollMessage(const QString &chatId, const QString &question, const QVariantList &options, const bool &anonymous, const int &correctOption, const bool &multiple, const QString &replyToMessageId = "0");
Q_INVOKABLE void getMessage(const QString &chatId, const QString &messageId);
Q_INVOKABLE void setOptionInteger(const QString &optionName, const int &optionValue);
Q_INVOKABLE void setOptionInteger(const QString &optionName, int optionValue);
Q_INVOKABLE void setChatNotificationSettings(const QString &chatId, const QVariantMap &notificationSettings);
Q_INVOKABLE void editMessageText(const QString &chatId, const QString &messageId, const QString &message);
Q_INVOKABLE void deleteMessages(const QString &chatId, const QVariantList messageIds);
Q_INVOKABLE void getMapThumbnailFile(const QString &chatId, const double &latitude, const double &longitude, const int &width, const int &height);
Q_INVOKABLE void getMapThumbnailFile(const QString &chatId, double latitude, double longitude, int width, int height);
Q_INVOKABLE void getRecentStickers();
Q_INVOKABLE void getInstalledStickerSets();
Q_INVOKABLE void getStickerSet(const QString &setId);
Q_INVOKABLE void getSupergroupMembers(const QString &groupId, const int &limit, const int &offset);
Q_INVOKABLE void getGroupFullInfo(const QString &groupId, const bool &isSuperGroup);
Q_INVOKABLE void getSupergroupMembers(const QString &groupId, int limit, int offset);
Q_INVOKABLE void getGroupFullInfo(const QString &groupId, bool isSuperGroup);
Q_INVOKABLE void getUserFullInfo(const QString &userId);
Q_INVOKABLE void createPrivateChat(const QString &userId);
Q_INVOKABLE void getGroupsInCommon(const QString &userId, const int &limit, const int &offset);
Q_INVOKABLE void getUserProfilePhotos(const QString &userId, const int &limit, const int &offset);
Q_INVOKABLE void getGroupsInCommon(const QString &userId, int limit, int offset);
Q_INVOKABLE void getUserProfilePhotos(const QString &userId, int limit, int offset);
Q_INVOKABLE void setChatPermissions(const QString &chatId, const QVariantMap &chatPermissions);
Q_INVOKABLE void setChatSlowModeDelay(const QString &chatId, const int &delay);
Q_INVOKABLE void setChatSlowModeDelay(const QString &chatId, int delay);
Q_INVOKABLE void setChatDescription(const QString &chatId, const QString &description);
Q_INVOKABLE void setChatTitle(const QString &chatId, const QString &title);
Q_INVOKABLE void setBio(const QString &bio);
Q_INVOKABLE void toggleSupergroupIsAllHistoryAvailable(const QString &groupId, const bool &isAllHistoryAvailable);
Q_INVOKABLE void toggleSupergroupIsAllHistoryAvailable(const QString &groupId, bool isAllHistoryAvailable);
Q_INVOKABLE void setPollAnswer(const QString &chatId, const qlonglong &messageId, QVariantList optionIds);
Q_INVOKABLE void stopPoll(const QString &chatId, const qlonglong &messageId);
Q_INVOKABLE void getPollVoters(const QString &chatId, const qlonglong &messageId, const int &optionId, const int &limit, const int &offset, const QString &extra);
@ -160,19 +160,19 @@ signals:
void authorizationStateChanged(const TDLibWrapper::AuthorizationState &authorizationState, const QVariantMap &authorizationStateData);
void optionUpdated(const QString &optionName, const QVariant &optionValue);
void connectionStateChanged(const TDLibWrapper::ConnectionState &connectionState);
void fileUpdated(const int fileId, const QVariantMap &fileInformation);
void fileUpdated(int fileId, const QVariantMap &fileInformation);
void newChatDiscovered(const QString &chatId, 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 QString &lastReadInboxMessageId, const int &unreadCount);
void chatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, int unreadCount);
void chatReadOutboxUpdated(const QString &chatId, const QString &lastReadOutboxMessageId);
void userUpdated(const QString &userId, const QVariantMap &userInformation);
void basicGroupUpdated(qlonglong groupId);
void superGroupUpdated(qlonglong groupId);
void chatOnlineMemberCountUpdated(const QString &chatId, const int &onlineMemberCount);
void messagesReceived(const QVariantList &messages, const int &totalCount);
void chatOnlineMemberCountUpdated(const QString &chatId, int onlineMemberCount);
void messagesReceived(const QVariantList &messages, int totalCount);
void newMessageReceived(const QString &chatId, const QVariantMap &message);
void copyToDownloadsSuccessful(const QString &fileName, const QString &filePath);
void copyToDownloadsError(const QString &fileName, const QString &filePath);
@ -192,14 +192,14 @@ signals:
void stickerSetsReceived(const QVariantList &stickerSets);
void stickerSetReceived(const QVariantMap &stickerSet);
void emojiSearchSuccessful(const QVariantList &result);
void chatMembersReceived(const QString &extra, const QVariantList &members, const int &totalMembers);
void chatMembersReceived(const QString &extra, const QVariantList &members, int totalMembers);
void userFullInfoReceived(const QVariantMap &userFullInfo);
void userFullInfoUpdated(const QString &userId, const QVariantMap &userFullInfo);
void basicGroupFullInfoReceived(const QString &groupId, const QVariantMap &groupFullInfo);
void supergroupFullInfoReceived(const QString &groupId, const QVariantMap &groupFullInfo);
void basicGroupFullInfoUpdated(const QString &groupId, const QVariantMap &groupFullInfo);
void supergroupFullInfoUpdated(const QString &groupId, const QVariantMap &groupFullInfo);
void userProfilePhotosReceived(const QString &extra, const QVariantList &photos, const int &totalPhotos);
void userProfilePhotosReceived(const QString &extra, const QVariantList &photos, int totalPhotos);
void chatPermissionsUpdated(const QString &chatId, const QVariantMap &permissions);
void chatTitleUpdated(const QString &chatId, const QString &title);
void usersReceived(const QString &extra, const QVariantList &userIds, int totalUsers);
@ -215,43 +215,10 @@ public slots:
void handleNewChatDiscovered(const QVariantMap &chatInformation);
void handleUnreadMessageCountUpdated(const QVariantMap &messageCountInformation);
void handleUnreadChatCountUpdated(const QVariantMap &chatCountInformation);
void handleChatLastMessageUpdated(const QString &chatId, const QString &order, const QVariantMap &lastMessage);
void handleChatOrderUpdated(const QString &chatId, const QString &order);
void handleChatReadInboxUpdated(const QString &chatId, const QString &lastReadInboxMessageId, const int &unreadCount);
void handleChatReadOutboxUpdated(const QString &chatId, const QString &lastReadOutboxMessageId);
void handleBasicGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation);
void handleSuperGroupUpdated(qlonglong groupId, const QVariantMap &groupInformation);
void handleChatOnlineMemberCountUpdated(const QString &chatId, const int &onlineMemberCount);
void handleMessagesReceived(const QVariantList &messages, const int &totalCount);
void handleNewMessageReceived(const QString &chatId, const QVariantMap &message);
void handleMessageInformation(const QString &messageId, const QVariantMap &message);
void handleMessageSendSucceeded(const QString &messageId, const QString &oldMessageId, const QVariantMap &message);
void handleUpdateActiveNotifications(const QVariantList notificationGroups);
void handleUpdateNotificationGroup(const QVariantMap notificationGroupUpdate);
void handleUpdateNotification(const QVariantMap updatedNotification);
void handleChatNotificationSettingsUpdated(const QString &chatId, const QVariantMap &chatNotificationSettings);
void handleMessageContentUpdated(const QString &chatId, const QString &messageId, const QVariantMap &newContent);
void handleMessagesDeleted(const QString &chatId, const QVariantList &messageIds);
void handleChats(const QVariantMap &chats);
void handleChat(const QVariantMap &chat);
void handleRecentStickersUpdated(const QVariantList &stickerIds);
void handleStickers(const QVariantList &stickers);
void handleInstalledStickerSetsUpdated(const QVariantList &stickerSetIds);
void handleStickerSets(const QVariantList &stickerSets);
void handleStickerSet(const QVariantMap &stickerSet);
void handleEmojiSearchCompleted(const QString &queryString, const QVariantList &resultList);
void handleChatMembers(const QString &extra, const QVariantList &members, const int &totalMembers);
void handleUserFullInfo(const QVariantMap &userFullInfo);
void handleUserFullInfoUpdated(const QString &userId, const QVariantMap &userFullInfo);
void handleBasicGroupFullInfo(const QString &groupId, const QVariantMap &groupFullInfo);
void handleBasicGroupFullInfoUpdated(const QString &groupId, const QVariantMap &groupFullInfo);
void handleSupergroupFullInfo(const QString &groupId, const QVariantMap &groupFullInfo);
void handleSupergroupFullInfoUpdated(const QString &groupId, const QVariantMap &groupFullInfo);
void handleUserProfilePhotos(const QString &extra, const QVariantList &photos, const int &totalPhotos);
void handleChatPermissionsUpdated(const QString &chatId, const QVariantMap &permissions);
void handleChatTitleUpdated(const QString &chatId, const QString &title);
private:
void setInitialParameters();