Skip to content
Snippets Groups Projects
Commit a05632e3 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

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
parent e842a445
Branches
Tags
No related merge requests found
...@@ -202,7 +202,7 @@ Loader { ...@@ -202,7 +202,7 @@ Loader {
dataTransferItem.hoveredLink = canOpen ? dataTransferItem.hoveredLink = canOpen ?
("file:///" + Body) : "" ("file:///" + Body) : ""
if (dataTransferItem.hoveredLink) if (dataTransferItem.hoveredLink)
Qt.openUrlExternally(dataTransferItem.hoveredLink) Qt.openUrlExternally(new Url(dataTransferItem.hoveredLink))
} }
} }
} }
......
...@@ -86,6 +86,7 @@ Item { ...@@ -86,6 +86,7 @@ Item {
text: ReplyToBody text: ReplyToBody
elide: Text.ElideRight elide: Text.ElideRight
textFormat: Text.MarkdownText
color: UtilsAdapter.luma(bubble.color) ? color: UtilsAdapter.luma(bubble.color) ?
JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorLight :
......
...@@ -83,7 +83,7 @@ SBSMessageBase { ...@@ -83,7 +83,7 @@ SBSMessageBase {
renderType: Text.NativeRendering renderType: Text.NativeRendering
textFormat: Text.MarkdownText textFormat: Text.MarkdownText
onLinkHovered: root.hoveredLink = hoveredLink onLinkHovered: root.hoveredLink = hoveredLink
onLinkActivated: Qt.openUrlExternally(hoveredLink) onLinkActivated: Qt.openUrlExternally(new URL(hoveredLink))
readOnly: true readOnly: true
color: getBaseColor() color: getBaseColor()
......
...@@ -155,7 +155,7 @@ BaseModalDialog { ...@@ -155,7 +155,7 @@ BaseModalDialog {
textFormat: TextEdit.RichText textFormat: TextEdit.RichText
selectByMouse: true selectByMouse: true
readOnly: true readOnly: true
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(new Url(link))
TextMetrics { TextMetrics {
id: textMetricsjamiDeclarationHyperText id: textMetricsjamiDeclarationHyperText
...@@ -189,7 +189,7 @@ BaseModalDialog { ...@@ -189,7 +189,7 @@ BaseModalDialog {
textFormat: TextEdit.RichText textFormat: TextEdit.RichText
selectByMouse: true selectByMouse: true
readOnly: true readOnly: true
onLinkActivated: Qt.openUrlExternally(link) onLinkActivated: Qt.openUrlExternally(new Url(link))
TextMetrics { TextMetrics {
id: textMetricsjamiNoneWarrantyHyperText id: textMetricsjamiNoneWarrantyHyperText
......
...@@ -70,6 +70,7 @@ Rectangle { ...@@ -70,6 +70,7 @@ Rectangle {
} }
text: metrics.elidedText text: metrics.elidedText
textFormat: Text.MarkdownText
color: UtilsAdapter.luma(root.color) ? color: UtilsAdapter.luma(root.color) ?
JamiTheme.chatviewTextColorLight : JamiTheme.chatviewTextColorLight :
JamiTheme.chatviewTextColorDark JamiTheme.chatviewTextColorDark
......
...@@ -92,7 +92,7 @@ Component { ...@@ -92,7 +92,7 @@ Component {
ctxMenu.y = mouse.y ctxMenu.y = mouse.y
ctxMenu.openMenu() ctxMenu.openMenu()
} else { } else {
Qt.openUrlExternally("file://" + Body) Qt.openUrlExternally(new Url("file://" + Body))
} }
} }
} }
......
...@@ -180,6 +180,7 @@ MessagesAdapter::editMessage(const QString& convId, const QString& newBody, cons ...@@ -180,6 +180,7 @@ MessagesAdapter::editMessage(const QString& convId, const QString& newBody, cons
if (editId.isEmpty()) { if (editId.isEmpty()) {
return; return;
} }
set_editId("");
lrcInstance_->getCurrentConversationModel()->editMessage(convId, newBody, editId); lrcInstance_->getCurrentConversationModel()->editMessage(convId, newBody, editId);
} catch (...) { } catch (...) {
qDebug() << "Exception during message edition:" << messageId; qDebug() << "Exception during message edition:" << messageId;
......
...@@ -220,7 +220,7 @@ Window { ...@@ -220,7 +220,7 @@ Window {
autoAccelerator: true autoAccelerator: true
onClicked: Qt.openUrlExternally( onClicked: Qt.openUrlExternally(
"https://jami.net/bugs-and-improvements/") new Url("https://jami.net/bugs-and-improvements/"))
} }
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment