ResolveResource
Use ResolveResource rather than calling individual functions like visit user and room
This commit is contained in:
@@ -149,7 +149,7 @@ QQC2.Control {
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
Accessible.name: contentItem.text
|
||||
onClicked: RoomManager.visitUser(root.author.object, "mention")
|
||||
onClicked: RoomManager.resolveResource(root.author.id, "mention")
|
||||
}
|
||||
QQC2.Label {
|
||||
text: root.timeString
|
||||
|
||||
@@ -33,7 +33,7 @@ ColumnLayout {
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
onClicked: {
|
||||
RoomManager.visitUser(root.room.getUser(root.room.directChatRemoteUser.id).object, "mention")
|
||||
RoomManager.resolveResource(root.room.directChatRemoteUser.id, "mention")
|
||||
}
|
||||
|
||||
contentItem: KirigamiComponents.Avatar {
|
||||
|
||||
@@ -26,7 +26,7 @@ RowLayout {
|
||||
if (isJoined) {
|
||||
RoomManager.enterRoom(root.connection.room(roomId))
|
||||
} else {
|
||||
RoomManager.openResource(roomId.length > 0 ? roomId : alias, "join")
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, "join")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -57,7 +57,7 @@ ColumnLayout {
|
||||
if (isJoined) {
|
||||
RoomManager.enterRoom(root.connection.room(roomId));
|
||||
} else {
|
||||
RoomManager.openResource(roomId.length > 0 ? roomId : alias, "join");
|
||||
RoomManager.resolveResource(roomId.length > 0 ? roomId : alias, "join");
|
||||
}
|
||||
})
|
||||
exploreTabBar.currentIndex = -1;
|
||||
|
||||
@@ -66,7 +66,7 @@ Labs.MenuBar {
|
||||
if (isJoined) {
|
||||
RoomManager.enterRoom(root.connection.room(roomId))
|
||||
} else {
|
||||
RoomManager.openResource(roomId, "join")
|
||||
RoomManager.resolveResource(roomId, "join")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ Loader {
|
||||
}
|
||||
</style>
|
||||
<a href=\"" + root.linkPreviewer.url + "\">" + (maximizeButton.checked ? root.linkPreviewer.title : titleTextMetrics.elidedText).replace("–", "—") + "</a>"
|
||||
onLinkActivated: RoomManager.openResource(link, "join")
|
||||
onLinkActivated: RoomManager.resolveResource(link, "join")
|
||||
|
||||
TextMetrics {
|
||||
id: titleTextMetrics
|
||||
|
||||
@@ -355,7 +355,7 @@ TimelineDelegate {
|
||||
source: root.author.avatarSource
|
||||
color: root.author.color
|
||||
|
||||
onClicked: RoomManager.visitUser(root.author.object, "mention")
|
||||
onClicked: RoomManager.resolveResource(root.author.id, "mention")
|
||||
}
|
||||
Bubble {
|
||||
id: bubble
|
||||
|
||||
@@ -209,7 +209,7 @@ Loader {
|
||||
model: WebShortcutModel {
|
||||
id: webshortcutmodel
|
||||
selectedText: root.selectedText.length > 0 ? root.selectedText : root.plainText
|
||||
onOpenUrl: RoomManager.visitNonMatrix(url)
|
||||
onOpenUrl: RoomManager.resolveResource(url)
|
||||
}
|
||||
delegate: QQC2.MenuItem {
|
||||
text: model.display
|
||||
@@ -315,7 +315,7 @@ Loader {
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
onLinkActivated: RoomManager.openResource(link, "join");
|
||||
onLinkActivated: RoomManager.resolveResource(link, "join");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ Kirigami.ScrollablePage {
|
||||
delegate: QQC2.ItemDelegate {
|
||||
width: parent?.width ?? 0
|
||||
|
||||
onClicked: RoomManager.visitRoom(model.room, model.eventId)
|
||||
onClicked: RoomManager.resolveResource(model.uri)
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.largeSpacing
|
||||
|
||||
|
||||
@@ -112,7 +112,7 @@ a{
|
||||
|
||||
onLinkActivated: link => {
|
||||
spoilerRevealed = true
|
||||
RoomManager.openResource(link, "join")
|
||||
RoomManager.resolveResource(link, "join")
|
||||
}
|
||||
onHoveredLinkChanged: if (hoveredLink.length > 0 && hoveredLink !== "1") {
|
||||
applicationWindow().hoverLinkIndicator.text = hoveredLink;
|
||||
|
||||
@@ -206,7 +206,7 @@ QQC2.ScrollView {
|
||||
|
||||
onClicked: {
|
||||
userDelegate.highlighted = true;
|
||||
RoomManager.visitUser(room.getUser(userDelegate.userId).object, "mention")
|
||||
RoomManager.resolveResource(userDelegate.userId, "mention")
|
||||
}
|
||||
|
||||
contentItem: RowLayout {
|
||||
|
||||
@@ -191,7 +191,7 @@ Kirigami.Page {
|
||||
if (isJoined) {
|
||||
RoomManager.enterRoom(root.connection.room(roomId))
|
||||
} else {
|
||||
RoomManager.openResource(roomId, "join")
|
||||
RoomManager.resolveResource(roomId, "join")
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -149,7 +149,7 @@ Item {
|
||||
if (root.isJoined) {
|
||||
root.enterRoom()
|
||||
} else {
|
||||
RoomManager.openResource(root.roomId, "join")
|
||||
RoomManager.resolveResource(root.roomId, "join")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -62,7 +62,7 @@ RowLayout {
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
cursorShape: Qt.PointingHandCursor
|
||||
onClicked: RoomManager.openResource("https://matrix.to/#/" + root.author.id)
|
||||
onClicked: RoomManager.resolveResource("https://matrix.to/#/" + root.author.id)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -73,6 +73,6 @@ RowLayout {
|
||||
text: `<style>a {text-decoration: none;}</style><a href="https://matrix.to/#/${root.author.id}" style="color: ${root.author.color}">${root.authorDisplayName}</a> ${root.text}`
|
||||
wrapMode: Text.WordWrap
|
||||
textFormat: Text.RichText
|
||||
onLinkActivated: link => RoomManager.openResource(link)
|
||||
onLinkActivated: link => RoomManager.resolveResource(link)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -156,7 +156,7 @@ TimelineDelegate {
|
||||
elide: Qt.ElideRight
|
||||
textFormat: Text.RichText
|
||||
wrapMode: Text.WordWrap
|
||||
onLinkActivated: RoomManager.openResource(link)
|
||||
onLinkActivated: RoomManager.resolveResource(link)
|
||||
}
|
||||
Item {
|
||||
Layout.fillWidth: true
|
||||
|
||||
Reference in New Issue
Block a user