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",
|
"message": "General",
|
||||||
"description": "Header for general options on the settings screen"
|
"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": {
|
"spellCheckDescription": {
|
||||||
"message": "Enable spell check of text entered in message composition box",
|
"message": "Enable spell check of text entered in message composition box",
|
||||||
"description": "Description of the media permission description"
|
"description": "Description of the media permission description"
|
||||||
|
|
|
@ -779,8 +779,10 @@
|
||||||
media
|
media
|
||||||
.filter(
|
.filter(
|
||||||
attachment =>
|
attachment =>
|
||||||
(attachment && attachment.thumbnail) || attachment.message
|
attachment &&
|
||||||
|
(attachment.image || (!attachment.pending && !attachment.error))
|
||||||
)
|
)
|
||||||
|
.slice(0, 1)
|
||||||
.map(async attachment => {
|
.map(async attachment => {
|
||||||
const { fileName } = attachment;
|
const { fileName } = attachment;
|
||||||
|
|
||||||
|
|
|
@ -1182,7 +1182,7 @@
|
||||||
urls.includes(item.url) &&
|
urls.includes(item.url) &&
|
||||||
window.Signal.LinkPreviews.isLinkInWhitelist(item.url)
|
window.Signal.LinkPreviews.isLinkInWhitelist(item.url)
|
||||||
);
|
);
|
||||||
if (preview.length > incomingPreview.length) {
|
if (preview.length < incomingPreview.length) {
|
||||||
window.log.info(
|
window.log.info(
|
||||||
`${message.idForLogging()}: Eliminated ${preview.length -
|
`${message.idForLogging()}: Eliminated ${preview.length -
|
||||||
incomingPreview.length} previews with invalid urls'`
|
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) {
|
function isMediaLinkInWhitelist(link) {
|
||||||
try {
|
try {
|
||||||
const url = new URL(link);
|
const url = new URL(link);
|
||||||
|
|
Loading…
Reference in a new issue