2021-03-11 21:29:31 +00:00
|
|
|
// Copyright 2020-2021 Signal Messenger, LLC
|
2020-12-08 19:37:04 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
|
|
|
import { v4 as generateUuid } from 'uuid';
|
2021-03-11 21:29:31 +00:00
|
|
|
import { sample } from 'lodash';
|
2020-12-18 19:16:44 +00:00
|
|
|
import { ConversationType } from '../../state/ducks/conversations';
|
2020-12-08 19:37:04 +00:00
|
|
|
|
2021-01-29 21:19:24 +00:00
|
|
|
const FIRST_NAMES = [
|
|
|
|
'James',
|
|
|
|
'John',
|
|
|
|
'Robert',
|
|
|
|
'Michael',
|
|
|
|
'William',
|
|
|
|
'David',
|
|
|
|
'Richard',
|
|
|
|
'Joseph',
|
|
|
|
'Thomas',
|
|
|
|
'Charles',
|
|
|
|
'Christopher',
|
|
|
|
'Daniel',
|
|
|
|
'Matthew',
|
|
|
|
'Anthony',
|
|
|
|
'Donald',
|
|
|
|
'Mark',
|
|
|
|
'Paul',
|
|
|
|
'Steven',
|
|
|
|
'Andrew',
|
|
|
|
'Kenneth',
|
|
|
|
'Joshua',
|
|
|
|
'Kevin',
|
|
|
|
'Brian',
|
|
|
|
'George',
|
|
|
|
'Edward',
|
|
|
|
'Ronald',
|
|
|
|
'Timothy',
|
|
|
|
'Jason',
|
|
|
|
'Jeffrey',
|
|
|
|
'Ryan',
|
|
|
|
'Jacob',
|
|
|
|
'Gary',
|
|
|
|
'Nicholas',
|
|
|
|
'Eric',
|
|
|
|
'Jonathan',
|
|
|
|
'Stephen',
|
|
|
|
'Larry',
|
|
|
|
'Justin',
|
|
|
|
'Scott',
|
|
|
|
'Brandon',
|
|
|
|
'Benjamin',
|
|
|
|
'Samuel',
|
|
|
|
'Frank',
|
|
|
|
'Gregory',
|
|
|
|
'Raymond',
|
|
|
|
'Alexander',
|
|
|
|
'Patrick',
|
|
|
|
'Jack',
|
|
|
|
'Dennis',
|
|
|
|
'Jerry',
|
|
|
|
'Tyler',
|
|
|
|
'Aaron',
|
|
|
|
'Jose',
|
|
|
|
'Henry',
|
|
|
|
'Adam',
|
|
|
|
'Douglas',
|
|
|
|
'Nathan',
|
|
|
|
'Peter',
|
|
|
|
'Zachary',
|
|
|
|
'Kyle',
|
|
|
|
'Walter',
|
|
|
|
'Harold',
|
|
|
|
'Jeremy',
|
|
|
|
'Ethan',
|
|
|
|
'Carl',
|
|
|
|
'Keith',
|
|
|
|
'Roger',
|
|
|
|
'Gerald',
|
|
|
|
'Christian',
|
|
|
|
'Terry',
|
|
|
|
'Sean',
|
|
|
|
'Arthur',
|
|
|
|
'Austin',
|
|
|
|
'Noah',
|
|
|
|
'Lawrence',
|
|
|
|
'Jesse',
|
|
|
|
'Joe',
|
|
|
|
'Bryan',
|
|
|
|
'Billy',
|
|
|
|
'Jordan',
|
|
|
|
'Albert',
|
|
|
|
'Dylan',
|
|
|
|
'Bruce',
|
|
|
|
'Willie',
|
|
|
|
'Gabriel',
|
|
|
|
'Alan',
|
|
|
|
'Juan',
|
|
|
|
'Logan',
|
|
|
|
'Wayne',
|
|
|
|
'Ralph',
|
|
|
|
'Roy',
|
|
|
|
'Eugene',
|
|
|
|
'Randy',
|
|
|
|
'Vincent',
|
|
|
|
'Russell',
|
|
|
|
'Louis',
|
|
|
|
'Philip',
|
|
|
|
'Bobby',
|
|
|
|
'Johnny',
|
|
|
|
'Bradley',
|
|
|
|
'Mary',
|
|
|
|
'Patricia',
|
|
|
|
'Jennifer',
|
|
|
|
'Linda',
|
|
|
|
'Elizabeth',
|
|
|
|
'Barbara',
|
|
|
|
'Susan',
|
|
|
|
'Jessica',
|
|
|
|
'Sarah',
|
|
|
|
'Karen',
|
|
|
|
'Nancy',
|
|
|
|
'Lisa',
|
|
|
|
'Margaret',
|
|
|
|
'Betty',
|
|
|
|
'Sandra',
|
|
|
|
'Ashley',
|
|
|
|
'Dorothy',
|
|
|
|
'Kimberly',
|
|
|
|
'Emily',
|
|
|
|
'Donna',
|
|
|
|
'Michelle',
|
|
|
|
'Carol',
|
|
|
|
'Amanda',
|
|
|
|
'Melissa',
|
|
|
|
'Deborah',
|
|
|
|
'Stephanie',
|
|
|
|
'Rebecca',
|
|
|
|
'Laura',
|
|
|
|
'Sharon',
|
|
|
|
'Cynthia',
|
|
|
|
'Kathleen',
|
|
|
|
'Amy',
|
|
|
|
'Shirley',
|
|
|
|
'Angela',
|
|
|
|
'Helen',
|
|
|
|
'Anna',
|
|
|
|
'Brenda',
|
|
|
|
'Pamela',
|
|
|
|
'Nicole',
|
|
|
|
'Samantha',
|
|
|
|
'Katherine',
|
|
|
|
'Emma',
|
|
|
|
'Ruth',
|
|
|
|
'Christine',
|
|
|
|
'Catherine',
|
|
|
|
'Debra',
|
|
|
|
'Rachel',
|
|
|
|
'Carolyn',
|
|
|
|
'Janet',
|
|
|
|
'Virginia',
|
|
|
|
'Maria',
|
|
|
|
'Heather',
|
|
|
|
'Diane',
|
|
|
|
'Julie',
|
|
|
|
'Joyce',
|
|
|
|
'Victoria',
|
|
|
|
'Kelly',
|
|
|
|
'Christina',
|
|
|
|
'Lauren',
|
|
|
|
'Joan',
|
|
|
|
'Evelyn',
|
|
|
|
'Olivia',
|
|
|
|
'Judith',
|
|
|
|
'Megan',
|
|
|
|
'Cheryl',
|
|
|
|
'Martha',
|
|
|
|
'Andrea',
|
|
|
|
'Frances',
|
|
|
|
'Hannah',
|
|
|
|
'Jacqueline',
|
|
|
|
'Ann',
|
|
|
|
'Gloria',
|
|
|
|
'Jean',
|
|
|
|
'Kathryn',
|
|
|
|
'Alice',
|
|
|
|
'Teresa',
|
|
|
|
'Sara',
|
|
|
|
'Janice',
|
|
|
|
'Doris',
|
|
|
|
'Madison',
|
|
|
|
'Julia',
|
|
|
|
'Grace',
|
|
|
|
'Judy',
|
|
|
|
'Abigail',
|
|
|
|
'Marie',
|
|
|
|
'Denise',
|
|
|
|
'Beverly',
|
|
|
|
'Amber',
|
|
|
|
'Theresa',
|
|
|
|
'Marilyn',
|
|
|
|
'Danielle',
|
|
|
|
'Diana',
|
|
|
|
'Brittany',
|
|
|
|
'Natalie',
|
|
|
|
'Sophia',
|
|
|
|
'Rose',
|
|
|
|
'Isabella',
|
|
|
|
'Alexis',
|
|
|
|
'Kayla',
|
|
|
|
'Charlotte',
|
|
|
|
];
|
|
|
|
|
|
|
|
const LAST_NAMES = [
|
|
|
|
'Smith',
|
|
|
|
'Johnson',
|
|
|
|
'Williams',
|
|
|
|
'Brown',
|
|
|
|
'Jones',
|
|
|
|
'Garcia',
|
|
|
|
'Miller',
|
|
|
|
'Davis',
|
|
|
|
'Rodriguez',
|
|
|
|
'Martinez',
|
|
|
|
'Hernandez',
|
|
|
|
'Lopez',
|
|
|
|
'Gonzales',
|
|
|
|
'Wilson',
|
|
|
|
'Anderson',
|
|
|
|
'Thomas',
|
|
|
|
'Taylor',
|
|
|
|
'Moore',
|
|
|
|
'Jackson',
|
|
|
|
'Martin',
|
|
|
|
'Lee',
|
|
|
|
'Perez',
|
|
|
|
'Thompson',
|
|
|
|
'White',
|
|
|
|
'Harris',
|
|
|
|
'Sanchez',
|
|
|
|
'Clark',
|
|
|
|
'Ramirez',
|
|
|
|
'Lewis',
|
|
|
|
'Robinson',
|
|
|
|
'Walker',
|
|
|
|
'Young',
|
|
|
|
'Allen',
|
|
|
|
'King',
|
|
|
|
'Wright',
|
|
|
|
'Scott',
|
|
|
|
'Torres',
|
|
|
|
'Nguyen',
|
|
|
|
'Hill',
|
|
|
|
'Flores',
|
|
|
|
'Green',
|
|
|
|
'Adams',
|
|
|
|
'Nelson',
|
|
|
|
'Baker',
|
|
|
|
'Hall',
|
|
|
|
'Rivera',
|
|
|
|
'Campbell',
|
|
|
|
'Mitchell',
|
|
|
|
'Carter',
|
|
|
|
'Roberts',
|
|
|
|
'Gomez',
|
|
|
|
'Phillips',
|
|
|
|
'Evans',
|
|
|
|
'Turner',
|
|
|
|
'Diaz',
|
|
|
|
'Parker',
|
|
|
|
'Cruz',
|
|
|
|
'Edwards',
|
|
|
|
'Collins',
|
|
|
|
'Reyes',
|
|
|
|
'Stewart',
|
|
|
|
'Morris',
|
|
|
|
'Morales',
|
|
|
|
'Murphy',
|
|
|
|
'Cook',
|
|
|
|
'Rogers',
|
|
|
|
'Gutierrez',
|
|
|
|
'Ortiz',
|
|
|
|
'Morgan',
|
|
|
|
'Cooper',
|
|
|
|
'Peterson',
|
|
|
|
'Bailey',
|
|
|
|
'Reed',
|
|
|
|
'Kelly',
|
|
|
|
'Howard',
|
|
|
|
'Ramos',
|
|
|
|
'Kim',
|
|
|
|
'Cox',
|
|
|
|
'Ward',
|
|
|
|
'Richardson',
|
|
|
|
'Watson',
|
|
|
|
'Brooks',
|
|
|
|
'Chavez',
|
|
|
|
'Wood',
|
|
|
|
'James',
|
|
|
|
'Bennet',
|
|
|
|
'Gray',
|
|
|
|
'Mendoza',
|
|
|
|
'Ruiz',
|
|
|
|
'Hughes',
|
|
|
|
'Price',
|
|
|
|
'Alvarez',
|
|
|
|
'Castillo',
|
|
|
|
'Sanders',
|
|
|
|
'Patel',
|
|
|
|
'Myers',
|
|
|
|
'Long',
|
|
|
|
'Ross',
|
|
|
|
'Foster',
|
|
|
|
'Jimenez',
|
|
|
|
];
|
|
|
|
|
2021-03-11 21:29:31 +00:00
|
|
|
const getFirstName = (): string => sample(FIRST_NAMES) || 'Test';
|
|
|
|
const getLastName = (): string => sample(LAST_NAMES) || 'Test';
|
2021-01-29 21:19:24 +00:00
|
|
|
|
2020-12-08 19:37:04 +00:00
|
|
|
export function getDefaultConversation(
|
2021-03-11 21:29:31 +00:00
|
|
|
overrideProps: Partial<ConversationType> = {}
|
2020-12-08 19:37:04 +00:00
|
|
|
): ConversationType {
|
2021-03-11 21:29:31 +00:00
|
|
|
const firstName = getFirstName();
|
|
|
|
const lastName = getLastName();
|
|
|
|
|
2020-12-08 19:37:04 +00:00
|
|
|
return {
|
2021-01-29 21:19:24 +00:00
|
|
|
id: generateUuid(),
|
2021-03-11 21:29:31 +00:00
|
|
|
isGroupV2Capable: true,
|
2020-12-08 19:37:04 +00:00
|
|
|
lastUpdated: Date.now(),
|
|
|
|
markedUnread: Boolean(overrideProps.markedUnread),
|
|
|
|
e164: '+1300555000',
|
2021-03-11 21:29:31 +00:00
|
|
|
firstName,
|
|
|
|
title: `${firstName} ${lastName}`,
|
2020-12-08 19:37:04 +00:00
|
|
|
type: 'direct' as const,
|
|
|
|
uuid: generateUuid(),
|
|
|
|
...overrideProps,
|
|
|
|
};
|
|
|
|
}
|