1
0
Fork 0
mirror of https://git.jami.net/savoirfairelinux/jami-client-qt.git synced 2025-08-03 22:35:45 +02:00

misc: avoid dirty qrc urls

e.g. <a href="test" id="fuzzelement1">test</a> is invalid
and should not open qrc://components/test

Also fix editId on message edition and format in the reply row.

Change-Id: I570ddf18f6ba716e448e9fbadd558a4d04cdef1c
This commit is contained in:
Sébastien Blin 2023-01-04 13:53:21 -05:00
parent e842a44567
commit a05632e3f4
8 changed files with 9 additions and 6 deletions

View file

@ -202,7 +202,7 @@ Loader {
dataTransferItem.hoveredLink = canOpen ?
("file:///" + Body) : ""
if (dataTransferItem.hoveredLink)
Qt.openUrlExternally(dataTransferItem.hoveredLink)
Qt.openUrlExternally(new Url(dataTransferItem.hoveredLink))
}
}
}

View file

@ -86,6 +86,7 @@ Item {
text: ReplyToBody
elide: Text.ElideRight
textFormat: Text.MarkdownText
color: UtilsAdapter.luma(bubble.color) ?
JamiTheme.chatviewTextColorLight :

View file

@ -83,7 +83,7 @@ SBSMessageBase {
renderType: Text.NativeRendering
textFormat: Text.MarkdownText
onLinkHovered: root.hoveredLink = hoveredLink
onLinkActivated: Qt.openUrlExternally(hoveredLink)
onLinkActivated: Qt.openUrlExternally(new URL(hoveredLink))
readOnly: true
color: getBaseColor()

View file

@ -155,7 +155,7 @@ BaseModalDialog {
textFormat: TextEdit.RichText
selectByMouse: true
readOnly: true
onLinkActivated: Qt.openUrlExternally(link)
onLinkActivated: Qt.openUrlExternally(new Url(link))
TextMetrics {
id: textMetricsjamiDeclarationHyperText
@ -189,7 +189,7 @@ BaseModalDialog {
textFormat: TextEdit.RichText
selectByMouse: true
readOnly: true
onLinkActivated: Qt.openUrlExternally(link)
onLinkActivated: Qt.openUrlExternally(new Url(link))
TextMetrics {
id: textMetricsjamiNoneWarrantyHyperText

View file

@ -70,6 +70,7 @@ Rectangle {
}
text: metrics.elidedText
textFormat: Text.MarkdownText
color: UtilsAdapter.luma(root.color) ?
JamiTheme.chatviewTextColorLight :
JamiTheme.chatviewTextColorDark

View file

@ -92,7 +92,7 @@ Component {
ctxMenu.y = mouse.y
ctxMenu.openMenu()
} else {
Qt.openUrlExternally("file://" + Body)
Qt.openUrlExternally(new Url("file://" + Body))
}
}
}

View file

@ -180,6 +180,7 @@ MessagesAdapter::editMessage(const QString& convId, const QString& newBody, cons
if (editId.isEmpty()) {
return;
}
set_editId("");
lrcInstance_->getCurrentConversationModel()->editMessage(convId, newBody, editId);
} catch (...) {
qDebug() << "Exception during message edition:" << messageId;

View file

@ -220,7 +220,7 @@ Window {
autoAccelerator: true
onClicked: Qt.openUrlExternally(
"https://jami.net/bugs-and-improvements/")
new Url("https://jami.net/bugs-and-improvements/"))
}
}
}