Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
savoirfairelinux
jami-client-qt
Commits
5337ede5
Commit
5337ede5
authored
Apr 27, 2022
by
Sébastien Blin
Browse files
preview: fix undefined domain for twitter and color with luma
Change-Id: I28a5d02881b9b5eb57ad6efa646dd1c5a3327856 GitLab:
#670
parent
920bb44a
Changes
3
Hide whitespace changes
Inline
Side-by-side
resources/misc/previewInterop.js
View file @
5337ede5
...
...
@@ -24,13 +24,13 @@ function getPreviewInfo(messageId, url) {
var
doc
=
parser
.
parseFromString
(
html
,
"
text/html
"
)
if
(
!
url
.
includes
(
"
twitter.com
"
)){
title
=
getTitle
(
doc
)
image
=
getImage
(
doc
,
url
)
description
=
getDescription
(
doc
)
var
domain
=
(
new
URL
(
url
))
domain
=
(
domain
.
hostname
).
replace
(
"
www.
"
,
""
)
}
else
{
title
=
"
Twitter. It's what's happening.
"
}
image
=
getImage
(
doc
,
url
)
description
=
getDescription
(
doc
)
var
domain
=
(
new
URL
(
url
))
domain
=
(
domain
.
hostname
).
replace
(
"
www.
"
,
""
)
window
.
jsbridge
.
emitInfoReady
(
messageId
,
{
'
title
'
:
title
,
...
...
src/commoncomponents/TextMessageDelegate.qml
View file @
5337ede5
...
...
@@ -148,7 +148,9 @@ SBSMessageBase {
wrapMode
:
Label
.
WrapAtWordBoundaryOrAnywhere
renderType
:
Text
.
NativeRendering
textFormat
:
TextEdit
.
RichText
color
:
JamiTheme
.
previewTitleColor
color
:
UtilsAdapter
.
luma
(
bubble
.
color
)
?
JamiTheme
.
chatviewTextColorLight
:
JamiTheme
.
chatviewTextColorDark
visible
:
LinkPreviewInfo
.
title
!==
null
text
:
LinkPreviewInfo
.
title
}
...
...
@@ -159,7 +161,9 @@ SBSMessageBase {
wrapMode
:
Label
.
WrapAtWordBoundaryOrAnywhere
renderType
:
Text
.
NativeRendering
textFormat
:
TextEdit
.
RichText
color
:
JamiTheme
.
previewSubtitleColor
color
:
UtilsAdapter
.
luma
(
bubble
.
color
)
?
JamiTheme
.
chatviewTextColorLight
:
JamiTheme
.
chatviewTextColorDark
visible
:
LinkPreviewInfo
.
description
!==
null
text
:
'
<a href=" " style="text-decoration:
'
+
(
hoveredLink
?
'
underline
'
:
'
none
'
)
+
'
;"
'
+
...
...
@@ -172,7 +176,9 @@ SBSMessageBase {
wrapMode
:
Label
.
WrapAtWordBoundaryOrAnywhere
renderType
:
Text
.
NativeRendering
textFormat
:
TextEdit
.
RichText
color
:
JamiTheme
.
previewSubtitleColor
color
:
UtilsAdapter
.
luma
(
bubble
.
color
)
?
JamiTheme
.
chatviewTextColorLight
:
JamiTheme
.
chatviewTextColorDark
text
:
LinkPreviewInfo
.
domain
}
}
...
...
src/constant/JamiTheme.qml
View file @
5337ede5
...
...
@@ -175,8 +175,6 @@ Item {
property
color
chatviewButtonColor
:
darkTheme
?
whiteColor
:
blackColor
property
color
bgTextInput
:
darkTheme
?
"
#060608
"
:
whiteColor
property
color
previewTextContainerColor
:
darkTheme
?
"
#959595
"
:
"
#ececec
"
property
color
previewTitleColor
:
darkTheme
?
whiteColor
:
blackColor
property
color
previewSubtitleColor
:
darkTheme
?
whiteColor
:
blackColor
property
color
previewImageBackgroundColor
:
whiteColor
property
color
previewCardContainerColor
:
darkTheme
?
blackColor
:
whiteColor
property
color
previewUrlColor
:
darkTheme
?
"
#eeeeee
"
:
"
#333
"
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment