Process incoming story messages

This commit is contained in:
Josh Perez 2022-03-04 16:14:52 -05:00 committed by GitHub
parent df7cdfacc7
commit eb91eb6fec
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
84 changed files with 4382 additions and 652 deletions

View file

@ -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 => ({

View file

@ -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(),