Refactor Signal app routing
This commit is contained in:
parent
86e6c2499c
commit
3ef0d221d1
28 changed files with 1347 additions and 1044 deletions
|
@ -9,6 +9,7 @@ import { maybeParseUrl } from '../util/url';
|
|||
import { replaceEmojiWithSpaces } from '../util/emoji';
|
||||
|
||||
import type { AttachmentWithHydratedData } from './Attachment';
|
||||
import { artAddStickersRoute, groupInvitesRoute } from '../util/signalRoutes';
|
||||
|
||||
export type LinkPreviewImage = AttachmentWithHydratedData;
|
||||
|
||||
|
@ -95,11 +96,13 @@ export function shouldLinkifyMessage(
|
|||
}
|
||||
|
||||
export function isStickerPack(link = ''): boolean {
|
||||
return link.startsWith('https://signal.art/addstickers/');
|
||||
const url = maybeParseUrl(link);
|
||||
return url?.protocol === 'https:' && artAddStickersRoute.isMatch(url);
|
||||
}
|
||||
|
||||
export function isGroupLink(link = ''): boolean {
|
||||
return link.startsWith('https://signal.group/');
|
||||
const url = maybeParseUrl(link);
|
||||
return url?.protocol === 'https:' && groupInvitesRoute.isMatch(url);
|
||||
}
|
||||
|
||||
export function findLinks(text: string, caretLocation?: number): Array<string> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue