Allow opening links in the MessageDelegateContextMenu
Fixes #167
(cherry picked from commit 449adf993c)
This commit is contained in:
committed by
Carl Schwan
parent
89bf5d3a31
commit
8060edd1c6
@@ -55,6 +55,18 @@ Kirigami.OverlaySheet {
|
||||
text: message
|
||||
Layout.fillWidth: true
|
||||
wrapMode: Text.WordWrap
|
||||
|
||||
onLinkActivated: {
|
||||
if (link.startsWith("https://matrix.to/")) {
|
||||
var result = link.replace(/\?.*/, "").match("https://matrix.to/#/(!.*:.*)/(\\$.*:.*)")
|
||||
if (!result || result.length < 3) return
|
||||
if (result[1] != currentRoom.id) return
|
||||
if (!result[2]) return
|
||||
goToEvent(result[2])
|
||||
} else {
|
||||
Qt.openUrlExternally(link)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user