summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
authorKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-16 23:30:50 +0300
committerKonstantinos Sideris <sideris.konstantin@gmail.com>2018-05-16 23:30:50 +0300
commit791a9d0a4d04a6340e04a303d5e055acfd8ed53a (patch)
tree130969532fa174118224861a20029c4282fc7e92 /include
parentAdd menu to modify the name & topic of the room (diff)
downloadnheko-791a9d0a4d04a6340e04a303d5e055acfd8ed53a.tar.xz
Hide the edit menu when the user doesn't have enough power
Diffstat (limited to 'include')
-rw-r--r--include/Cache.h6
-rw-r--r--include/dialogs/RoomSettings.hpp6
2 files changed, 12 insertions, 0 deletions
diff --git a/include/Cache.h b/include/Cache.h

index 20f277a9..d2574b76 100644 --- a/include/Cache.h +++ b/include/Cache.h
@@ -206,6 +206,12 @@ public: bool isFormatValid(); void setCurrentFormat(); + //! Check if the given user has power leve greater than than + //! lowest power level of the given events. + bool hasEnoughPowerLevel(const std::vector<mtx::events::EventType> &eventTypes, + const std::string &room_id, + const std::string &user_id); + //! Retrieves the saved room avatar. QImage getRoomAvatar(const QString &id); QImage getRoomAvatar(const std::string &id); diff --git a/include/dialogs/RoomSettings.hpp b/include/dialogs/RoomSettings.hpp
index f4145060..1434eee6 100644 --- a/include/dialogs/RoomSettings.hpp +++ b/include/dialogs/RoomSettings.hpp
@@ -7,6 +7,7 @@ class FlatButton; class TextField; +class QHBoxLayout; class Avatar; class QPixmap; class QLayout; @@ -91,6 +92,11 @@ private: static constexpr int AvatarSize = 64; void setAvatar(const QImage &img) { avatarImg_ = img; } + void setupEditButton(); + + //! Whether the user would be able to change the name or the topic of the room. + bool hasEditRights_ = true; + QHBoxLayout *editLayout_; // Button section FlatButton *saveBtn_;