summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-12 09:45:26 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-06-12 09:45:26 +0300
commit36cb62748b1a1c98d64ea3e8cfce0ef1cb5ba0c4 (patch)
tree9e0af2509e7202f0473f8da347183b6681a3512d /include
parentAdd support for displaying decrypted messages (diff)
downloadnheko-36cb62748b1a1c98d64ea3e8cfce0ef1cb5ba0c4.tar.xz
Add menu option to enable encryption in a private room
Diffstat (limited to 'include')
-rw-r--r--include/Cache.h2
-rw-r--r--include/dialogs/RoomSettings.hpp21
2 files changed, 15 insertions, 8 deletions
diff --git a/include/Cache.h b/include/Cache.h

index 994a6da7..97133b0c 100644 --- a/include/Cache.h +++ b/include/Cache.h
@@ -342,6 +342,8 @@ public: //! Mark a room that uses e2e encryption. void setEncryptedRoom(const std::string &room_id); + bool isRoomEncrypted(const std::string &room_id); + //! Save the public keys for a device. void saveDeviceKeys(const std::string &device_id); void getDeviceKeys(const std::string &device_id); diff --git a/include/dialogs/RoomSettings.hpp b/include/dialogs/RoomSettings.hpp
index 9a01d5c9..6cab03b7 100644 --- a/include/dialogs/RoomSettings.hpp +++ b/include/dialogs/RoomSettings.hpp
@@ -5,16 +5,17 @@ #include "Cache.h" +class Avatar; class FlatButton; -class TextField; +class QComboBox; class QHBoxLayout; -class Avatar; -class QPixmap; -class QLayout; class QLabel; -class QComboBox; -class TextField; class QLabel; +class QLayout; +class QPixmap; +class TextField; +class TextField; +class Toggle; template<class T> class QSharedPointer; @@ -84,6 +85,7 @@ public: signals: void closing(); + void enableEncryptionError(const QString &msg); protected: void paintEvent(QPaintEvent *event) override; @@ -98,13 +100,15 @@ private: void setupEditButton(); //! Retrieve the current room information from cache. void retrieveRoomInfo(); + void enableEncryption(); //! Whether the user would be able to change the name or the topic of the room. - bool hasEditRights_ = true; + bool hasEditRights_ = true; + bool usesEncryption_ = false; QHBoxLayout *editLayout_; // Button section - FlatButton *saveBtn_; + FlatButton *okBtn_; FlatButton *cancelBtn_; FlatButton *editFieldsBtn_; @@ -116,6 +120,7 @@ private: TopSection *topSection_; QComboBox *accessCombo; + Toggle *encryptionToggle_; }; } // dialogs