summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChatPage.cpp2
-rw-r--r--src/timeline/TimelineModel.cpp6
-rw-r--r--src/ui/UserProfile.cpp8
-rw-r--r--src/ui/UserProfile.h4
4 files changed, 8 insertions, 12 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp

index cf50e62a..07ed3941 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp
@@ -113,7 +113,7 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QWidget *parent) user_info_widget_ = new UserInfoWidget(sideBar_); connect(user_info_widget_, &UserInfoWidget::openGlobalUserProfile, this, [this]() { - view_manager_->activeTimeline()->openUserProfile("", true); + view_manager_->activeTimeline()->openUserProfile(utils::localUser(), true); }); user_mentions_popup_ = new popups::UserMentions(); diff --git a/src/timeline/TimelineModel.cpp b/src/timeline/TimelineModel.cpp
index 73077508..79cf5184 100644 --- a/src/timeline/TimelineModel.cpp +++ b/src/timeline/TimelineModel.cpp
@@ -801,11 +801,7 @@ TimelineModel::viewDecryptedRawMessage(QString id) const void TimelineModel::openUserProfile(QString userid, bool global) { - if (global) { - emit openProfile(new UserProfile("", utils::localUser(), manager_, this)); - } else { - emit openProfile(new UserProfile(room_id_, userid, manager_, this)); - } + emit openProfile(new UserProfile(global ? "" : room_id_, userid, manager_, this)); } void diff --git a/src/ui/UserProfile.cpp b/src/ui/UserProfile.cpp
index e2adffcd..9e8d45b5 100644 --- a/src/ui/UserProfile.cpp +++ b/src/ui/UserProfile.cpp
@@ -116,7 +116,7 @@ UserProfile::userid() QString UserProfile::displayName() { - return globalUserProfile() ? globalUsername : cache::displayName(roomid_, userid_); + return isGlobalUserProfile() ? globalUsername : cache::displayName(roomid_, userid_); } QString @@ -126,9 +126,9 @@ UserProfile::avatarUrl() } bool -UserProfile::globalUserProfile() const +UserProfile::isGlobalUserProfile() const { - return (roomid_ == "") && isSelf(); + return roomid_ == ""; } bool @@ -241,7 +241,7 @@ UserProfile::startChat() void UserProfile::changeUsername(QString username) { - if (globalUserProfile()) { + if (isGlobalUserProfile()) { // change global http::client()->set_displayname( username.toStdString(), [this](mtx::http::RequestErr err) { diff --git a/src/ui/UserProfile.h b/src/ui/UserProfile.h
index 5ccb54b3..d450d58f 100644 --- a/src/ui/UserProfile.h +++ b/src/ui/UserProfile.h
@@ -83,7 +83,7 @@ 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 isGlobalUserProfile READ isGlobalUserProfile CONSTANT) Q_PROPERTY(bool isUserVerified READ getUserStatus NOTIFY userStatusChanged) Q_PROPERTY( bool userVerificationEnabled READ userVerificationEnabled NOTIFY userStatusChanged) @@ -101,7 +101,7 @@ public: QString userid(); QString displayName(); QString avatarUrl(); - bool globalUserProfile() const; + bool isGlobalUserProfile() const; bool getUserStatus(); bool userVerificationEnabled() const; bool isSelf() const;