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:
parent
f832b018fc
commit
e10ae03bb7
8 changed files with 338 additions and 33 deletions
2
js/modules/link_previews.d.ts
vendored
2
js/modules/link_previews.d.ts
vendored
|
@ -7,6 +7,8 @@ export function findLinks(text: string, caretLocation?: number): Array<string>;
|
|||
|
||||
export function getDomain(href: string): string;
|
||||
|
||||
export function isGroupLink(href: string): boolean;
|
||||
|
||||
export function isLinkSneaky(link: string): boolean;
|
||||
|
||||
export function isStickerPack(href: string): boolean;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -354,7 +354,12 @@ async function downloadEphemeralPack(packId, packKey) {
|
|||
} = getReduxStickerActions();
|
||||
|
||||
const existingPack = getStickerPack(packId);
|
||||
if (existingPack) {
|
||||
if (
|
||||
existingPack &&
|
||||
(existingPack.status === 'downloaded' ||
|
||||
existingPack.status === 'installed' ||
|
||||
existingPack.status === 'pending')
|
||||
) {
|
||||
log.warn(
|
||||
`Ephemeral download for pack ${redactPackId(
|
||||
packId
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue