A number of small fixes for Link Previews
This commit is contained in:
@@ -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);
|
||||
|
Reference in New Issue
Block a user