diff --git a/src/ruqolacore/emoticon.h b/src/ruqolacore/emoticon.h index cb070095..fbff6a85 100644 --- a/src/ruqolacore/emoticon.h +++ b/src/ruqolacore/emoticon.h @@ -1,44 +1,44 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef EMOTICON_H #define EMOTICON_H #include #include #include #include "libruqola_private_export.h" class LIBRUQOLACORE_TESTS_EXPORT Emoticon { Q_GADGET public: Emoticon(); - QString name() const; + Q_REQUIRED_RESULT QString name() const; void setName(const QString &name); private: QString mName; }; Q_DECLARE_METATYPE(Emoticon) LIBRUQOLACORE_EXPORT QDebug operator <<(QDebug d, const Emoticon &t); #endif // EMOTICON_H diff --git a/src/ruqolacore/notificationoptionswrapper.h b/src/ruqolacore/notificationoptionswrapper.h index 1a49c9c4..00210061 100644 --- a/src/ruqolacore/notificationoptionswrapper.h +++ b/src/ruqolacore/notificationoptionswrapper.h @@ -1,67 +1,67 @@ /* Copyright (c) 2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef NOTIFICATIONOPTIONSWRAPPER_H #define NOTIFICATIONOPTIONSWRAPPER_H #include #include "notificationoptions.h" class NotificationOptionsWrapper : public QObject { Q_OBJECT Q_PROPERTY(bool hideUnreadStatus READ hideUnreadStatus CONSTANT) Q_PROPERTY(bool disableNotifications READ disableNotifications CONSTANT) Q_PROPERTY(QString unreadTrayIconAlert READ unreadTrayIconAlert CONSTANT) Q_PROPERTY(QString emailNotifications READ emailNotifications CONSTANT) Q_PROPERTY(QString mobilePushNotification READ mobilePushNotification CONSTANT) Q_PROPERTY(QString desktopNotifications READ desktopNotifications CONSTANT) Q_PROPERTY(QString audioNotifications READ audioNotifications CONSTANT) Q_PROPERTY(QString audioNotificationValue READ audioNotificationValue CONSTANT) Q_PROPERTY(int desktopNotificationDuration READ desktopNotificationDuration CONSTANT) public: explicit NotificationOptionsWrapper(QObject *parent = nullptr); explicit NotificationOptionsWrapper(const NotificationOptions ¬ification, QObject *parent = nullptr); ~NotificationOptionsWrapper(); - bool hideUnreadStatus() const; + Q_REQUIRED_RESULT bool hideUnreadStatus() const; - bool disableNotifications() const; + Q_REQUIRED_RESULT bool disableNotifications() const; - QString unreadTrayIconAlert() const; + Q_REQUIRED_RESULT QString unreadTrayIconAlert() const; - QString emailNotifications() const; + Q_REQUIRED_RESULT QString emailNotifications() const; - QString mobilePushNotification() const; + Q_REQUIRED_RESULT QString mobilePushNotification() const; - QString desktopNotifications() const; + Q_REQUIRED_RESULT QString desktopNotifications() const; - QString audioNotifications() const; + Q_REQUIRED_RESULT QString audioNotifications() const; - QString audioNotificationValue() const; + Q_REQUIRED_RESULT QString audioNotificationValue() const; - int desktopNotificationDuration() const; + Q_REQUIRED_RESULT int desktopNotificationDuration() const; private: Q_DISABLE_COPY(NotificationOptionsWrapper) NotificationOptions mNotificationOptions; }; #endif // NOTIFICATIONOPTIONSWRAPPER_H diff --git a/src/ruqolacore/otrmanager.h b/src/ruqolacore/otrmanager.h index 7770517f..e29ee85b 100644 --- a/src/ruqolacore/otrmanager.h +++ b/src/ruqolacore/otrmanager.h @@ -1,39 +1,39 @@ /* Copyright (C) 2018 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef OTRMANAGER_H #define OTRMANAGER_H #include #include #include "libruqola_private_export.h" #include "otr.h" class LIBRUQOLACORE_TESTS_EXPORT OtrManager : public QObject { Q_OBJECT public: explicit OtrManager(QObject *parent = nullptr); ~OtrManager(); - Otr parseOtr(const QJsonArray &contents); + Q_REQUIRED_RESULT Otr parseOtr(const QJsonArray &contents); private: Q_DISABLE_COPY(OtrManager) }; #endif // OTRMANAGER_H diff --git a/src/ruqolacore/receivetypingnotificationmanager.h b/src/ruqolacore/receivetypingnotificationmanager.h index 2d901b3c..5457f6c4 100644 --- a/src/ruqolacore/receivetypingnotificationmanager.h +++ b/src/ruqolacore/receivetypingnotificationmanager.h @@ -1,46 +1,46 @@ /* Copyright (C) 2018 Montel Laurent This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; see the file COPYING. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef RECEIVETYPINGNOTIFICATIONMANAGER_H #define RECEIVETYPINGNOTIFICATIONMANAGER_H #include #include "libruqola_private_export.h" #include class LIBRUQOLACORE_TESTS_EXPORT ReceiveTypingNotificationManager : public QObject { Q_OBJECT public: explicit ReceiveTypingNotificationManager(QObject *parent = nullptr); ~ReceiveTypingNotificationManager(); void insertTypingNotification(const QString &roomId, const QString &userName, bool onTyping); - QString typingNotification(const QString &roomId) const; + Q_REQUIRED_RESULT QString typingNotification(const QString &roomId) const; Q_SIGNALS: void notificationChanged(const QString &roomId, const QString ¬ificationStr); private: Q_DISABLE_COPY(ReceiveTypingNotificationManager) QString generateNotification(const QStringList &userNames) const; QMap mMapTypingNotifications; }; #endif // RECEIVETYPINGNOTIFICATIONMANAGER_H diff --git a/src/ruqolacore/rocketchataccount.h b/src/ruqolacore/rocketchataccount.h index 7985cc28..64f7c6ba 100644 --- a/src/ruqolacore/rocketchataccount.h +++ b/src/ruqolacore/rocketchataccount.h @@ -1,314 +1,314 @@ /* Copyright (c) 2017-2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ROCKETCHATACCOUNT_H #define ROCKETCHATACCOUNT_H #include #include #include #include "rocketchataccountsettings.h" #include "libruqola_private_export.h" #include "authenticationinfo.h" #include "file.h" class TypingNotification; class UsersModel; class RoomModel; class RoomWrapper; class MessageModel; class DDPClient; class MessageQueue; class RocketChatBackend; class RoomFilterProxyModel; class RuqolaLogger; class RuqolaServerConfig; class UserCompleterModel; class UserCompleterFilterProxyModel; class StatusModel; class RocketChatCache; class EmojiManager; class OtrManager; class UsersForRoomFilterProxyModel; class UsersForRoomModel; class FilesForRoomFilterProxyModel; class SearchChannelModel; class SearchChannelFilterProxyModel; class LoginMethodModel; class InputCompleterModel; class InputTextManager; class PluginAuthenticationInterface; class Room; class SearchMessageModel; class SearchMessageFilterProxyModel; class ReceiveTypingNotificationManager; namespace RocketChatRestApi { class RestApiRequest; } class LIBRUQOLACORE_EXPORT RocketChatAccount : public QObject { Q_OBJECT Q_PROPERTY(QString userName READ userName WRITE setUserName NOTIFY userNameChanged) Q_PROPERTY(QString userID READ userID WRITE setUserID NOTIFY userIDChanged) Q_PROPERTY(QString serverUrl READ serverUrl WRITE setServerUrl NOTIFY serverUrlChanged) Q_PROPERTY(QString accountName READ accountName WRITE setAccountName NOTIFY accountNameChanged) Q_PROPERTY(QString password READ password WRITE setPassword NOTIFY passwordChanged) Q_PROPERTY(DDPClient::LoginStatus loginStatus READ loginStatus NOTIFY loginStatusChanged) public: explicit RocketChatAccount(const QString &accountName = QString(), QObject *parent = nullptr); ~RocketChatAccount(); enum RoomInfoType { Announcement, Description, Name, Topic, ReadOnly, Archive, RoomType }; Q_ENUM(RoomInfoType) enum NotificationOptionsType { DisableNotifications, HideUnreadStatus, AudioNotifications, DesktopNotifications, EmailNotifications, MobilePushNotifications, UnreadAlert }; Q_ENUM(NotificationOptionsType) Q_INVOKABLE UsersModel *usersModel() const; Q_INVOKABLE RoomModel *roomModel() const; Q_INVOKABLE RoomFilterProxyModel *roomFilterProxyModel() const; Q_INVOKABLE UsersForRoomFilterProxyModel *usersForRoomFilterProxyModel(const QString &roomId) const; Q_INVOKABLE UsersForRoomModel *usersModelForRoom(const QString &roomId) const; Q_INVOKABLE RoomWrapper *getRoomWrapper(const QString &roomId); Q_INVOKABLE MessageModel *messageModelForRoom(const QString &roomID); Q_INVOKABLE QString getUserCurrentMessage(const QString &roomId); Q_INVOKABLE void setUserCurrentMessage(const QString &message, const QString &roomId); Q_INVOKABLE void textEditing(const QString &roomId, const QString &str); Q_INVOKABLE void leaveRoom(const QString &roomId, const QString &channelType); Q_INVOKABLE void hideRoom(const QString &roomId, const QString &channelType = QString()); Q_INVOKABLE void tryLogin(); Q_INVOKABLE void logOut(); Q_INVOKABLE void clearUnreadMessages(const QString &roomId); Q_INVOKABLE void changeFavorite(const QString &roomId, bool checked); Q_INVOKABLE void sendMessage(const QString &roomID, const QString &message); Q_INVOKABLE void updateMessage(const QString &roomID, const QString &messageId, const QString &message); Q_INVOKABLE void openChannel(const QString &url); Q_INVOKABLE void joinJitsiConfCall(const QString &roomId); Q_INVOKABLE void createNewChannel(const QString &name, bool readOnly, bool privateRoom, const QString &userNames); Q_INVOKABLE void joinRoom(const QString &roomId, const QString &joinCode = QString()); Q_INVOKABLE void openDirectChannel(const QString &username); Q_INVOKABLE void listEmojiCustom(); Q_INVOKABLE void setDefaultStatus(User::PresenceStatus status); Q_INVOKABLE void changeDefaultStatus(int index); Q_INVOKABLE void createJitsiConfCall(const QString &roomId); Q_INVOKABLE void deleteMessage(const QString &messageId, const QString &roomId); Q_INVOKABLE void userAutocomplete(const QString &searchText, const QString &exception); Q_INVOKABLE void eraseRoom(const QString &roomId, const QString &channelType = QString()); Q_INVOKABLE void changeChannelSettings(const QString &roomId, RocketChatAccount::RoomInfoType infoType, const QVariant &newValue, const QString &channelType = QString()); Q_INVOKABLE void changeNotificationsSettings(const QString &roomId, RocketChatAccount::NotificationOptionsType notificationsType, const QVariant &newValue); Q_INVOKABLE QString recordingVideoPath() const; Q_INVOKABLE QString recordingImagePath() const; Q_INVOKABLE void downloadFile(const QString &downloadFileUrl, const QUrl &localFile); Q_INVOKABLE void starMessage(const QString &messageId, const QString &rid, bool starred); Q_INVOKABLE void uploadFile(const QString &roomId, const QString &description, const QString &messageText, const QUrl &fileUrl); Q_INVOKABLE QString serverUrl() const; Q_INVOKABLE QString avatarUrl(const QString &userId); Q_INVOKABLE StatusModel *statusModel() const; Q_INVOKABLE QUrl attachmentUrl(const QString &url); Q_INVOKABLE void loadHistory(const QString &roomID, const QString &channelType = QString(), bool initial = false); Q_INVOKABLE bool allowEditingMessages() const; Q_INVOKABLE bool otrEnabled() const; Q_INVOKABLE void channelAndPrivateAutocomplete(const QString &pattern); Q_INVOKABLE UserCompleterFilterProxyModel *userCompleterFilterModelProxy() const; Q_INVOKABLE void roomFiles(const QString &roomId, const QString &channelType = QString()); Q_INVOKABLE FilesForRoomFilterProxyModel *filesForRoomFilterProxyModel(const QString &roomId) const; Q_INVOKABLE void addUserToRoom(const QString &username, const QString &roomId, const QString &channelType); Q_INVOKABLE SearchChannelFilterProxyModel *searchChannelFilterProxyModel() const; Q_INVOKABLE InputCompleterModel *inputCompleterModel() const; Q_INVOKABLE LoginMethodModel *loginMethodModel() const; Q_INVOKABLE Room *getRoom(const QString &roomId); Q_INVOKABLE void changeDefaultAuthentication(int index); Q_INVOKABLE void messageSearch(const QString &pattern, const QString &rid); Q_INVOKABLE SearchMessageFilterProxyModel *searchMessageFilterProxyModel() const; Q_INVOKABLE void setInputTextChanged(const QString &str, int position); Q_INVOKABLE QString replaceWord(const QString &newWord, const QString &str, int position); Q_INVOKABLE void blockUser(const QString &userId, bool block); Q_INVOKABLE QString avatarUrlFromDirectChannel(const QString &rid); Q_INVOKABLE void deleteFileMessage(const QString &roomId, const QString &fileId, const QString &channelType); Q_INVOKABLE void openDocumentation(); Q_INVOKABLE void clearSearchModel(); Q_INVOKABLE void reactOnMessage(const QString &messageId, const QString &emoji, bool shouldReact); Q_INVOKABLE void ignoreUser(const QString &rid, const QString &userId, bool ignore); + Q_INVOKABLE ReceiveTypingNotificationManager *receiveTypingNotificationManager() const; SearchChannelModel *searchChannelModel() const; UserCompleterModel *userCompleterModel() const; RocketChatAccountSettings *settings() const; DDPClient *ddp(); DDPClient::LoginStatus loginStatus(); RocketChatRestApi::RestApiRequest *restApi(); //Make it private in future void slotInformTypingStatus(const QString &room, bool typing); MessageQueue *messageQueue() const; RocketChatBackend *rocketChatBackend() const; RuqolaLogger *ruqolaLogger() const; void loadEmoji(const QJsonObject &obj); void parsePublicSettings(const QJsonObject &obj); RuqolaServerConfig *ruqolaServerConfig() const; void setUserName(const QString &username); Q_REQUIRED_RESULT QString userName() const; void setAccountName(const QString &servername); Q_REQUIRED_RESULT QString accountName() const; void setUserID(const QString &userID); Q_REQUIRED_RESULT QString userID() const; void setPassword(const QString &password); Q_REQUIRED_RESULT QString password() const; void setAuthToken(const QString &token); Q_REQUIRED_RESULT QString authToken() const; void setServerUrl(const QString &serverUrl); void sendNotification(const QJsonArray &contents); void parseOtr(const QJsonArray &contents); void setServerVersion(const QString &version); - bool needAdaptNewSubscriptionRC60() const; + Q_REQUIRED_RESULT bool needAdaptNewSubscriptionRC60() const; EmojiManager *emojiManager() const; Q_REQUIRED_RESULT QString userStatusIconFileName(const QString &id); void getUsersOfRoom(const QString &roomId); void parseUsersForRooms(const QString &roomId, const QJsonObject &root); void loadAutoCompleteChannel(const QJsonObject &obj); void insertCompleterUsers(); void insertFilesList(const QString &roomId); void inputChannelAutocomplete(const QString &pattern, const QString &exceptions); void inputUserAutocomplete(const QString &pattern, const QString &exceptions); void inputTextCompleter(const QJsonObject &obj); PluginAuthenticationInterface *defaultAuthenticationInterface() const; SearchMessageModel *searchMessageModel() const; void displaySearchedMessage(const QJsonObject &obj); void updateUser(const QJsonObject &object); void initializeRoom(const QString &roomId, bool loadInitialHistory = true); void removeSettings(); - Q_INVOKABLE ReceiveTypingNotificationManager *receiveTypingNotificationManager() const; Q_SIGNALS: void connectedChanged(); void accountNameChanged(); void userNameChanged(); void userIDChanged(); void passwordChanged(); void serverUrlChanged(); void loginStatusChanged(); void logoutDone(const QString &accountname); void added(const QJsonObject &item); void changed(const QJsonObject &item); void removed(const QJsonObject &item); void notification(const QString &title, const QString &message, const QPixmap &pixmap); void fileDownloaded(const QString &filePath, const QUrl &cacheImageUrl); void updateNotification(bool hasAlert, int nbUnread, const QString &accountName); private: Q_DISABLE_COPY(RocketChatAccount) void slotChannelFilesDone(const QJsonObject &obj, const QString &roomId); void loadEmojiRestApi(const QJsonObject &obj); void slotSearchMessages(const QJsonObject &obj); void slotNeedToUpdateNotification(); void insertAvatarUrl(const QString &userId, const QString &url); void loadSettings(const QString &accountFileName); void clearModels(); void fillOauthModel(); void initializeAuthenticationPlugins(); void setDefaultAuthentication(AuthenticationManager::OauthType type); void userStatusChanged(const User &user); QVector parseFilesInChannel(const QJsonObject &obj); PluginAuthenticationInterface *mDefaultAuthenticationInterface = nullptr; QHash mLstPluginAuthenticationInterface; QVector mLstInfos; RocketChatAccountSettings *mSettings = nullptr; EmojiManager *mEmojiManager = nullptr; TypingNotification *mTypingNotification = nullptr; UsersModel *mUserModel = nullptr; RoomModel *mRoomModel = nullptr; RoomFilterProxyModel *mRoomFilterProxyModel = nullptr; DDPClient *mDdp = nullptr; RocketChatRestApi::RestApiRequest *mRestApi = nullptr; MessageQueue *mMessageQueue = nullptr; RocketChatBackend *mRocketChatBackend = nullptr; RuqolaLogger *mRuqolaLogger = nullptr; RuqolaServerConfig *mRuqolaServerConfig = nullptr; UserCompleterModel *mUserCompleterModel = nullptr; UserCompleterFilterProxyModel *mUserCompleterFilterModelProxy = nullptr; StatusModel *mStatusModel = nullptr; RocketChatCache *mCache = nullptr; OtrManager *mOtrManager = nullptr; SearchChannelModel *mSearchChannelModel = nullptr; SearchChannelFilterProxyModel *mSearchChannelFilterProxyModel = nullptr; LoginMethodModel *mLoginMethodModel = nullptr; InputTextManager *mInputTextManager = nullptr; SearchMessageModel *mSearchMessageModel = nullptr; SearchMessageFilterProxyModel *mSearchMessageFilterProxyModel = nullptr; ReceiveTypingNotificationManager *mReceiveTypingNotificationManager = nullptr; }; #endif // ROCKETCHATACCOUNT_H diff --git a/src/ruqolacore/rocketchatmessage.h b/src/ruqolacore/rocketchatmessage.h index 48885ae4..59d201d5 100644 --- a/src/ruqolacore/rocketchatmessage.h +++ b/src/ruqolacore/rocketchatmessage.h @@ -1,118 +1,118 @@ /* Copyright (c) 2017-2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef ROCKETCHATMESSAGE_H #define ROCKETCHATMESSAGE_H #include "libruqola_private_export.h" #include "user.h" #include #include class QDateTime; class LIBRUQOLACORE_TESTS_EXPORT RocketChatMessage { Q_GADGET public: RocketChatMessage(); ~RocketChatMessage() = default; struct RocketChatMessageResult { QString method; QString result; QJsonDocument jsonDocument; }; void setJsonFormat(const QJsonDocument::JsonFormat &jsonFormat); - RocketChatMessageResult hideRoom(const QString &roomID, quint64 id); - RocketChatMessageResult leaveRoom(const QString &roomID, quint64 id); - RocketChatMessageResult openRoom(const QString &roomID, quint64 id); - RocketChatMessageResult unarchiveRoom(const QString &roomID, quint64 id); - RocketChatMessageResult archiveRoom(const QString &roomID, quint64 id); - RocketChatMessageResult eraseRoom(const QString &roomID, quint64 id); - RocketChatMessageResult getRoomRoles(const QString &roomID, quint64 id); - RocketChatMessageResult toggleFavorite(const QString &roomId, bool favorite, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult hideRoom(const QString &roomID, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult leaveRoom(const QString &roomID, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult openRoom(const QString &roomID, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult unarchiveRoom(const QString &roomID, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult archiveRoom(const QString &roomID, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult eraseRoom(const QString &roomID, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult getRoomRoles(const QString &roomID, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult toggleFavorite(const QString &roomId, bool favorite, quint64 id); //save room settings - RocketChatMessageResult setRoomName(const QString &roomId, const QString &name, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult setRoomName(const QString &roomId, const QString &name, quint64 id); - RocketChatMessageResult generateMethod(const QString &method, const QJsonDocument ¶ms, quint64 id); - RocketChatMessage::RocketChatMessageResult setRoomIsReadOnly(const QString &roomId, bool readOnly, quint64 id); - RocketChatMessage::RocketChatMessageResult setRoomHasSystemMessages(const QString &roomId, bool systemMessages, quint64 id); - RocketChatMessage::RocketChatMessageResult setRoomIsDefault(const QString &roomId, bool isDefault, quint64 id); - RocketChatMessage::RocketChatMessageResult setRoomJoinCode(const QString &roomId, const QString &joinCode, quint64 id); - RocketChatMessage::RocketChatMessageResult setRoomTopic(const QString &roomId, const QString &topic, quint64 id); - RocketChatMessage::RocketChatMessageResult setRoomDescription(const QString &roomId, const QString &description, quint64 id); - RocketChatMessage::RocketChatMessageResult readMessages(const QString &roomID, quint64 id); - RocketChatMessage::RocketChatMessageResult joinRoom(const QString &roomId, const QString &accessCode, quint64 id); - RocketChatMessage::RocketChatMessageResult informTypingStatus(const QString &roomId, const QString &userId, bool typingStatus, quint64 id); - RocketChatMessage::RocketChatMessageResult getSubscriptions(const QDateTime &lastUpdate, quint64 id); - RocketChatMessage::RocketChatMessageResult setDefaultStatus(User::PresenceStatus status, quint64 id); - RocketChatMessage::RocketChatMessageResult setTemporaryStatus(User::PresenceStatus status, quint64 id); - RocketChatMessage::RocketChatMessageResult getUsersOfRoom(const QString &roomId, bool showAll, quint64 id); - RocketChatMessage::RocketChatMessageResult logout(const QString &name, quint64 id); - RocketChatMessage::RocketChatMessageResult createChannel(const QString &roomName, const QStringList &userList, bool readOnly, quint64 id); - RocketChatMessage::RocketChatMessageResult createPrivateGroup(const QString &roomName, const QStringList &userList, quint64 id); - RocketChatMessage::RocketChatMessageResult deleteMessage(const QString &messageId, quint64 id); - RocketChatMessage::RocketChatMessageResult starMessage(const QString &_id, const QString &rid, bool starred, quint64 id); - RocketChatMessage::RocketChatMessageResult setReaction(const QString &emoji, const QString &messageId, quint64 id); - RocketChatMessage::RocketChatMessageResult openDirectChannel(const QString &username, quint64 id); - RocketChatMessage::RocketChatMessageResult messageSearch(const QString &roomId, const QString &pattern, quint64 id); - RocketChatMessage::RocketChatMessageResult listEmojiCustom(quint64 id); - RocketChatMessage::RocketChatMessageResult createJitsiConfCall(const QString &roomId, quint64 id); - RocketChatMessage::RocketChatMessageResult sendFileMessage(const QJsonObject &result, const QString &serviceUploadType, const QString &roomId, quint64 id); - RocketChatMessage::RocketChatMessageResult userAutocomplete(const QString &searchText, const QString &exception, quint64 id); - RocketChatMessage::RocketChatMessageResult updateMessage(quint64 id); - RocketChatMessage::RocketChatMessageResult unsubscribe(quint64 id); - RocketChatMessage::RocketChatMessageResult setRoomAnnouncement(const QString &roomId, const QString &announcement, quint64 id); - RocketChatMessage::RocketChatMessageResult blockUser(const QString &rid, const QString &userId, quint64 id); - RocketChatMessage::RocketChatMessageResult unblockUser(const QString &rid, const QString &userId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessageResult generateMethod(const QString &method, const QJsonDocument ¶ms, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setRoomIsReadOnly(const QString &roomId, bool readOnly, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setRoomHasSystemMessages(const QString &roomId, bool systemMessages, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setRoomIsDefault(const QString &roomId, bool isDefault, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setRoomJoinCode(const QString &roomId, const QString &joinCode, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setRoomTopic(const QString &roomId, const QString &topic, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setRoomDescription(const QString &roomId, const QString &description, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult readMessages(const QString &roomID, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult joinRoom(const QString &roomId, const QString &accessCode, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult informTypingStatus(const QString &roomId, const QString &userId, bool typingStatus, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult getSubscriptions(const QDateTime &lastUpdate, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setDefaultStatus(User::PresenceStatus status, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setTemporaryStatus(User::PresenceStatus status, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult getUsersOfRoom(const QString &roomId, bool showAll, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult logout(const QString &name, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult createChannel(const QString &roomName, const QStringList &userList, bool readOnly, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult createPrivateGroup(const QString &roomName, const QStringList &userList, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult deleteMessage(const QString &messageId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult starMessage(const QString &_id, const QString &rid, bool starred, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setReaction(const QString &emoji, const QString &messageId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult openDirectChannel(const QString &username, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult messageSearch(const QString &roomId, const QString &pattern, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult listEmojiCustom(quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult createJitsiConfCall(const QString &roomId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult sendFileMessage(const QJsonObject &result, const QString &serviceUploadType, const QString &roomId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult userAutocomplete(const QString &searchText, const QString &exception, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult updateMessage(quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult unsubscribe(quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setRoomAnnouncement(const QString &roomId, const QString &announcement, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult blockUser(const QString &rid, const QString &userId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult unblockUser(const QString &rid, const QString &userId, quint64 id); - RocketChatMessage::RocketChatMessageResult channelAndPrivateAutocomplete(const QString &pattern, const QString &exceptions, quint64 id); - RocketChatMessage::RocketChatMessageResult roomFiles(const QString &roomId, quint64 id); - RocketChatMessage::RocketChatMessageResult searchRoomUsers(const QString &pattern, const QString &exceptions, bool searchUser, bool searchRoom, quint64 id); - RocketChatMessage::RocketChatMessageResult addUserToRoom(const QString &username, const QString &roomId, quint64 id); - RocketChatMessage::RocketChatMessageResult login(const QString &username, const QString &password, quint64 id); - RocketChatMessage::RocketChatMessageResult inputChannelAutocomplete(const QString &pattern, const QString &exceptions, quint64 id); - RocketChatMessage::RocketChatMessageResult inputUserAutocomplete(const QString &pattern, const QString &exceptions, quint64 id); - RocketChatMessage::RocketChatMessageResult loginProvider(const QString &credentialToken, const QString &credentialSecretd, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult channelAndPrivateAutocomplete(const QString &pattern, const QString &exceptions, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult roomFiles(const QString &roomId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult searchRoomUsers(const QString &pattern, const QString &exceptions, bool searchUser, bool searchRoom, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult addUserToRoom(const QString &username, const QString &roomId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult login(const QString &username, const QString &password, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult inputChannelAutocomplete(const QString &pattern, const QString &exceptions, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult inputUserAutocomplete(const QString &pattern, const QString &exceptions, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult loginProvider(const QString &credentialToken, const QString &credentialSecretd, quint64 id); - RocketChatMessage::RocketChatMessageResult disableNotifications(const QString &roomId, bool disabled, quint64 id); - RocketChatMessage::RocketChatMessageResult hideUnreadStatus(const QString &roomId, bool disabled, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult disableNotifications(const QString &roomId, bool disabled, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult hideUnreadStatus(const QString &roomId, bool disabled, quint64 id); - RocketChatMessage::RocketChatMessageResult audioNotifications(const QString &roomId, const QString &value, quint64 id); - RocketChatMessage::RocketChatMessageResult mobilePushNotifications(const QString &roomId, const QString &value, quint64 id); - RocketChatMessage::RocketChatMessageResult desktopNotifications(const QString &roomId, const QString &value, quint64 id); - RocketChatMessage::RocketChatMessageResult emailNotifications(const QString &roomId, const QString &value, quint64 id); - RocketChatMessage::RocketChatMessageResult unreadAlert(const QString &roomId, const QString &value, quint64 id); - RocketChatMessage::RocketChatMessageResult deleteFileMessage(const QString &fileId, quint64 id); - RocketChatMessage::RocketChatMessageResult setRoomType(const QString &roomId, bool privateChannel, quint64 id); - RocketChatMessage::RocketChatMessageResult ignoreUser(const QString &roomId, const QString &userId, bool ignore, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult audioNotifications(const QString &roomId, const QString &value, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult mobilePushNotifications(const QString &roomId, const QString &value, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult desktopNotifications(const QString &roomId, const QString &value, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult emailNotifications(const QString &roomId, const QString &value, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult unreadAlert(const QString &roomId, const QString &value, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult deleteFileMessage(const QString &fileId, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult setRoomType(const QString &roomId, bool privateChannel, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult ignoreUser(const QString &roomId, const QString &userId, bool ignore, quint64 id); private: Q_DISABLE_COPY(RocketChatMessage) QJsonValue toJsonDateTime(const QDateTime &dateTime); - RocketChatMessage::RocketChatMessageResult subscribe(const QString &name, const QJsonDocument ¶ms, quint64 id); - RocketChatMessage::RocketChatMessageResult saveRoomSettings(const QString &key, const QString &roomId, const QJsonValue &value, quint64 id); - RocketChatMessage::RocketChatMessageResult saveNotificationsSettings(const QString &key, const QString &roomId, const QJsonValue &value, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult subscribe(const QString &name, const QJsonDocument ¶ms, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult saveRoomSettings(const QString &key, const QString &roomId, const QJsonValue &value, quint64 id); + Q_REQUIRED_RESULT RocketChatMessage::RocketChatMessageResult saveNotificationsSettings(const QString &key, const QString &roomId, const QJsonValue &value, quint64 id); QJsonDocument::JsonFormat mJsonFormat; }; #endif // ROCKETCHATMESSAGE_H diff --git a/src/ruqolacore/room.h b/src/ruqolacore/room.h index a4cae7ae..9fec4c5d 100644 --- a/src/ruqolacore/room.h +++ b/src/ruqolacore/room.h @@ -1,266 +1,266 @@ /* * Copyright 2016 Riccardo Iaconelli * Copyright 2017-2018 Laurent Montel * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License or (at your option) version 3 or any later version * accepted by the membership of KDE e.V. (or its successor approved * by the membership of KDE e.V.), which shall act as a proxy * defined in Section 14 of version 3 of the license. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program. If not, see . * */ #ifndef ROOM_H #define ROOM_H #include #include #include "notificationoptions.h" #include "libruqola_private_export.h" class UsersForRoomModel; class UsersForRoomFilterProxyModel; class FilesForRoomModel; class FilesForRoomFilterProxyModel; class MessageModel; class RocketChatAccount; class LIBRUQOLACORE_TESTS_EXPORT Room : public QObject { Q_OBJECT Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged) Q_PROPERTY(QString announcement READ announcement WRITE setAnnouncement NOTIFY announcementChanged) Q_PROPERTY(QString topic READ topic WRITE setTopic NOTIFY topicChanged) Q_PROPERTY(bool favorite READ favorite WRITE setFavorite NOTIFY favoriteChanged) Q_PROPERTY(bool readOnly READ readOnly WRITE setReadOnly NOTIFY readOnlyChanged) Q_PROPERTY(bool alert READ alert WRITE setAlert NOTIFY alertChanged) Q_PROPERTY(bool blocker READ blocker WRITE setBlocker NOTIFY blockerChanged) Q_PROPERTY(bool archived READ archived WRITE setArchived NOTIFY archivedChanged) Q_PROPERTY(bool blocked READ blocked WRITE setBlocked NOTIFY blockedChanged) Q_PROPERTY(bool open READ open WRITE setOpen NOTIFY openChanged) Q_PROPERTY(QString description READ description WRITE setDescription NOTIFY descriptionChanged) Q_PROPERTY(QStringList roles READ roles WRITE setRoles NOTIFY rolesChanged) public: explicit Room(RocketChatAccount *account = nullptr, QObject *parent = nullptr); // To be used in ID find: message ID Q_REQUIRED_RESULT bool operator==(const Room &other) const; //we can't use operator== as it tests only id. We need it for autotest Q_REQUIRED_RESULT bool isEqual(const Room &other) const; Q_REQUIRED_RESULT QString roomOwnerUserName() const; void setRoomCreatorUserName(const QString &userName); Q_REQUIRED_RESULT QString roomOwnerUserId() const; void setRoomCreatorUserId(const QString &userId); Q_REQUIRED_RESULT QStringList mutedUsers() const; void setMutedUsers(const QStringList &mutedUsers); Q_REQUIRED_RESULT qint64 jitsiTimeout() const; void setJitsiTimeout(const qint64 &jitsiTimeout); Q_REQUIRED_RESULT int unread() const; void setUnread(int unread); Q_REQUIRED_RESULT bool selected() const; void setSelected(bool selected); /** * @brief Return room name * * @return QString, The name of the room */ Q_REQUIRED_RESULT QString name() const; void setName(const QString &name); Q_REQUIRED_RESULT QString announcement() const; void setAnnouncement(const QString &announcement); Q_REQUIRED_RESULT QString channelType() const; void setChannelType(const QString &channelType); Q_REQUIRED_RESULT bool favorite() const; void setFavorite(bool favorite); QString topic() const; void setTopic(const QString &topic); Q_REQUIRED_RESULT bool readOnly() const; void setReadOnly(bool readOnly); Q_REQUIRED_RESULT bool open() const; void setOpen(bool open); Q_REQUIRED_RESULT bool alert() const; void setAlert(bool alert); Q_REQUIRED_RESULT QString roomId() const; void setRoomId(const QString &id); void setBlocker(bool alert); Q_REQUIRED_RESULT bool blocker() const; void parseSubscriptionRoom(const QJsonObject &json); void parseUpdateRoom(const QJsonObject &json); /** * @brief Constructs Room object from QJsonObject (cache) * * @param source The Json containing room attributes * @return Room object, The room constructed from Json */ static Room *fromJSon(const QJsonObject &source); /** * @brief Constructs QBytearray from Room object * * @param message The Room object * @return QByteArray, The Json containing room attributes */ static QByteArray serialize(Room *r, bool toBinary = true); UsersForRoomModel *usersModelForRoom() const; UsersForRoomFilterProxyModel *usersModelForRoomProxyModel() const; FilesForRoomModel *filesModelForRoom() const; FilesForRoomFilterProxyModel *filesForRoomFilterProxyModel() const; MessageModel *messageModel() const; - QString inputMessage() const; + Q_REQUIRED_RESULT QString inputMessage() const; void setInputMessage(const QString &inputMessage); Q_REQUIRED_RESULT bool archived() const; void setArchived(bool archived); QString description() const; void setDescription(const QString &description); Q_REQUIRED_RESULT bool canBeModify() const; Q_REQUIRED_RESULT NotificationOptions notificationOptions() const; void setNotificationOptions(const NotificationOptions ¬ificationOptions); Q_REQUIRED_RESULT int userMentions() const; void setUserMentions(int userMentions); void updateSubscriptionRoom(const QJsonObject &json); Q_REQUIRED_RESULT qint64 updatedAt() const; void setUpdatedAt(const qint64 &updatedAt); void parseInsertRoom(const QJsonObject &json); Q_REQUIRED_RESULT qint64 lastSeeAt() const; void setLastSeeAt(const qint64 &lastSeeAt); Q_REQUIRED_RESULT bool blocked() const; void setBlocked(bool blocked); Q_REQUIRED_RESULT QStringList roles() const; void setRoles(const QStringList &roles); Q_REQUIRED_RESULT QStringList ignoredUsers() const; void setIgnoredUsers(const QStringList &ignoredUsers); Q_REQUIRED_RESULT bool userIsIgnored(const QString &userId); Q_REQUIRED_RESULT QString markdownAnnouncement() const; Q_SIGNALS: void nameChanged(); void announcementChanged(); void topicChanged(); void favoriteChanged(); void alertChanged(); void readOnlyChanged(); void unreadChanged(); void openChanged(); //Blocker we blocked the channel void blockerChanged(); //Blocked the channel was blocked void blockedChanged(); void archivedChanged(); void descriptionChanged(); void rolesChanged(); void mutedUsersChanged(); void ignoredUsersChanged(); private: Q_DISABLE_COPY(Room) void parseCommonData(const QJsonObject &json); //Room Object Fields NotificationOptions mNotificationOptions; // muted - collection of muted users by its usernames QStringList mMutedUsers; QStringList mIgnoredUsers; //Roles QStringList mRoles; QString mInputMessage; // _id QString mRoomId; // t (can take values "d" , "c" or "p" or "l") QString mChannelType; // name QString mName; // Announcement QString mAnnouncement; // u QString mRoomCreatorUserName; QString mRoomCreateUserId; // topic QString mTopic; QString mDescription; // jitsiTimeout qint64 mJitsiTimeout = -1; qint64 mUpdatedAt = -1; qint64 mLastSeeAt = -1; //quint64 ? int mUnread = 0; int mUserMentions = 0; // ro - read-only chat or not bool mReadOnly = false; bool mSelected = false; bool mFavorite = false; //We can hide it or not. bool mOpen = false; bool mAlert = false; bool mBlocker = false; bool mArchived = false; bool mBlocked = false; UsersForRoomModel *mUsersModelForRoom = nullptr; UsersForRoomFilterProxyModel *mUsersModelForRoomProxyModel = nullptr; FilesForRoomModel *mFilesModelForRoom = nullptr; FilesForRoomFilterProxyModel *mFilesForRoomFilterProxyModel = nullptr; MessageModel *mMessageModel = nullptr; RocketChatAccount *mRocketChatAccount = nullptr; }; LIBRUQOLACORE_EXPORT QDebug operator <<(QDebug d, const Room &t); #endif // ROOM_H diff --git a/src/ruqolacore/ruqolawebsocket.h b/src/ruqolacore/ruqolawebsocket.h index 55436a64..1467779f 100644 --- a/src/ruqolacore/ruqolawebsocket.h +++ b/src/ruqolacore/ruqolawebsocket.h @@ -1,49 +1,49 @@ /* Copyright (c) 2017-2018 Montel Laurent This library is free software; you can redistribute it and/or modify it under the terms of the GNU Library General Public License as published by the Free Software Foundation; either version 2 of the License or ( at your option ) version 3 or, at the discretion of KDE e.V. ( which shall act as a proxy as in section 14 of the GPLv3 ), any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more details. You should have received a copy of the GNU Library General Public License along with this library; see the file COPYING.LIB. If not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef RUQOLAWEBSOCKET_H #define RUQOLAWEBSOCKET_H #include "abstractwebsocket.h" class QWebSocket; class RuqolaWebSocket : public AbstractWebSocket { public: explicit RuqolaWebSocket(QObject *parent = nullptr); ~RuqolaWebSocket() override; void openUrl(const QUrl &url) override; qint64 sendTextMessage(const QString &message) override; bool isValid() const override; void flush() override; void close() override; QAbstractSocket::SocketError error() const override; - QUrl requestUrl() const override; + Q_REQUIRED_RESULT QUrl requestUrl() const override; QWebSocketProtocol::CloseCode closeCode() const override; - QString closeReason() const override; + Q_REQUIRED_RESULT QString closeReason() const override; qint64 sendBinaryMessage(const QByteArray &data) override; void ignoreSslErrors() override; private: QWebSocket *mWebSocket = nullptr; }; #endif // RUQOLAWEBSOCKET_H