Create group link previews; don't open Signal links in browser first; allow ephemeral download of previously-error'd pack

This commit is contained in:
Scott Nonnenberg 2021-02-10 14:39:26 -08:00 committed by GitHub
parent f832b018fc
commit e10ae03bb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 338 additions and 33 deletions

View file

@ -12,6 +12,7 @@ const linkify = LinkifyIt();
module.exports = {
findLinks,
getDomain,
isGroupLink,
isLinkSafeToPreview,
isLinkSneaky,
isStickerPack,
@ -34,6 +35,10 @@ function isStickerPack(link) {
return (link || '').startsWith('https://signal.art/addstickers/');
}
function isGroupLink(link) {
return (link || '').startsWith('https://signal.group/');
}
function findLinks(text, caretLocation) {
const haveCaretLocation = isNumber(caretLocation);
const textLength = text ? text.length : 0;