mirror of
https://github.com/oxen-io/session-desktop.git
synced 2023-12-14 02:12:57 +01:00
A number of small fixes for Link Previews
This commit is contained in:
parent
b26f6231d8
commit
0d7480bd92
4 changed files with 5 additions and 14 deletions
|
@ -1076,17 +1076,6 @@
|
|||
"message": "General",
|
||||
"description": "Header for general options on the settings screen"
|
||||
},
|
||||
"sendLinkPreviews": {
|
||||
"message": "Send Link Previews",
|
||||
"description":
|
||||
"Option to control creation and send of link previews in setting screen"
|
||||
},
|
||||
"linkPreviewsDescription": {
|
||||
"message":
|
||||
"Previews are supported for Imgur, Instagram, Reddit, and YouTube links.",
|
||||
"description":
|
||||
"Additional detail provided for Link Previews option in settings screen"
|
||||
},
|
||||
"spellCheckDescription": {
|
||||
"message": "Enable spell check of text entered in message composition box",
|
||||
"description": "Description of the media permission description"
|
||||
|
|
|
@ -779,8 +779,10 @@
|
|||
media
|
||||
.filter(
|
||||
attachment =>
|
||||
(attachment && attachment.thumbnail) || attachment.message
|
||||
attachment &&
|
||||
(attachment.image || (!attachment.pending && !attachment.error))
|
||||
)
|
||||
.slice(0, 1)
|
||||
.map(async attachment => {
|
||||
const { fileName } = attachment;
|
||||
|
||||
|
|
|
@ -1182,7 +1182,7 @@
|
|||
urls.includes(item.url) &&
|
||||
window.Signal.LinkPreviews.isLinkInWhitelist(item.url)
|
||||
);
|
||||
if (preview.length > incomingPreview.length) {
|
||||
if (preview.length < incomingPreview.length) {
|
||||
window.log.info(
|
||||
`${message.idForLogging()}: Eliminated ${preview.length -
|
||||
incomingPreview.length} previews with invalid urls'`
|
||||
|
|
|
@ -55,7 +55,7 @@ function isLinkInWhitelist(link) {
|
|||
}
|
||||
}
|
||||
|
||||
const SUPPORTED_MEDIA_DOMAINS = /^([^.]+\.)*(ytimg.com|cdninstagram.com|redd.it|imgur.com)$/i;
|
||||
const SUPPORTED_MEDIA_DOMAINS = /^([^.]+\.)*(ytimg.com|cdninstagram.com|redd.it|imgur.com|fbcdn.net)$/i;
|
||||
function isMediaLinkInWhitelist(link) {
|
||||
try {
|
||||
const url = new URL(link);
|
||||
|
|
Loading…
Reference in a new issue