Visit User
Move to using visit user in all cases.
This commit is contained in:
@@ -375,10 +375,7 @@ ColumnLayout {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: currentRoom,
|
||||
user: root.author
|
||||
}).open();
|
||||
RoomManager.visitUser(root.author.object, "mention")
|
||||
}
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
}
|
||||
@@ -459,10 +456,7 @@ ColumnLayout {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: {
|
||||
userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: currentRoom,
|
||||
user: root.author
|
||||
}).open();
|
||||
RoomManager.visitUser(root.author.object, "mention")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -222,12 +222,6 @@ QQC2.ScrollView {
|
||||
FileDelegateContextMenu {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: userDetailDialog
|
||||
|
||||
UserDetailDialog {}
|
||||
}
|
||||
|
||||
TypingPane {
|
||||
id: typingPane
|
||||
visible: root.currentRoom && root.currentRoom.usersTyping.length > 0
|
||||
@@ -445,11 +439,4 @@ QQC2.ScrollView {
|
||||
function positionViewAtBeginning() {
|
||||
messageListView.positionViewAtBeginning()
|
||||
}
|
||||
|
||||
function showUserDetail(user) {
|
||||
userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: root.currentRoom,
|
||||
user: root.currentRoom.getUser(user.id),
|
||||
}).open();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -189,7 +189,22 @@ Kirigami.Page {
|
||||
banner.visible = true;
|
||||
}
|
||||
|
||||
Connections {
|
||||
target: RoomManager
|
||||
function onShowUserDetail(user) {
|
||||
root.showUserDetail(user)
|
||||
}
|
||||
}
|
||||
|
||||
function showUserDetail(user) {
|
||||
timelineViewLoader.item.showUserDetail(user)
|
||||
userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: root.currentRoom,
|
||||
user: root.currentRoom.getUser(user.id),
|
||||
}).open();
|
||||
}
|
||||
|
||||
Component {
|
||||
id: userDetailDialog
|
||||
UserDetailDialog {}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,17 +26,7 @@ ColumnLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
onClicked: {
|
||||
const popup = userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: room,
|
||||
user: room.getUser(room.directChatRemoteUser.id),
|
||||
})
|
||||
popup.closed.connect(() => {
|
||||
userListItem.highlighted = false
|
||||
})
|
||||
if (roomDrawer.modal) {
|
||||
roomDrawer.close()
|
||||
}
|
||||
popup.open()
|
||||
RoomManager.visitUser(room.getUser(room.directChatRemoteUser.id).object, "mention")
|
||||
}
|
||||
|
||||
contentItem: KirigamiComponents.Avatar {
|
||||
|
||||
@@ -207,14 +207,7 @@ ListView {
|
||||
|
||||
onClicked: {
|
||||
userDelegate.highlighted = true;
|
||||
const popup = userDetailDialog.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
room: root.room,
|
||||
user: root.room.getUser(userDelegate.userId)
|
||||
});
|
||||
popup.closed.connect(() => {
|
||||
userDelegate.highlighted = false;
|
||||
});
|
||||
popup.open();
|
||||
RoomManager.visitUser(room.getUser(userDelegate.userId).object, "mention")
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
@@ -258,11 +251,6 @@ ListView {
|
||||
DirectChatDrawerHeader {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: userDetailDialog
|
||||
UserDetailDialog {}
|
||||
}
|
||||
|
||||
onRoomChanged: {
|
||||
if (root.headerItem) {
|
||||
root.headerItem.userListSearchField.text = "";
|
||||
|
||||
@@ -112,11 +112,6 @@ Kirigami.ApplicationWindow {
|
||||
secondaryWindow.show();
|
||||
}
|
||||
|
||||
function onShowUserDetail(user) {
|
||||
const roomItem = pageStack.get(pageStack.depth - 1);
|
||||
roomItem.showUserDetail(user);
|
||||
}
|
||||
|
||||
function onAskDirectChatConfirmation(user) {
|
||||
askDirectChatConfirmationComponent.createObject(QQC2.ApplicationWindow.overlay, {
|
||||
user: user,
|
||||
@@ -338,11 +333,6 @@ Kirigami.ApplicationWindow {
|
||||
RoomWindow {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: userDialog
|
||||
UserDetailDialog {}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: askDirectChatConfirmationComponent
|
||||
|
||||
|
||||
@@ -94,7 +94,7 @@ public:
|
||||
*
|
||||
* @sa Quotient::UriResolverBase::visitUser(), Quotient::UriResolverBase::visitResource()
|
||||
*/
|
||||
UriResolveResult visitUser(User *user, const QString &action) override;
|
||||
Q_INVOKABLE UriResolveResult visitUser(User *user, const QString &action) override;
|
||||
|
||||
/**
|
||||
* @brief Visit a room.
|
||||
|
||||
Reference in New Issue
Block a user