summary refs log tree commit diff
path: root/src/ui
diff options
context:
space:
mode:
authorJedi18 <targetakhil@gmail.com>2021-01-28 23:35:02 +0530
committerJedi18 <targetakhil@gmail.com>2021-01-28 23:35:02 +0530
commitb3f29f592b26806d4a82067bbb64f9ffd044d474 (patch)
tree939a32a835c8867da9e038c41e61b0a041ce0a21 /src/ui
parentUsername can be edited by double clicking on text, added global user profile ... (diff)
downloadnheko-b3f29f592b26806d4a82067bbb64f9ffd044d474.tar.xz
Changed edit method from double clicking to an edit button
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/UserProfile.cpp6
-rw-r--r--src/ui/UserProfile.h5
2 files changed, 7 insertions, 4 deletions
diff --git a/src/ui/UserProfile.cpp b/src/ui/UserProfile.cpp
index 4b7f054d..a53d25f4 100644
--- a/src/ui/UserProfile.cpp
+++ b/src/ui/UserProfile.cpp
@@ -12,12 +12,14 @@
 UserProfile::UserProfile(QString roomid,
                          QString userid,
                          TimelineViewManager *manager_,
-                         TimelineModel *parent)
+                         TimelineModel *parent,
+                         QString globalUsername)
   : QObject(parent)
   , roomid_(roomid)
   , userid_(userid)
   , manager(manager_)
   , model(parent)
+  , globalUsername(globalUsername)
 {
         fetchDeviceList(this->userid_);
 
@@ -98,7 +100,7 @@ UserProfile::userid()
 QString
 UserProfile::displayName()
 {
-        return cache::displayName(roomid_, userid_);
+        return globalUserProfile() ? globalUsername : cache::displayName(roomid_, userid_);
 }
 
 QString
diff --git a/src/ui/UserProfile.h b/src/ui/UserProfile.h
index 4839e0d8..04317766 100644
--- a/src/ui/UserProfile.h
+++ b/src/ui/UserProfile.h
@@ -94,7 +94,8 @@ public:
         UserProfile(QString roomid,
                     QString userid,
                     TimelineViewManager *manager_,
-                    TimelineModel *parent = nullptr);
+                    TimelineModel *parent = nullptr,
+                    QString globalUsername = "");
 
         DeviceInfoModel *deviceList();
 
@@ -119,11 +120,11 @@ public:
 
 signals:
         void userStatusChanged();
-
         void usernameEditingChanged();
 
 private:
         QString roomid_, userid_;
+        QString globalUsername;
         DeviceInfoModel deviceList_;
         bool isUserVerified = false;
         bool hasMasterKey   = false;