summary refs log tree commit diff
path: root/src/ui/UserProfile.h
diff options
context:
space:
mode:
authorJedi18 <targetakhil@gmail.com>2021-01-28 20:03:50 +0530
committerJedi18 <targetakhil@gmail.com>2021-01-28 20:03:50 +0530
commit87490c29cd8af7c17b5a4591798f1f0ebfa9023c (patch)
treec50314997fdebd69b54464dd7ee55c41f9cc5419 /src/ui/UserProfile.h
parentupdate room specific username from userprofile (diff)
downloadnheko-87490c29cd8af7c17b5a4591798f1f0ebfa9023c.tar.xz
Username can be edited by double clicking on text, added global user profile menu action in user info widget
Diffstat (limited to '')
-rw-r--r--src/ui/UserProfile.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/ui/UserProfile.h b/src/ui/UserProfile.h
index df90e5a1..4839e0d8 100644
--- a/src/ui/UserProfile.h
+++ b/src/ui/UserProfile.h
@@ -83,10 +83,13 @@ class UserProfile : public QObject
         Q_PROPERTY(QString userid READ userid CONSTANT)
         Q_PROPERTY(QString avatarUrl READ avatarUrl CONSTANT)
         Q_PROPERTY(DeviceInfoModel *deviceList READ deviceList CONSTANT)
+        Q_PROPERTY(bool globalUserProfile READ globalUserProfile CONSTANT)
         Q_PROPERTY(bool isUserVerified READ getUserStatus NOTIFY userStatusChanged)
         Q_PROPERTY(
           bool userVerificationEnabled READ userVerificationEnabled NOTIFY userStatusChanged)
         Q_PROPERTY(bool isSelf READ isSelf CONSTANT)
+        Q_PROPERTY(
+          bool isUsernameEditingAllowed READ isUsernameEditingAllowed NOTIFY usernameEditingChanged)
 public:
         UserProfile(QString roomid,
                     QString userid,
@@ -98,9 +101,11 @@ public:
         QString userid();
         QString displayName();
         QString avatarUrl();
+        bool globalUserProfile() const;
         bool getUserStatus();
         bool userVerificationEnabled() const;
         bool isSelf() const;
+        bool isUsernameEditingAllowed() const;
 
         Q_INVOKABLE void verify(QString device = "");
         Q_INVOKABLE void unverify(QString device = "");
@@ -110,15 +115,19 @@ public:
         Q_INVOKABLE void kickUser();
         Q_INVOKABLE void startChat();
         Q_INVOKABLE void changeUsername(QString username);
+        Q_INVOKABLE void allowUsernameEditing(bool allow);
 
 signals:
         void userStatusChanged();
 
+        void usernameEditingChanged();
+
 private:
         QString roomid_, userid_;
         DeviceInfoModel deviceList_;
         bool isUserVerified = false;
         bool hasMasterKey   = false;
+        bool usernameEditing = false;
         TimelineViewManager *manager;
         TimelineModel *model;
 };