summary refs log tree commit diff
path: root/resources
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-04-28 20:03:52 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2021-04-28 20:03:52 +0200
commit76a9240076b390d8d4a03f709f91d4a1c08ce258 (patch)
tree2d003eeea3bcffa81977fcc511f1aff6cf0368c7 /resources
parentAdd Alt-F to forward messages (diff)
downloadnheko-76a9240076b390d8d4a03f709f91d4a1c08ce258.tar.xz
Rewrite matrix.to links to matrix uris and handle them the same way
Diffstat (limited to 'resources')
-rw-r--r--resources/qml/MatrixText.qml14
1 files changed, 1 insertions, 13 deletions
diff --git a/resources/qml/MatrixText.qml b/resources/qml/MatrixText.qml

index dfe7122d..0876e610 100644 --- a/resources/qml/MatrixText.qml +++ b/resources/qml/MatrixText.qml
@@ -14,19 +14,7 @@ TextEdit { selectByMouse: !Settings.mobileMode enabled: selectByMouse color: colors.text - onLinkActivated: { - if (/^https:\/\/matrix.to\/#\/(@.*)$/.test(link)) { - chat.model.openUserProfile(/^https:\/\/matrix.to\/#\/(@.*)$/.exec(link)[1]); - } else if (/^https:\/\/matrix.to\/#\/(![^\/]*)$/.test(link)) { - TimelineManager.setHistoryView(/^https:\/\/matrix.to\/#\/(!.*)$/.exec(link)[1]); - } else if (/^https:\/\/matrix.to\/#\/(![^\/]*)\/(\$.*)$/.test(link)) { - var match = /^https:\/\/matrix.to\/#\/(![^\/]*)\/(\$.*)$/.exec(link); - TimelineManager.setHistoryView(match[1]); - chat.positionViewAtIndex(chat.model.idToIndex(match[2]), ListView.Contain); - } else { - TimelineManager.openLink(link); - } - } + onLinkActivated: TimelineManager.openLink(link); ToolTip.visible: hoveredLink ToolTip.text: hoveredLink