summary refs log tree commit diff
diff options
context:
space:
mode:
authorLoren Burkholder <computersemiexpert@outlook.com>2021-07-21 20:38:18 -0400
committerLoren Burkholder <computersemiexpert@outlook.com>2021-07-21 20:38:18 -0400
commitbbecadf1a8c3d78609a6112a879288f841b592f4 (patch)
tree19c15636e52903332703b2ccc607c98321781d37
parentPad the loading spinner (diff)
downloadnheko-bbecadf1a8c3d78609a6112a879288f841b592f4.tar.xz
Add functionality for loading global user profile where needed
This is so viewing profiles from the invite dialog will work as expected.
-rw-r--r--resources/qml/InviteDialog.qml2
-rw-r--r--src/timeline/TimelineViewManager.cpp6
-rw-r--r--src/timeline/TimelineViewManager.h1
3 files changed, 8 insertions, 1 deletions
diff --git a/resources/qml/InviteDialog.qml b/resources/qml/InviteDialog.qml
index 5aaf0d6d..50287ad5 100644
--- a/resources/qml/InviteDialog.qml
+++ b/resources/qml/InviteDialog.qml
@@ -107,7 +107,7 @@ ApplicationWindow {
                     userid: model.mxid
                     url: model.avatarUrl.replace("mxc://", "image://MxcImage/")
                     displayName: model.displayName
-                    onClicked: Rooms.currentRoom.openUserProfile(model.mxid)
+                    onClicked: TimelineManager.openGlobalUserProfile(model.mxid)
                 }
 
                 ColumnLayout {
diff --git a/src/timeline/TimelineViewManager.cpp b/src/timeline/TimelineViewManager.cpp
index b1643798..da3ba282 100644
--- a/src/timeline/TimelineViewManager.cpp
+++ b/src/timeline/TimelineViewManager.cpp
@@ -379,6 +379,12 @@ TimelineViewManager::openInviteUsers(QString roomId)
         emit openInviteUsersDialog(model);
 }
 
+void TimelineViewManager::openGlobalUserProfile(QString userId)
+{
+        UserProfile *profile = new UserProfile{QString{}, userId, this};
+        emit openProfile(profile);
+}
+
 void
 TimelineViewManager::setVideoCallItem()
 {
diff --git a/src/timeline/TimelineViewManager.h b/src/timeline/TimelineViewManager.h
index 374685e3..bfc116b1 100644
--- a/src/timeline/TimelineViewManager.h
+++ b/src/timeline/TimelineViewManager.h
@@ -67,6 +67,7 @@ public:
         Q_INVOKABLE void openRoomMembers(QString room_id);
         Q_INVOKABLE void openRoomSettings(QString room_id);
         Q_INVOKABLE void openInviteUsers(QString roomId);
+        Q_INVOKABLE void openGlobalUserProfile(QString userId);
 
         Q_INVOKABLE void focusMessageInput();
         Q_INVOKABLE void openLeaveRoomDialog(QString roomid) const;