Process incoming story messages
This commit is contained in:
parent
df7cdfacc7
commit
eb91eb6fec
84 changed files with 4382 additions and 652 deletions
|
@ -1,9 +1,10 @@
|
|||
// Copyright 2021 Signal Messenger, LLC
|
||||
// Copyright 2021-2022 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
|
||||
import type {
|
||||
AttachmentType,
|
||||
AttachmentDraftType,
|
||||
ThumbnailType,
|
||||
} from '../../types/Attachment';
|
||||
import { IMAGE_JPEG } from '../../types/MIME';
|
||||
|
||||
|
@ -17,6 +18,14 @@ export const fakeAttachment = (
|
|||
...overrides,
|
||||
});
|
||||
|
||||
export const fakeThumbnail = (url: string): ThumbnailType => ({
|
||||
contentType: IMAGE_JPEG,
|
||||
height: 100,
|
||||
path: url,
|
||||
url,
|
||||
width: 100,
|
||||
});
|
||||
|
||||
export const fakeDraftAttachment = (
|
||||
overrides: Partial<AttachmentDraftType> = {}
|
||||
): AttachmentDraftType => ({
|
||||
|
|
|
@ -317,6 +317,13 @@ const LAST_NAMES = [
|
|||
export const getFirstName = (): string => sample(FIRST_NAMES) || 'Test';
|
||||
export const getLastName = (): string => sample(LAST_NAMES) || 'Test';
|
||||
|
||||
export const getAvatarPath = (): string =>
|
||||
sample([
|
||||
'/fixtures/kitten-1-64-64.jpg',
|
||||
'/fixtures/kitten-2-64-64.jpg',
|
||||
'/fixtures/kitten-3-64-64.jpg',
|
||||
]) || '';
|
||||
|
||||
export function getDefaultConversation(
|
||||
overrideProps: Partial<ConversationType> = {}
|
||||
): ConversationType {
|
||||
|
@ -325,6 +332,7 @@ export function getDefaultConversation(
|
|||
|
||||
return {
|
||||
acceptedMessageRequest: true,
|
||||
avatarPath: getAvatarPath(),
|
||||
badges: [],
|
||||
e164: '+1300555000',
|
||||
color: getRandomColor(),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue