Migrate schema to service ids
This commit is contained in:
parent
71958f8a01
commit
8b0da36caa
258 changed files with 4795 additions and 2613 deletions
|
@ -26,7 +26,7 @@ import { SizeObserver } from '../hooks/useSizeObserver';
|
|||
type OwnProps = {
|
||||
i18n: LocalizerType;
|
||||
theme: ThemeType;
|
||||
contact: Pick<ConversationType, 'id' | 'title' | 'uuid'>;
|
||||
contact: Pick<ConversationType, 'id' | 'title' | 'serviceId' | 'pni'>;
|
||||
candidateConversations: ReadonlyArray<ConversationType>;
|
||||
regionCode: string | undefined;
|
||||
};
|
||||
|
@ -119,11 +119,12 @@ export function AddUserToAnotherGroupModal({
|
|||
|
||||
let disabledReason;
|
||||
|
||||
if (memberships.some(c => c.uuid === contact.uuid)) {
|
||||
if (memberships.some(c => c.aci === contact.serviceId)) {
|
||||
disabledReason = DisabledReason.AlreadyMember;
|
||||
} else if (
|
||||
pendingApprovalMemberships.some(c => c.uuid === contact.uuid) ||
|
||||
pendingMemberships.some(c => c.uuid === contact.uuid)
|
||||
pendingApprovalMemberships.some(c => c.aci === contact.serviceId) ||
|
||||
pendingMemberships.some(c => c.serviceId === contact.serviceId) ||
|
||||
pendingMemberships.some(c => c.serviceId === contact.pni)
|
||||
) {
|
||||
disabledReason = DisabledReason.Pending;
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ const createProps = (storyProps: Partial<PropsType> = {}): PropsType => ({
|
|||
),
|
||||
title: text('Caller Title', 'Morty Smith'),
|
||||
}),
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
},
|
||||
notifyForCall: action('notify-for-call'),
|
||||
openSystemPreferencesAction: action('open-system-preferences-action'),
|
||||
|
|
|
@ -274,7 +274,7 @@ function ActiveCallManager({
|
|||
<CallingParticipantsList
|
||||
i18n={i18n}
|
||||
onClose={toggleParticipants}
|
||||
ourUuid={me.uuid}
|
||||
ourServiceId={me.serviceId}
|
||||
participants={peekedParticipants}
|
||||
/>
|
||||
) : null}
|
||||
|
@ -359,7 +359,7 @@ function ActiveCallManager({
|
|||
<CallingParticipantsList
|
||||
i18n={i18n}
|
||||
onClose={toggleParticipants}
|
||||
ourUuid={me.uuid}
|
||||
ourServiceId={me.serviceId}
|
||||
participants={groupCallParticipantsForParticipantsList}
|
||||
/>
|
||||
) : null}
|
||||
|
|
|
@ -23,7 +23,7 @@ import { setupI18n } from '../util/setupI18n';
|
|||
import { missingCaseError } from '../util/missingCaseError';
|
||||
import {
|
||||
getDefaultConversation,
|
||||
getDefaultConversationWithUuid,
|
||||
getDefaultConversationWithServiceId,
|
||||
} from '../test-both/helpers/getDefaultConversation';
|
||||
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
|
||||
import enMessages from '../../_locales/en/messages.json';
|
||||
|
@ -175,7 +175,7 @@ const createProps = (
|
|||
name: 'Morty Smith',
|
||||
profileName: 'Morty Smith',
|
||||
title: 'Morty Smith',
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
}),
|
||||
openSystemPreferencesAction: action('open-system-preferences-action'),
|
||||
setGroupCallVideoRequest: action('set-group-call-video-request'),
|
||||
|
@ -312,7 +312,7 @@ export function GroupCall1(): JSX.Element {
|
|||
videoAspectRatio: 1.3,
|
||||
...getDefaultConversation({
|
||||
isBlocked: false,
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
title: 'Tyler',
|
||||
}),
|
||||
},
|
||||
|
@ -334,7 +334,7 @@ const allRemoteParticipants = times(MAX_PARTICIPANTS).map(index => ({
|
|||
presenting: false,
|
||||
sharingScreen: false,
|
||||
videoAspectRatio: 1.3,
|
||||
...getDefaultConversationWithUuid({
|
||||
...getDefaultConversationWithServiceId({
|
||||
isBlocked: index === 10 || index === MAX_PARTICIPANTS - 1,
|
||||
title: `Participant ${index + 1}`,
|
||||
}),
|
||||
|
@ -380,7 +380,7 @@ export function GroupCallReconnecting(): JSX.Element {
|
|||
...getDefaultConversation({
|
||||
isBlocked: false,
|
||||
title: 'Tyler',
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
}),
|
||||
},
|
||||
],
|
||||
|
|
|
@ -16,7 +16,7 @@ import { generateAci } from '../types/ServiceId';
|
|||
import enMessages from '../../_locales/en/messages.json';
|
||||
import {
|
||||
getDefaultConversation,
|
||||
getDefaultConversationWithUuid,
|
||||
getDefaultConversationWithServiceId,
|
||||
} from '../test-both/helpers/getDefaultConversation';
|
||||
|
||||
const i18n = setupI18n('en', enMessages);
|
||||
|
@ -67,7 +67,7 @@ const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => {
|
|||
getDefaultConversation({
|
||||
color: AvatarColors[0],
|
||||
id: generateUuid(),
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
}),
|
||||
onCallCanceled: action('on-call-canceled'),
|
||||
onJoinCall: action('on-join-call'),
|
||||
|
@ -87,7 +87,7 @@ const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => {
|
|||
};
|
||||
|
||||
const fakePeekedParticipant = (conversationProps: Partial<ConversationType>) =>
|
||||
getDefaultConversationWithUuid({
|
||||
getDefaultConversationWithServiceId({
|
||||
...conversationProps,
|
||||
});
|
||||
|
||||
|
@ -118,7 +118,7 @@ export function NoCameraLocalAvatar(): JSX.Element {
|
|||
avatarPath: '/fixtures/kitten-4-112-112.jpg',
|
||||
color: AvatarColors[0],
|
||||
id: generateUuid(),
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
}),
|
||||
});
|
||||
return <CallingLobby {...props} />;
|
||||
|
@ -168,14 +168,14 @@ GroupCall1PeekedParticipant.story = {
|
|||
};
|
||||
|
||||
export function GroupCall1PeekedParticipantSelf(): JSX.Element {
|
||||
const uuid = generateAci();
|
||||
const serviceId = generateAci();
|
||||
const props = createProps({
|
||||
isGroupCall: true,
|
||||
me: getDefaultConversation({
|
||||
id: generateUuid(),
|
||||
uuid,
|
||||
serviceId,
|
||||
}),
|
||||
peekedParticipants: [fakePeekedParticipant({ title: 'Ash', uuid })],
|
||||
peekedParticipants: [fakePeekedParticipant({ title: 'Ash', serviceId })],
|
||||
});
|
||||
return <CallingLobby {...props} />;
|
||||
}
|
||||
|
|
|
@ -49,7 +49,9 @@ export type PropsType = {
|
|||
isGroupCall: boolean;
|
||||
isGroupCallOutboundRingEnabled: boolean;
|
||||
isCallFull?: boolean;
|
||||
me: Readonly<Pick<ConversationType, 'avatarPath' | 'color' | 'id' | 'uuid'>>;
|
||||
me: Readonly<
|
||||
Pick<ConversationType, 'avatarPath' | 'color' | 'id' | 'serviceId'>
|
||||
>;
|
||||
onCallCanceled: () => void;
|
||||
onJoinCall: () => void;
|
||||
outgoingRing: boolean;
|
||||
|
|
|
@ -9,7 +9,8 @@ import type { PropsType } from './CallingParticipantsList';
|
|||
import { CallingParticipantsList } from './CallingParticipantsList';
|
||||
import { AvatarColors } from '../types/Colors';
|
||||
import type { GroupCallRemoteParticipantType } from '../types/Calling';
|
||||
import { getDefaultConversationWithUuid } from '../test-both/helpers/getDefaultConversation';
|
||||
import { generateAci } from '../types/ServiceId';
|
||||
import { getDefaultConversationWithServiceId } from '../test-both/helpers/getDefaultConversation';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
import enMessages from '../../_locales/en/messages.json';
|
||||
|
||||
|
@ -25,7 +26,7 @@ function createParticipant(
|
|||
presenting: Boolean(participantProps.presenting),
|
||||
sharingScreen: Boolean(participantProps.sharingScreen),
|
||||
videoAspectRatio: 1.3,
|
||||
...getDefaultConversationWithUuid({
|
||||
...getDefaultConversationWithServiceId({
|
||||
avatarPath: participantProps.avatarPath,
|
||||
color: sample(AvatarColors),
|
||||
isBlocked: Boolean(participantProps.isBlocked),
|
||||
|
@ -39,7 +40,7 @@ function createParticipant(
|
|||
const createProps = (overrideProps: Partial<PropsType> = {}): PropsType => ({
|
||||
i18n,
|
||||
onClose: action('on-close'),
|
||||
ourUuid: 'cf085e6a-e70b-41ec-a310-c198248af13f',
|
||||
ourServiceId: generateAci(),
|
||||
participants: overrideProps.participants || [],
|
||||
});
|
||||
|
||||
|
|
|
@ -11,6 +11,7 @@ import { Avatar, AvatarSize } from './Avatar';
|
|||
import { ContactName } from './conversation/ContactName';
|
||||
import { InContactsIcon } from './InContactsIcon';
|
||||
import type { LocalizerType } from '../types/Util';
|
||||
import type { ServiceIdString } from '../types/ServiceId';
|
||||
import { sortByTitle } from '../util/sortByTitle';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import { isInSystemContacts } from '../util/isInSystemContacts';
|
||||
|
@ -25,7 +26,7 @@ type ParticipantType = ConversationType & {
|
|||
export type PropsType = {
|
||||
readonly i18n: LocalizerType;
|
||||
readonly onClose: () => void;
|
||||
readonly ourUuid: string | undefined;
|
||||
readonly ourServiceId: ServiceIdString | undefined;
|
||||
readonly participants: Array<ParticipantType>;
|
||||
};
|
||||
|
||||
|
@ -33,7 +34,7 @@ export const CallingParticipantsList = React.memo(
|
|||
function CallingParticipantsListInner({
|
||||
i18n,
|
||||
onClose,
|
||||
ourUuid,
|
||||
ourServiceId,
|
||||
participants,
|
||||
}: PropsType) {
|
||||
const [root, setRoot] = React.useState<HTMLElement | null>(null);
|
||||
|
@ -101,9 +102,9 @@ export const CallingParticipantsList = React.memo(
|
|||
(participant: ParticipantType, index: number) => (
|
||||
<li
|
||||
className="module-calling-participants-list__contact"
|
||||
// It's tempting to use `participant.uuid` as the `key` here, but that
|
||||
// can result in duplicate keys for participants who have joined on
|
||||
// multiple devices.
|
||||
// It's tempting to use `participant.serviceId` as the `key`
|
||||
// here, but that can result in duplicate keys for
|
||||
// participants who have joined on multiple devices.
|
||||
key={index}
|
||||
>
|
||||
<div>
|
||||
|
@ -122,7 +123,8 @@ export const CallingParticipantsList = React.memo(
|
|||
sharedGroupNames={participant.sharedGroupNames}
|
||||
size={AvatarSize.THIRTY_TWO}
|
||||
/>
|
||||
{ourUuid && participant.uuid === ourUuid ? (
|
||||
{ourServiceId &&
|
||||
participant.serviceId === ourServiceId ? (
|
||||
<span className="module-calling-participants-list__name">
|
||||
{i18n('icu:you')}
|
||||
</span>
|
||||
|
|
|
@ -30,14 +30,14 @@ type PropsType = {
|
|||
| 'unblurredAvatarPath'
|
||||
>;
|
||||
i18n: LocalizerType;
|
||||
me: Pick<ConversationType, 'id' | 'uuid'>;
|
||||
me: Pick<ConversationType, 'id' | 'serviceId'>;
|
||||
ringMode: RingMode;
|
||||
|
||||
// The following should only be set for group conversations.
|
||||
groupMembers?: Array<Pick<ConversationType, 'id' | 'firstName' | 'title'>>;
|
||||
isCallFull?: boolean;
|
||||
peekedParticipants?: Array<
|
||||
Pick<ConversationType, 'firstName' | 'title' | 'uuid'>
|
||||
Pick<ConversationType, 'firstName' | 'title' | 'serviceId'>
|
||||
>;
|
||||
};
|
||||
|
||||
|
@ -61,7 +61,7 @@ export function CallingPreCallInfo({
|
|||
// device.
|
||||
let hasYou = false;
|
||||
const participantNames = peekedParticipants.map(participant => {
|
||||
if (participant.uuid === me.uuid) {
|
||||
if (participant.serviceId === me.serviceId) {
|
||||
hasYou = true;
|
||||
return i18n('icu:you');
|
||||
}
|
||||
|
|
|
@ -36,6 +36,7 @@ import type {
|
|||
InMemoryAttachmentDraftType,
|
||||
} from '../types/Attachment';
|
||||
import { isImageAttachment, isVoiceMessage } from '../types/Attachment';
|
||||
import type { AciString } from '../types/ServiceId';
|
||||
import { AudioCapture } from './conversation/AudioCapture';
|
||||
import { CompositionUpload } from './CompositionUpload';
|
||||
import type {
|
||||
|
@ -87,7 +88,6 @@ export type OwnProps = Readonly<{
|
|||
conversationId: string;
|
||||
discardEditMessage: (id: string) => unknown;
|
||||
draftEditMessage?: DraftEditMessageType;
|
||||
uuid?: string;
|
||||
draftAttachments: ReadonlyArray<AttachmentDraftType>;
|
||||
errorDialogAudioRecorderType?: ErrorDialogAudioRecorderType;
|
||||
errorRecording: (e: ErrorDialogAudioRecorderType) => unknown;
|
||||
|
@ -131,7 +131,7 @@ export type OwnProps = Readonly<{
|
|||
options: {
|
||||
bodyRanges?: DraftBodyRanges;
|
||||
message?: string;
|
||||
quoteAuthorUuid?: string;
|
||||
quoteAuthorAci?: AciString;
|
||||
quoteSentAt?: number;
|
||||
targetMessageId: string;
|
||||
}
|
||||
|
@ -153,7 +153,7 @@ export type OwnProps = Readonly<{
|
|||
'i18n' | 'onClick' | 'onClose' | 'withContentAbove' | 'isCompose'
|
||||
>
|
||||
>;
|
||||
quotedMessageAuthorUuid?: string;
|
||||
quotedMessageAuthorAci?: AciString;
|
||||
quotedMessageSentAt?: number;
|
||||
|
||||
removeAttachment: (conversationId: string, filePath: string) => unknown;
|
||||
|
@ -256,7 +256,7 @@ export function CompositionArea({
|
|||
// Quote
|
||||
quotedMessageId,
|
||||
quotedMessageProps,
|
||||
quotedMessageAuthorUuid,
|
||||
quotedMessageAuthorAci,
|
||||
quotedMessageSentAt,
|
||||
scrollToMessage,
|
||||
// MediaQualitySelector
|
||||
|
@ -356,7 +356,7 @@ export function CompositionArea({
|
|||
message,
|
||||
// sent timestamp for the quote
|
||||
quoteSentAt: quotedMessageSentAt,
|
||||
quoteAuthorUuid: quotedMessageAuthorUuid,
|
||||
quoteAuthorAci: quotedMessageAuthorAci,
|
||||
targetMessageId: editedMessageId,
|
||||
});
|
||||
} else {
|
||||
|
@ -374,7 +374,7 @@ export function CompositionArea({
|
|||
draftAttachments,
|
||||
editedMessageId,
|
||||
quotedMessageSentAt,
|
||||
quotedMessageAuthorUuid,
|
||||
quotedMessageAuthorAci,
|
||||
sendEditedMessage,
|
||||
sendMultiMediaMessage,
|
||||
setLarge,
|
||||
|
|
|
@ -138,7 +138,7 @@ export function Mentions(): JSX.Element {
|
|||
{
|
||||
start: 5,
|
||||
length: 1,
|
||||
mentionUuid: generateAci(),
|
||||
mentionAci: generateAci(),
|
||||
conversationID: 'k',
|
||||
replacementText: 'Kate Beaton',
|
||||
},
|
||||
|
|
|
@ -26,7 +26,7 @@ import { BodyRange, collapseRangeTree, insertRange } from '../types/BodyRange';
|
|||
import type { LocalizerType, ThemeType } from '../types/Util';
|
||||
import type { ConversationType } from '../state/ducks/conversations';
|
||||
import type { PreferredBadgeSelectorType } from '../state/selectors/badges';
|
||||
import { isServiceIdString } from '../types/ServiceId';
|
||||
import { isAciString } from '../types/ServiceId';
|
||||
import { MentionBlot } from '../quill/mentions/blot';
|
||||
import {
|
||||
matchEmojiImage,
|
||||
|
@ -678,15 +678,12 @@ export function CompositionInput(props: Props): React.ReactElement {
|
|||
return;
|
||||
}
|
||||
|
||||
const currentMemberServiceIds = currentMembers
|
||||
.map(m => m.uuid)
|
||||
const currentMemberAcis = currentMembers
|
||||
.map(m => m.serviceId)
|
||||
.filter(isNotNil)
|
||||
.filter(isServiceIdString);
|
||||
.filter(isAciString);
|
||||
|
||||
const newDelta = getDeltaToRemoveStaleMentions(
|
||||
ops,
|
||||
currentMemberServiceIds
|
||||
);
|
||||
const newDelta = getDeltaToRemoveStaleMentions(ops, currentMemberAcis);
|
||||
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
quill.updateContents(newDelta as any);
|
||||
|
|
|
@ -374,7 +374,7 @@ export function ConversationList({
|
|||
'unblurredAvatarPath',
|
||||
'unreadCount',
|
||||
'unreadMentionsCount',
|
||||
'uuid',
|
||||
'serviceId',
|
||||
]);
|
||||
const { badges, title, unreadCount, lastMessage } = itemProps;
|
||||
result = (
|
||||
|
|
|
@ -8,7 +8,7 @@ import { action } from '@storybook/addon-actions';
|
|||
|
||||
import { GroupCallOverflowArea } from './GroupCallOverflowArea';
|
||||
import { setupI18n } from '../util/setupI18n';
|
||||
import { getDefaultConversationWithUuid } from '../test-both/helpers/getDefaultConversation';
|
||||
import { getDefaultConversationWithServiceId } from '../test-both/helpers/getDefaultConversation';
|
||||
import { fakeGetGroupCallVideoFrameSource } from '../test-both/helpers/fakeGetGroupCallVideoFrameSource';
|
||||
import { FRAME_BUFFER_SIZE } from '../calling/constants';
|
||||
import enMessages from '../../_locales/en/messages.json';
|
||||
|
@ -24,7 +24,7 @@ const allRemoteParticipants = times(MAX_PARTICIPANTS).map(index => ({
|
|||
presenting: false,
|
||||
sharingScreen: false,
|
||||
videoAspectRatio: 1.3,
|
||||
...getDefaultConversationWithUuid({
|
||||
...getDefaultConversationWithServiceId({
|
||||
isBlocked: index === 10 || index === MAX_PARTICIPANTS - 1,
|
||||
title: `Participant ${index + 1}`,
|
||||
}),
|
||||
|
|
|
@ -61,7 +61,7 @@ const createProps = (
|
|||
isBlocked: Boolean(isBlocked),
|
||||
title:
|
||||
'Pablo Diego José Francisco de Paula Juan Nepomuceno María de los Remedios Cipriano de la Santísima Trinidad Ruiz y Picasso',
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
}),
|
||||
},
|
||||
remoteParticipantsCount: 1,
|
||||
|
|
|
@ -310,7 +310,9 @@ function ContactSection({
|
|||
}
|
||||
|
||||
const { distributionId } = section.story;
|
||||
const uuids = section.contacts.map(contact => contact.uuid).filter(isNotNil);
|
||||
const serviceIds = section.contacts
|
||||
.map(contact => contact.serviceId)
|
||||
.filter(isNotNil);
|
||||
const sectionName =
|
||||
distributionId === MY_STORY_ID
|
||||
? i18n('icu:Stories__mine')
|
||||
|
@ -322,17 +324,17 @@ function ContactSection({
|
|||
<div className="module-SafetyNumberChangeDialog__row__story-name">
|
||||
{sectionName}
|
||||
</div>
|
||||
{distributionId && removeFromStory && uuids.length > 1 && (
|
||||
{distributionId && removeFromStory && serviceIds.length > 1 && (
|
||||
<SectionButtonWithMenu
|
||||
ariaLabel={i18n('icu:safetyNumberChangeDialog__actions-story', {
|
||||
story: sectionName,
|
||||
})}
|
||||
i18n={i18n}
|
||||
memberCount={uuids.length}
|
||||
memberCount={serviceIds.length}
|
||||
storyName={sectionName}
|
||||
theme={theme}
|
||||
removeFromStory={() => {
|
||||
removeFromStory(distributionId, uuids);
|
||||
removeFromStory(distributionId, serviceIds);
|
||||
}}
|
||||
/>
|
||||
)}
|
||||
|
@ -443,7 +445,7 @@ function ContactRow({
|
|||
shouldShowNumber: boolean;
|
||||
theme: ThemeType;
|
||||
}>) {
|
||||
const { uuid } = contact;
|
||||
const { serviceId } = contact;
|
||||
|
||||
return (
|
||||
<li className="module-SafetyNumberChangeDialog__row" key={contact.id}>
|
||||
|
@ -493,14 +495,14 @@ function ContactRow({
|
|||
</div>
|
||||
) : null}
|
||||
</div>
|
||||
{distributionId && removeFromStory && uuid ? (
|
||||
{distributionId && removeFromStory && serviceId ? (
|
||||
<RowButtonWithMenu
|
||||
ariaLabel={i18n('icu:safetyNumberChangeDialog__actions-contact', {
|
||||
contact: contact.title,
|
||||
})}
|
||||
i18n={i18n}
|
||||
theme={theme}
|
||||
removeFromStory={() => removeFromStory(distributionId, [uuid])}
|
||||
removeFromStory={() => removeFromStory(distributionId, [serviceId])}
|
||||
verifyContact={() => setSelectedContact(contact)}
|
||||
/>
|
||||
) : (
|
||||
|
|
|
@ -59,7 +59,7 @@ export type PropsType = {
|
|||
onDeleteList: (listId: StoryDistributionIdString) => unknown;
|
||||
onDistributionListCreated: (
|
||||
name: string,
|
||||
viewerUuids: Array<ServiceIdString>
|
||||
viewerServiceIds: Array<ServiceIdString>
|
||||
) => Promise<StoryDistributionIdString>;
|
||||
onSelectedStoryList: (options: {
|
||||
conversationId: string;
|
||||
|
@ -107,15 +107,15 @@ function getListMemberServiceIds(
|
|||
signalConnections: Array<ConversationType>
|
||||
): Array<ServiceIdString> {
|
||||
const memberServiceIds = list.members
|
||||
.map(({ uuid }) => uuid)
|
||||
.map(({ serviceId }) => serviceId)
|
||||
.filter(isNotNil);
|
||||
|
||||
if (list.id === MY_STORY_ID && list.isBlockList) {
|
||||
const excludeUuids = new Set<string>(memberServiceIds);
|
||||
const excludeServiceIds = new Set<ServiceIdString>(memberServiceIds);
|
||||
return signalConnections
|
||||
.map(conversation => conversation.uuid)
|
||||
.map(conversation => conversation.serviceId)
|
||||
.filter(isNotNil)
|
||||
.filter(uuid => !excludeUuids.has(uuid));
|
||||
.filter(serviceId => !excludeServiceIds.has(serviceId));
|
||||
}
|
||||
|
||||
return memberServiceIds;
|
||||
|
@ -242,7 +242,7 @@ export function SendStoryModal({
|
|||
return distributionLists.find(list => list.id === listIdToEdit);
|
||||
}, [distributionLists, listIdToEdit]);
|
||||
|
||||
// myStoriesPrivacy, myStoriesPrivacyUuids, and myStories are only used
|
||||
// myStoriesPrivacy, myStoriesPrivacyServiceIds, and myStories are only used
|
||||
// during the first time posting to My Stories experience where we have
|
||||
// to select the privacy settings.
|
||||
const ogMyStories = useMemo(
|
||||
|
@ -310,18 +310,18 @@ export function SendStoryModal({
|
|||
</Button>
|
||||
<Button
|
||||
onClick={() => {
|
||||
const uuids = stagedMyStories.members
|
||||
.map(convo => convo.uuid)
|
||||
const serviceIds = stagedMyStories.members
|
||||
.map(convo => convo.serviceId)
|
||||
.filter(isNotNil);
|
||||
|
||||
if (stagedMyStories.isBlockList) {
|
||||
if (stagedMyStories.members.length) {
|
||||
onHideMyStoriesFrom(uuids);
|
||||
onHideMyStoriesFrom(serviceIds);
|
||||
} else {
|
||||
setMyStoriesToAllSignalConnections();
|
||||
}
|
||||
} else {
|
||||
onViewersUpdated(MY_STORY_ID, uuids);
|
||||
onViewersUpdated(MY_STORY_ID, serviceIds);
|
||||
}
|
||||
|
||||
setSelectedContacts([]);
|
||||
|
@ -425,10 +425,10 @@ export function SendStoryModal({
|
|||
candidateConversations={candidateConversations}
|
||||
getPreferredBadge={getPreferredBadge}
|
||||
i18n={i18n}
|
||||
onCreateList={async (name, uuids) => {
|
||||
onCreateList={async (name, serviceIds) => {
|
||||
const newDistributionListId = await onDistributionListCreated(
|
||||
name,
|
||||
uuids
|
||||
serviceIds
|
||||
);
|
||||
|
||||
setSelectedContacts([]);
|
||||
|
@ -438,19 +438,19 @@ export function SendStoryModal({
|
|||
|
||||
setPage(Page.SendStory);
|
||||
}}
|
||||
onViewersUpdated={uuids => {
|
||||
onViewersUpdated={serviceIds => {
|
||||
if (listIdToEdit && page === Page.AddViewer) {
|
||||
onViewersUpdated(listIdToEdit, uuids);
|
||||
onViewersUpdated(listIdToEdit, serviceIds);
|
||||
setPage(Page.EditingDistributionList);
|
||||
} else if (page === Page.ChooseViewers) {
|
||||
setPage(Page.NameStory);
|
||||
} else if (listIdToEdit && page === Page.HideStoryFrom) {
|
||||
onHideMyStoriesFrom(uuids);
|
||||
onHideMyStoriesFrom(serviceIds);
|
||||
setPage(Page.SendStory);
|
||||
} else if (page === Page.HideStoryFrom || page === Page.AddViewer) {
|
||||
const uuidsSet = new Set(uuids);
|
||||
const serviceIdSet = new Set(serviceIds);
|
||||
const members = candidateConversations.filter(convo =>
|
||||
convo.uuid ? uuidsSet.has(convo.uuid) : false
|
||||
convo.serviceId ? serviceIdSet.has(convo.serviceId) : false
|
||||
);
|
||||
setStagedMyStories(myStories => ({
|
||||
...myStories,
|
||||
|
@ -800,7 +800,7 @@ export function SendStoryModal({
|
|||
onSelectedStoryList({
|
||||
conversationId: group.id,
|
||||
distributionId: undefined,
|
||||
serviceIds: group.memberships.map(({ uuid }) => uuid),
|
||||
serviceIds: group.memberships.map(({ aci }) => aci),
|
||||
});
|
||||
}
|
||||
}}
|
||||
|
|
|
@ -54,7 +54,7 @@ export default {
|
|||
setMyStoriesToAllSignalConnections: { action: true },
|
||||
toggleSignalConnectionsModal: { action: true },
|
||||
setStoriesDisabled: { action: true },
|
||||
getConversationByUuid: {
|
||||
getConversationByServiceId: {
|
||||
defaultValue: () => getDefaultGroup(),
|
||||
},
|
||||
},
|
||||
|
|
|
@ -52,25 +52,28 @@ export type PropsType = {
|
|||
toggleGroupsForStorySend: (groupIds: Array<string>) => unknown;
|
||||
onDistributionListCreated: (
|
||||
name: string,
|
||||
viewerUuids: Array<ServiceIdString>
|
||||
viewerServiceIds: Array<ServiceIdString>
|
||||
) => Promise<string>;
|
||||
onHideMyStoriesFrom: (viewerUuids: Array<ServiceIdString>) => unknown;
|
||||
onRemoveMembers: (listId: string, uuids: Array<ServiceIdString>) => unknown;
|
||||
onHideMyStoriesFrom: (viewerServiceIds: Array<ServiceIdString>) => unknown;
|
||||
onRemoveMembers: (
|
||||
listId: string,
|
||||
serviceIds: Array<ServiceIdString>
|
||||
) => unknown;
|
||||
onRepliesNReactionsChanged: (
|
||||
listId: string,
|
||||
allowsReplies: boolean
|
||||
) => unknown;
|
||||
onViewersUpdated: (
|
||||
listId: string,
|
||||
viewerUuids: Array<ServiceIdString>
|
||||
viewerServiceIds: Array<ServiceIdString>
|
||||
) => unknown;
|
||||
setMyStoriesToAllSignalConnections: () => unknown;
|
||||
storyViewReceiptsEnabled: boolean;
|
||||
theme: ThemeType;
|
||||
toggleSignalConnectionsModal: () => unknown;
|
||||
setStoriesDisabled: (value: boolean) => void;
|
||||
getConversationByUuid: (
|
||||
uuid: ServiceIdString
|
||||
getConversationByServiceId: (
|
||||
serviceId: ServiceIdString
|
||||
) => ConversationType | undefined;
|
||||
};
|
||||
|
||||
|
@ -90,7 +93,7 @@ function filterConversations(
|
|||
conversations,
|
||||
searchTerm,
|
||||
undefined
|
||||
).filter(conversation => conversation.uuid);
|
||||
).filter(conversation => conversation.serviceId);
|
||||
}
|
||||
|
||||
const modalCommonProps: Pick<ModalPropsType, 'hasXButton' | 'moduleClassName'> =
|
||||
|
@ -258,7 +261,7 @@ export function StoriesSettingsModal({
|
|||
toggleSignalConnectionsModal,
|
||||
theme,
|
||||
setStoriesDisabled,
|
||||
getConversationByUuid,
|
||||
getConversationByServiceId,
|
||||
}: PropsType): JSX.Element {
|
||||
const [confirmDiscardModal, confirmDiscardIf] = useConfirmDiscard(i18n);
|
||||
|
||||
|
@ -311,8 +314,8 @@ export function StoriesSettingsModal({
|
|||
i18n={i18n}
|
||||
page={page}
|
||||
onClose={onClose}
|
||||
onCreateList={(name, uuids) => {
|
||||
void onDistributionListCreated(name, uuids);
|
||||
onCreateList={(name, serviceIds) => {
|
||||
void onDistributionListCreated(name, serviceIds);
|
||||
resetChooseViewersScreen();
|
||||
}}
|
||||
onBackButtonClick={() =>
|
||||
|
@ -330,9 +333,9 @@ export function StoriesSettingsModal({
|
|||
}
|
||||
})
|
||||
}
|
||||
onViewersUpdated={uuids => {
|
||||
onViewersUpdated={serviceIds => {
|
||||
if (listToEditId && page === Page.AddViewer) {
|
||||
onViewersUpdated(listToEditId, uuids);
|
||||
onViewersUpdated(listToEditId, serviceIds);
|
||||
resetChooseViewersScreen();
|
||||
}
|
||||
|
||||
|
@ -341,7 +344,7 @@ export function StoriesSettingsModal({
|
|||
}
|
||||
|
||||
if (page === Page.HideStoryFrom) {
|
||||
onHideMyStoriesFrom(uuids);
|
||||
onHideMyStoriesFrom(serviceIds);
|
||||
resetChooseViewersScreen();
|
||||
}
|
||||
}}
|
||||
|
@ -377,7 +380,7 @@ export function StoriesSettingsModal({
|
|||
group={groupToView}
|
||||
onClose={onClose}
|
||||
onBackButtonClick={() => setGroupToViewId(null)}
|
||||
getConversationByUuid={getConversationByUuid}
|
||||
getConversationByServiceId={getConversationByServiceId}
|
||||
onRemoveGroup={group => {
|
||||
setConfirmRemoveGroup({
|
||||
id: group.id,
|
||||
|
@ -583,7 +586,7 @@ export function DistributionListSettingsModal({
|
|||
| {
|
||||
listId: string;
|
||||
title: string;
|
||||
uuid: ServiceIdString;
|
||||
serviceId: ServiceIdString;
|
||||
}
|
||||
>();
|
||||
|
||||
|
@ -695,11 +698,14 @@ export function DistributionListSettingsModal({
|
|||
})}
|
||||
className="StoriesSettingsModal__list__delete"
|
||||
onClick={() => {
|
||||
strictAssert(member.uuid, 'Story member was missing uuid');
|
||||
strictAssert(
|
||||
member.serviceId,
|
||||
'Story member was missing service id'
|
||||
);
|
||||
setConfirmRemoveMember({
|
||||
listId: listToEdit.id,
|
||||
title: member.title,
|
||||
uuid: member.uuid,
|
||||
serviceId: member.serviceId,
|
||||
});
|
||||
}}
|
||||
type="button"
|
||||
|
@ -747,7 +753,7 @@ export function DistributionListSettingsModal({
|
|||
{
|
||||
action: () =>
|
||||
onRemoveMembers(confirmRemoveMember.listId, [
|
||||
confirmRemoveMember.uuid,
|
||||
confirmRemoveMember.serviceId,
|
||||
]),
|
||||
style: 'negative',
|
||||
text: i18n('icu:StoriesSettings__remove--action'),
|
||||
|
@ -950,8 +956,11 @@ export function EditMyStoryPrivacy({
|
|||
}
|
||||
|
||||
type EditDistributionListModalPropsType = {
|
||||
onCreateList: (name: string, viewerUuids: Array<ServiceIdString>) => unknown;
|
||||
onViewersUpdated: (viewerUuids: Array<ServiceIdString>) => unknown;
|
||||
onCreateList: (
|
||||
name: string,
|
||||
viewerServiceIds: Array<ServiceIdString>
|
||||
) => unknown;
|
||||
onViewersUpdated: (viewerServiceIds: Array<ServiceIdString>) => unknown;
|
||||
page:
|
||||
| Page.AddViewer
|
||||
| Page.ChooseViewers
|
||||
|
@ -1007,7 +1016,9 @@ export function EditDistributionListModal({
|
|||
|
||||
const selectConversationServiceIds: Set<ServiceIdString> = useMemo(
|
||||
() =>
|
||||
new Set(selectedContacts.map(contact => contact.uuid).filter(isNotNil)),
|
||||
new Set(
|
||||
selectedContacts.map(contact => contact.serviceId).filter(isNotNil)
|
||||
),
|
||||
[selectedContacts]
|
||||
);
|
||||
|
||||
|
@ -1108,11 +1119,11 @@ export function EditDistributionListModal({
|
|||
const rowCount = filteredConversations.length;
|
||||
const getRow = (index: number): undefined | Row => {
|
||||
const contact = filteredConversations[index];
|
||||
if (!contact || !contact.uuid) {
|
||||
if (!contact || !contact.serviceId) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
const isSelected = selectConversationServiceIds.has(contact.uuid);
|
||||
const isSelected = selectConversationServiceIds.has(contact.serviceId);
|
||||
|
||||
return {
|
||||
type: RowType.ContactCheckbox,
|
||||
|
@ -1243,7 +1254,9 @@ type GroupStorySettingsModalProps = {
|
|||
group: ConversationType;
|
||||
onClose(): void;
|
||||
onBackButtonClick(): void;
|
||||
getConversationByUuid(uuid: ServiceIdString): ConversationType | undefined;
|
||||
getConversationByServiceId(
|
||||
serviceId: ServiceIdString
|
||||
): ConversationType | undefined;
|
||||
onRemoveGroup(group: ConversationType): void;
|
||||
};
|
||||
|
||||
|
@ -1252,10 +1265,13 @@ export function GroupStorySettingsModal({
|
|||
group,
|
||||
onClose,
|
||||
onBackButtonClick,
|
||||
getConversationByUuid,
|
||||
getConversationByServiceId,
|
||||
onRemoveGroup,
|
||||
}: GroupStorySettingsModalProps): JSX.Element {
|
||||
const groupMemberships = getGroupMemberships(group, getConversationByUuid);
|
||||
const groupMemberships = getGroupMemberships(
|
||||
group,
|
||||
getConversationByServiceId
|
||||
);
|
||||
return (
|
||||
<ModalPage
|
||||
modalName="GroupStorySettingsModal"
|
||||
|
|
|
@ -103,7 +103,7 @@ export function StoryListItem({
|
|||
|
||||
const { firstName, title } = sender;
|
||||
|
||||
const isSignalOfficial = sender.uuid === SIGNAL_ACI;
|
||||
const isSignalOfficial = sender.serviceId === SIGNAL_ACI;
|
||||
|
||||
let avatarStoryRing: HasStories | undefined;
|
||||
if (attachment) {
|
||||
|
|
|
@ -40,21 +40,21 @@ export function MultipleMentions(): JSX.Element {
|
|||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_1,
|
||||
mentionAci: SERVICE_ID_1,
|
||||
replacementText: 'Professor Farnsworth',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 2,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_2,
|
||||
mentionAci: SERVICE_ID_2,
|
||||
replacementText: 'Philip J Fry',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
replacementText: 'Yancy Fry',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -73,21 +73,21 @@ export function ComplexMentions(): JSX.Element {
|
|||
{
|
||||
start: 80,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_4,
|
||||
mentionAci: SERVICE_ID_4,
|
||||
replacementText: 'Cereal Killer',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 78,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_5,
|
||||
mentionAci: SERVICE_ID_5,
|
||||
replacementText: 'Acid Burn',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_6,
|
||||
mentionAci: SERVICE_ID_6,
|
||||
replacementText: 'Zero Cool',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -109,7 +109,7 @@ export function WithOddCharacter(): JSX.Element {
|
|||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_6,
|
||||
mentionAci: SERVICE_ID_6,
|
||||
replacementText: 'Zero Cool',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
|
|
@ -45,7 +45,7 @@ const getCommonProps = (options: {
|
|||
? GroupCallStatus.GenericGroupCall
|
||||
: DirectCallStatus.Pending,
|
||||
callCreator = getDefaultConversation({
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
isMe: direction === CallDirection.Outgoing,
|
||||
}),
|
||||
callExternalState = CallExternalState.Active,
|
||||
|
@ -63,7 +63,7 @@ const getCommonProps = (options: {
|
|||
callHistory: {
|
||||
callId: '123',
|
||||
peerId: conversation.id,
|
||||
ringerId: callCreator?.uuid ?? null,
|
||||
ringerId: callCreator?.serviceId ?? null,
|
||||
mode,
|
||||
type,
|
||||
direction,
|
||||
|
|
|
@ -44,7 +44,7 @@ const renderChange = (
|
|||
areWeAdmin = true,
|
||||
}: {
|
||||
groupMemberships?: ReadonlyArray<{
|
||||
uuid: AciString;
|
||||
aci: AciString;
|
||||
isAdmin: boolean;
|
||||
}>;
|
||||
groupBannedMemberships?: ReadonlyArray<ServiceIdString>;
|
||||
|
@ -92,7 +92,7 @@ export function Multiple(): JSX.Element {
|
|||
},
|
||||
{
|
||||
type: 'member-add',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
{
|
||||
type: 'description',
|
||||
|
@ -100,7 +100,7 @@ export function Multiple(): JSX.Element {
|
|||
},
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
newPrivilege: RoleEnum.ADMINISTRATOR,
|
||||
},
|
||||
],
|
||||
|
@ -451,7 +451,7 @@ export function MemberAdd(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -460,7 +460,7 @@ export function MemberAdd(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -468,7 +468,7 @@ export function MemberAdd(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -477,7 +477,7 @@ export function MemberAdd(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -486,7 +486,7 @@ export function MemberAdd(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -494,7 +494,7 @@ export function MemberAdd(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -511,7 +511,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -520,7 +520,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
inviter: CONTACT_A,
|
||||
},
|
||||
],
|
||||
|
@ -531,7 +531,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -541,7 +541,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: CONTACT_B,
|
||||
aci: CONTACT_B,
|
||||
inviter: CONTACT_C,
|
||||
},
|
||||
],
|
||||
|
@ -550,7 +550,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -561,7 +561,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
inviter: CONTACT_A,
|
||||
},
|
||||
],
|
||||
|
@ -571,7 +571,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -580,7 +580,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
inviter: OUR_ACI,
|
||||
},
|
||||
],
|
||||
|
@ -590,7 +590,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -600,7 +600,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -610,7 +610,7 @@ export function MemberAddFromInvited(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-invite',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -631,7 +631,7 @@ export function MemberAddFromLink(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-link',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -640,7 +640,7 @@ export function MemberAddFromLink(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-link',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -648,7 +648,7 @@ export function MemberAddFromLink(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-link',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -668,7 +668,7 @@ export function MemberAddFromAdminApproval(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-admin-approval',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -676,7 +676,7 @@ export function MemberAddFromAdminApproval(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-admin-approval',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -685,7 +685,7 @@ export function MemberAddFromAdminApproval(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-admin-approval',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -694,7 +694,7 @@ export function MemberAddFromAdminApproval(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-admin-approval',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -702,7 +702,7 @@ export function MemberAddFromAdminApproval(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-add-from-admin-approval',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -722,7 +722,7 @@ export function MemberRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-remove',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -731,7 +731,7 @@ export function MemberRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-remove',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -739,7 +739,7 @@ export function MemberRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-remove',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -748,7 +748,7 @@ export function MemberRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-remove',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -757,7 +757,7 @@ export function MemberRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-remove',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -766,7 +766,7 @@ export function MemberRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-remove',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -774,7 +774,7 @@ export function MemberRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-remove',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -790,7 +790,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
newPrivilege: RoleEnum.ADMINISTRATOR,
|
||||
},
|
||||
],
|
||||
|
@ -799,7 +799,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
newPrivilege: RoleEnum.ADMINISTRATOR,
|
||||
},
|
||||
],
|
||||
|
@ -809,7 +809,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
newPrivilege: RoleEnum.ADMINISTRATOR,
|
||||
},
|
||||
],
|
||||
|
@ -819,7 +819,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
newPrivilege: RoleEnum.ADMINISTRATOR,
|
||||
},
|
||||
],
|
||||
|
@ -828,7 +828,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
newPrivilege: RoleEnum.ADMINISTRATOR,
|
||||
},
|
||||
],
|
||||
|
@ -838,7 +838,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
newPrivilege: RoleEnum.DEFAULT,
|
||||
},
|
||||
],
|
||||
|
@ -847,7 +847,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
newPrivilege: RoleEnum.DEFAULT,
|
||||
},
|
||||
],
|
||||
|
@ -857,7 +857,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
newPrivilege: RoleEnum.DEFAULT,
|
||||
},
|
||||
],
|
||||
|
@ -867,7 +867,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
newPrivilege: RoleEnum.DEFAULT,
|
||||
},
|
||||
],
|
||||
|
@ -876,7 +876,7 @@ export function MemberPrivilege(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'member-privilege',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
newPrivilege: RoleEnum.DEFAULT,
|
||||
},
|
||||
],
|
||||
|
@ -893,7 +893,7 @@ export function PendingAddOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-add-one',
|
||||
uuid: OUR_ACI,
|
||||
serviceId: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -901,7 +901,7 @@ export function PendingAddOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-add-one',
|
||||
uuid: OUR_ACI,
|
||||
serviceId: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -910,7 +910,7 @@ export function PendingAddOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-add-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -919,7 +919,7 @@ export function PendingAddOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-add-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -927,7 +927,7 @@ export function PendingAddOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-add-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -984,7 +984,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
inviter: OUR_ACI,
|
||||
},
|
||||
],
|
||||
|
@ -994,7 +994,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
inviter: OUR_ACI,
|
||||
},
|
||||
],
|
||||
|
@ -1004,7 +1004,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
inviter: OUR_ACI,
|
||||
},
|
||||
],
|
||||
|
@ -1013,7 +1013,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
inviter: OUR_ACI,
|
||||
},
|
||||
],
|
||||
|
@ -1023,7 +1023,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1032,7 +1032,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -1043,7 +1043,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: OUR_ACI,
|
||||
serviceId: OUR_ACI,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -1053,7 +1053,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: CONTACT_B,
|
||||
serviceId: CONTACT_B,
|
||||
inviter: CONTACT_A,
|
||||
},
|
||||
],
|
||||
|
@ -1064,7 +1064,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -1074,7 +1074,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -1083,7 +1083,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
inviter: CONTACT_B,
|
||||
},
|
||||
],
|
||||
|
@ -1094,7 +1094,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1103,7 +1103,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1111,7 +1111,7 @@ export function PendingRemoveOne(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'pending-remove-one',
|
||||
uuid: INVITEE_A,
|
||||
serviceId: INVITEE_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1226,7 +1226,7 @@ export function AdminApprovalAdd(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-add-one',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1234,7 +1234,7 @@ export function AdminApprovalAdd(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-add-one',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1254,7 +1254,7 @@ export function AdminApprovalRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-remove-one',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1262,7 +1262,7 @@ export function AdminApprovalRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-remove-one',
|
||||
uuid: OUR_ACI,
|
||||
aci: OUR_ACI,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1271,7 +1271,7 @@ export function AdminApprovalRemove(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-remove-one',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
},
|
||||
],
|
||||
})}
|
||||
|
@ -1294,14 +1294,14 @@ export function AdminApprovalBounce(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-bounce',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
times: 1,
|
||||
isApprovalPending: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupMemberships: [{ uuid: CONTACT_C, isAdmin: false }],
|
||||
groupMemberships: [{ aci: CONTACT_C, isAdmin: false }],
|
||||
groupBannedMemberships: [CONTACT_B],
|
||||
}
|
||||
)}
|
||||
|
@ -1311,14 +1311,14 @@ export function AdminApprovalBounce(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-bounce',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
times: 1,
|
||||
isApprovalPending: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
groupMemberships: [{ uuid: CONTACT_C, isAdmin: false }],
|
||||
groupMemberships: [{ aci: CONTACT_C, isAdmin: false }],
|
||||
groupBannedMemberships: [CONTACT_B],
|
||||
}
|
||||
)}
|
||||
|
@ -1326,7 +1326,7 @@ export function AdminApprovalBounce(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-bounce',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
times: 1,
|
||||
isApprovalPending: false,
|
||||
},
|
||||
|
@ -1340,7 +1340,7 @@ export function AdminApprovalBounce(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-bounce',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
times: 1,
|
||||
isApprovalPending: false,
|
||||
},
|
||||
|
@ -1356,13 +1356,13 @@ export function AdminApprovalBounce(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-bounce',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
times: 1,
|
||||
isApprovalPending: false,
|
||||
},
|
||||
],
|
||||
},
|
||||
{ groupMemberships: [{ uuid: CONTACT_A, isAdmin: false }] }
|
||||
{ groupMemberships: [{ aci: CONTACT_A, isAdmin: false }] }
|
||||
)}
|
||||
Would show button, but user is already banned:
|
||||
{renderChange(
|
||||
|
@ -1371,7 +1371,7 @@ export function AdminApprovalBounce(): JSX.Element {
|
|||
details: [
|
||||
{
|
||||
type: 'admin-approval-bounce',
|
||||
uuid: CONTACT_A,
|
||||
aci: CONTACT_A,
|
||||
times: 1,
|
||||
isApprovalPending: false,
|
||||
},
|
||||
|
|
|
@ -30,7 +30,7 @@ export type PropsDataType = {
|
|||
areWeAdmin: boolean;
|
||||
conversationId: string;
|
||||
groupMemberships?: ReadonlyArray<{
|
||||
uuid: AciString;
|
||||
aci: AciString;
|
||||
isAdmin: boolean;
|
||||
}>;
|
||||
groupBannedMemberships?: ReadonlyArray<ServiceIdString>;
|
||||
|
@ -116,7 +116,7 @@ function getIcon(
|
|||
): GroupIconType {
|
||||
const changeType = detail.type;
|
||||
let possibleIcon = changeToIconMap.get(changeType);
|
||||
const isSameId = fromId === get(detail, 'uuid', null);
|
||||
const isSameId = fromId === get(detail, 'aci', null);
|
||||
if (isSameId) {
|
||||
if (changeType === 'member-remove') {
|
||||
possibleIcon = 'group-leave';
|
||||
|
@ -154,13 +154,13 @@ function GroupV2Detail({
|
|||
areWeAdmin: boolean;
|
||||
blockGroupLinkRequests: (
|
||||
conversationId: string,
|
||||
uuid: ServiceIdString
|
||||
serviceId: ServiceIdString
|
||||
) => unknown;
|
||||
conversationId: string;
|
||||
detail: GroupV2ChangeDetailType;
|
||||
isLastText: boolean;
|
||||
groupMemberships?: ReadonlyArray<{
|
||||
uuid: AciString;
|
||||
aci: AciString;
|
||||
isAdmin: boolean;
|
||||
}>;
|
||||
groupBannedMemberships?: ReadonlyArray<ServiceIdString>;
|
||||
|
@ -206,10 +206,10 @@ function GroupV2Detail({
|
|||
if (
|
||||
!isLastText ||
|
||||
detail.type !== 'admin-approval-bounce' ||
|
||||
!detail.uuid
|
||||
!detail.aci
|
||||
) {
|
||||
log.warn(
|
||||
'GroupV2Detail: ConfirmingblockGroupLinkRequests but missing uuid or wrong change type'
|
||||
'GroupV2Detail: ConfirmingblockGroupLinkRequests but missing aci or wrong change type'
|
||||
);
|
||||
modalNode = undefined;
|
||||
break;
|
||||
|
@ -221,7 +221,7 @@ function GroupV2Detail({
|
|||
title={i18n('icu:PendingRequests--block--title')}
|
||||
actions={[
|
||||
{
|
||||
action: () => blockGroupLinkRequests(conversationId, detail.uuid),
|
||||
action: () => blockGroupLinkRequests(conversationId, detail.aci),
|
||||
text: i18n('icu:PendingRequests--block--confirm'),
|
||||
style: 'affirmative',
|
||||
},
|
||||
|
@ -233,7 +233,7 @@ function GroupV2Detail({
|
|||
id="icu:PendingRequests--block--contents"
|
||||
i18n={i18n}
|
||||
components={{
|
||||
name: renderContact(detail.uuid),
|
||||
name: renderContact(detail.aci),
|
||||
}}
|
||||
/>
|
||||
</ConfirmationDialog>
|
||||
|
@ -261,11 +261,11 @@ function GroupV2Detail({
|
|||
isLastText &&
|
||||
detail.type === 'admin-approval-bounce' &&
|
||||
areWeAdmin &&
|
||||
detail.uuid &&
|
||||
detail.uuid !== ourAci &&
|
||||
(!fromId || fromId === detail.uuid) &&
|
||||
!groupMemberships?.some(item => item.uuid === detail.uuid) &&
|
||||
!groupBannedMemberships?.some(uuid => uuid === detail.uuid)
|
||||
detail.aci &&
|
||||
detail.aci !== ourAci &&
|
||||
(!fromId || fromId === detail.aci) &&
|
||||
!groupMemberships?.some(item => item.aci === detail.aci) &&
|
||||
!groupBannedMemberships?.some(serviceId => serviceId === detail.aci)
|
||||
) {
|
||||
buttonNode = (
|
||||
<Button
|
||||
|
|
|
@ -319,7 +319,7 @@ export type PropsActions = {
|
|||
messageExpanded: (id: string, displayLimit: number) => unknown;
|
||||
checkForAccount: (phoneNumber: string) => unknown;
|
||||
|
||||
startConversation: (e164: string, uuid: ServiceIdString) => void;
|
||||
startConversation: (e164: string, serviceId: ServiceIdString) => void;
|
||||
showConversation: ShowConversationType;
|
||||
openGiftBadge: (messageId: string) => void;
|
||||
pushPanelForConversation: PushPanelForConversationActionType;
|
||||
|
@ -516,7 +516,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
}
|
||||
|
||||
const { contact, checkForAccount } = this.props;
|
||||
if (contact && contact.firstNumber && !contact.uuid) {
|
||||
if (contact && contact.firstNumber && !contact.serviceId) {
|
||||
checkForAccount(contact.firstNumber);
|
||||
}
|
||||
|
||||
|
@ -1637,7 +1637,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
this.getMetadataPlacement() !== MetadataPlacement.NotRendered;
|
||||
|
||||
const otherContent =
|
||||
(contact && contact.firstNumber && contact.uuid) || withCaption;
|
||||
(contact && contact.firstNumber && contact.serviceId) || withCaption;
|
||||
const tabIndex = otherContent ? 0 : -1;
|
||||
|
||||
return (
|
||||
|
@ -1647,10 +1647,10 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
i18n={i18n}
|
||||
onClick={() => {
|
||||
const signalAccount =
|
||||
contact.firstNumber && contact.uuid
|
||||
contact.firstNumber && contact.serviceId
|
||||
? {
|
||||
phoneNumber: contact.firstNumber,
|
||||
uuid: contact.uuid,
|
||||
serviceId: contact.serviceId,
|
||||
}
|
||||
: undefined;
|
||||
|
||||
|
@ -1678,8 +1678,8 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
if (!contact) {
|
||||
return null;
|
||||
}
|
||||
const { firstNumber, uuid } = contact;
|
||||
if (!firstNumber || !uuid) {
|
||||
const { firstNumber, serviceId } = contact;
|
||||
if (!firstNumber || !serviceId) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
@ -1689,7 +1689,7 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
onClick={e => {
|
||||
e.preventDefault();
|
||||
e.stopPropagation();
|
||||
startConversation(firstNumber, uuid);
|
||||
startConversation(firstNumber, serviceId);
|
||||
}}
|
||||
className={classNames(
|
||||
'module-message__send-message-button',
|
||||
|
@ -2456,8 +2456,8 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
return;
|
||||
}
|
||||
|
||||
if (contact && contact.firstNumber && contact.uuid) {
|
||||
startConversation(contact.firstNumber, contact.uuid);
|
||||
if (contact && contact.firstNumber && contact.serviceId) {
|
||||
startConversation(contact.firstNumber, contact.serviceId);
|
||||
|
||||
event.preventDefault();
|
||||
event.stopPropagation();
|
||||
|
@ -2466,10 +2466,10 @@ export class Message extends React.PureComponent<Props, State> {
|
|||
|
||||
if (contact) {
|
||||
const signalAccount =
|
||||
contact.firstNumber && contact.uuid
|
||||
contact.firstNumber && contact.serviceId
|
||||
? {
|
||||
phoneNumber: contact.firstNumber,
|
||||
uuid: contact.uuid,
|
||||
serviceId: contact.serviceId,
|
||||
}
|
||||
: undefined;
|
||||
pushPanelForConversation({
|
||||
|
|
|
@ -128,7 +128,7 @@ export function Mention(): JSX.Element {
|
|||
{
|
||||
start: 5,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_1,
|
||||
mentionAci: SERVICE_ID_1,
|
||||
replacementText: 'Bender B Rodriguez 🤖',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -150,21 +150,21 @@ export function MultipleMentions(): JSX.Element {
|
|||
{
|
||||
start: 2,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_2,
|
||||
mentionAci: SERVICE_ID_2,
|
||||
replacementText: 'Philip J Fry',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
replacementText: 'Professor Farnsworth',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 0,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_4,
|
||||
mentionAci: SERVICE_ID_4,
|
||||
replacementText: 'Yancy Fry',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -192,21 +192,21 @@ export function ComplexMessageBody(): JSX.Element {
|
|||
{
|
||||
start: 78,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_5,
|
||||
mentionAci: SERVICE_ID_5,
|
||||
replacementText: 'Acid Burn',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 80,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_6,
|
||||
mentionAci: SERVICE_ID_6,
|
||||
replacementText: 'Cereal Killer',
|
||||
conversationID: 'x',
|
||||
},
|
||||
{
|
||||
start: 4,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_6,
|
||||
mentionAci: SERVICE_ID_6,
|
||||
replacementText: 'Zero Cool',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -324,14 +324,14 @@ export function FormattingSpoiler(): JSX.Element {
|
|||
{
|
||||
start: 54,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_7,
|
||||
mentionAci: SERVICE_ID_7,
|
||||
conversationID: 'a',
|
||||
replacementText: '🅰️ Alice',
|
||||
},
|
||||
{
|
||||
start: 60,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_8,
|
||||
mentionAci: SERVICE_ID_8,
|
||||
conversationID: 'b',
|
||||
replacementText: '🅱️ Bob',
|
||||
},
|
||||
|
@ -384,35 +384,35 @@ export function FormattingNesting(): JSX.Element {
|
|||
{
|
||||
start: 29,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_7,
|
||||
mentionAci: SERVICE_ID_7,
|
||||
conversationID: 'a',
|
||||
replacementText: '🅰️ Alice',
|
||||
},
|
||||
{
|
||||
start: 61,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_8,
|
||||
mentionAci: SERVICE_ID_8,
|
||||
conversationID: 'b',
|
||||
replacementText: '🅱️ Bob',
|
||||
},
|
||||
{
|
||||
start: 68,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_9,
|
||||
mentionAci: SERVICE_ID_9,
|
||||
conversationID: 'c',
|
||||
replacementText: 'Charlie',
|
||||
},
|
||||
{
|
||||
start: 80,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_10,
|
||||
mentionAci: SERVICE_ID_10,
|
||||
conversationID: 'd',
|
||||
replacementText: 'Dan',
|
||||
},
|
||||
{
|
||||
start: 105,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_11,
|
||||
mentionAci: SERVICE_ID_11,
|
||||
conversationID: 'e',
|
||||
replacementText: 'Eve',
|
||||
},
|
||||
|
@ -452,7 +452,7 @@ export function FormattingComplex(): JSX.Element {
|
|||
{
|
||||
start: 24,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
conversationID: 'x',
|
||||
replacementText: '🤖 Hello',
|
||||
},
|
||||
|
@ -484,7 +484,7 @@ export function FormattingComplex(): JSX.Element {
|
|||
{
|
||||
start: 491,
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
conversationID: 'x',
|
||||
replacementText: '🤖 Hello',
|
||||
},
|
||||
|
|
|
@ -92,7 +92,7 @@ export function LongTextWithMention(): JSX.Element {
|
|||
{
|
||||
start: 800,
|
||||
length: 1,
|
||||
mentionUuid: generateAci(),
|
||||
mentionAci: generateAci(),
|
||||
conversationID: 'x',
|
||||
replacementText: 'Alice',
|
||||
},
|
||||
|
|
|
@ -267,8 +267,8 @@ const actions = () => ({
|
|||
),
|
||||
blockGroupLinkRequests: action('blockGroupLinkRequests'),
|
||||
checkForAccount: action('checkForAccount'),
|
||||
clearInvitedUuidsForNewlyCreatedGroup: action(
|
||||
'clearInvitedUuidsForNewlyCreatedGroup'
|
||||
clearInvitedServiceIdsForNewlyCreatedGroup: action(
|
||||
'clearInvitedServiceIdsForNewlyCreatedGroup'
|
||||
),
|
||||
setIsNearBottom: action('setIsNearBottom'),
|
||||
loadOlderMessages: action('loadOlderMessages'),
|
||||
|
|
|
@ -148,7 +148,7 @@ export type PropsActionsType = {
|
|||
conversationId: string,
|
||||
groupNameCollisions: ReadonlyDeep<GroupNameCollisionsWithIdsByTitle>
|
||||
) => void;
|
||||
clearInvitedUuidsForNewlyCreatedGroup: () => void;
|
||||
clearInvitedServiceIdsForNewlyCreatedGroup: () => void;
|
||||
clearTargetedMessage: () => unknown;
|
||||
closeContactSpoofingReview: () => void;
|
||||
loadOlderMessages: (conversationId: string, messageId: string) => unknown;
|
||||
|
@ -743,7 +743,7 @@ export class Timeline extends React.Component<
|
|||
public override render(): JSX.Element | null {
|
||||
const {
|
||||
acknowledgeGroupMemberNameCollisions,
|
||||
clearInvitedUuidsForNewlyCreatedGroup,
|
||||
clearInvitedServiceIdsForNewlyCreatedGroup,
|
||||
closeContactSpoofingReview,
|
||||
contactSpoofingReview,
|
||||
getPreferredBadge,
|
||||
|
@ -1139,7 +1139,7 @@ export class Timeline extends React.Component<
|
|||
contacts={invitedContactsForNewlyCreatedGroup}
|
||||
getPreferredBadge={getPreferredBadge}
|
||||
i18n={i18n}
|
||||
onClose={clearInvitedUuidsForNewlyCreatedGroup}
|
||||
onClose={clearInvitedServiceIdsForNewlyCreatedGroup}
|
||||
theme={theme}
|
||||
/>
|
||||
)}
|
||||
|
|
|
@ -1676,7 +1676,7 @@ Mentions.args = {
|
|||
{
|
||||
start: 0,
|
||||
length: 1,
|
||||
mentionUuid: generateAci(),
|
||||
mentionAci: generateAci(),
|
||||
replacementText: 'Zapp Brannigan',
|
||||
conversationID: 'x',
|
||||
},
|
||||
|
@ -1944,7 +1944,7 @@ EmbeddedContactWithSendMessage.args = {
|
|||
contact: {
|
||||
...fullContact,
|
||||
firstNumber: fullContact.number[0].value,
|
||||
uuid: generateAci(),
|
||||
serviceId: generateAci(),
|
||||
},
|
||||
direction: 'incoming',
|
||||
};
|
||||
|
|
|
@ -234,7 +234,7 @@ export function WithCallHistoryGroup(): JSX.Element {
|
|||
<ConversationDetails
|
||||
{...props}
|
||||
callHistoryGroup={{
|
||||
peerId: props.conversation?.uuid ?? '',
|
||||
peerId: props.conversation?.serviceId ?? '',
|
||||
mode: CallMode.Direct,
|
||||
type: CallType.Video,
|
||||
direction: CallDirection.Incoming,
|
||||
|
|
|
@ -292,7 +292,8 @@ function getConfirmationMessage({
|
|||
}
|
||||
|
||||
const inviter = members.find(
|
||||
({ uuid }) => uuid === firstPendingMembership.metadata.addedByUserId
|
||||
({ serviceId }) =>
|
||||
serviceId === firstPendingMembership.metadata.addedByUserId
|
||||
);
|
||||
|
||||
if (inviter === undefined) {
|
||||
|
@ -412,13 +413,16 @@ function MembersPendingProfileKey({
|
|||
groupedPendingMemberships;
|
||||
|
||||
const otherPendingMemberships = Object.keys(otherPendingMembershipGroups)
|
||||
.map(id => members.find(member => member.uuid === id))
|
||||
.map(id => members.find(member => member.serviceId === id))
|
||||
.filter((member): member is ConversationType => member !== undefined)
|
||||
.map(member => {
|
||||
assertDev(member.uuid, 'We just verified that member has uuid above');
|
||||
assertDev(
|
||||
member.serviceId,
|
||||
'We just verified that member has serviceId above'
|
||||
);
|
||||
return {
|
||||
member,
|
||||
pendingMemberships: otherPendingMembershipGroups[member.uuid],
|
||||
pendingMemberships: otherPendingMembershipGroups[member.serviceId],
|
||||
};
|
||||
});
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ type PropsType = {
|
|||
| 'sharedGroupNames'
|
||||
| 'title'
|
||||
| 'unblurredAvatarPath'
|
||||
| 'uuid'
|
||||
| 'serviceId'
|
||||
> &
|
||||
(
|
||||
| { badge?: undefined; theme?: ThemeType }
|
||||
|
@ -109,12 +109,12 @@ export const BaseConversationListItem: FunctionComponent<PropsType> =
|
|||
unblurredAvatarPath,
|
||||
unreadCount,
|
||||
unreadMentionsCount,
|
||||
uuid,
|
||||
serviceId,
|
||||
} = props;
|
||||
|
||||
const identifier = id ? cleanId(id) : undefined;
|
||||
const htmlId = useMemo(() => generateUuid(), []);
|
||||
const testId = overrideTestId || groupId || uuid;
|
||||
const testId = overrideTestId || groupId || serviceId;
|
||||
const isUnread = isConversationUnread({ markedUnread, unreadCount });
|
||||
|
||||
const isAvatarNoteToSelf = isBoolean(isNoteToSelf)
|
||||
|
|
|
@ -38,7 +38,7 @@ export type PropsDataType = {
|
|||
| 'title'
|
||||
| 'type'
|
||||
| 'unblurredAvatarPath'
|
||||
| 'uuid'
|
||||
| 'serviceId'
|
||||
>;
|
||||
|
||||
type PropsHousekeepingType = {
|
||||
|
|
|
@ -39,7 +39,7 @@ export type ContactListItemConversationType = Pick<
|
|||
| 'unblurredAvatarPath'
|
||||
| 'username'
|
||||
| 'e164'
|
||||
| 'uuid'
|
||||
| 'serviceId'
|
||||
>;
|
||||
|
||||
type PropsDataType = ContactListItemConversationType & {
|
||||
|
@ -85,7 +85,7 @@ export const ContactListItem: FunctionComponent<PropsType> = React.memo(
|
|||
title,
|
||||
type,
|
||||
unblurredAvatarPath,
|
||||
uuid,
|
||||
serviceId,
|
||||
}) {
|
||||
const [isConfirmingBlocking, setConfirmingBlocking] = useState(false);
|
||||
const [isConfirmingRemoving, setConfirmingRemoving] = useState(false);
|
||||
|
@ -149,7 +149,7 @@ export const ContactListItem: FunctionComponent<PropsType> = React.memo(
|
|||
/>
|
||||
) : (
|
||||
<ContactName
|
||||
isSignalConversation={isSignalConversation({ id, uuid })}
|
||||
isSignalConversation={isSignalConversation({ id, serviceId })}
|
||||
module={HEADER_CONTACT_NAME_CLASS_NAME}
|
||||
title={title}
|
||||
/>
|
||||
|
|
|
@ -64,7 +64,7 @@ export type PropsData = Pick<
|
|||
| 'unblurredAvatarPath'
|
||||
| 'unreadCount'
|
||||
| 'unreadMentionsCount'
|
||||
| 'uuid'
|
||||
| 'serviceId'
|
||||
> & {
|
||||
badge?: BadgeType;
|
||||
};
|
||||
|
@ -108,7 +108,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
|
|||
unblurredAvatarPath,
|
||||
unreadCount,
|
||||
unreadMentionsCount,
|
||||
uuid,
|
||||
serviceId,
|
||||
}) {
|
||||
const isMuted = Boolean(muteExpiresAt && Date.now() < muteExpiresAt);
|
||||
const headerName = (
|
||||
|
@ -122,7 +122,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
|
|||
) : (
|
||||
<ContactName
|
||||
module={HEADER_CONTACT_NAME_CLASS_NAME}
|
||||
isSignalConversation={isSignalConversation({ id, uuid })}
|
||||
isSignalConversation={isSignalConversation({ id, serviceId })}
|
||||
title={title}
|
||||
/>
|
||||
)}
|
||||
|
@ -221,7 +221,7 @@ export const ConversationListItem: FunctionComponent<Props> = React.memo(
|
|||
unreadCount={unreadCount}
|
||||
unreadMentionsCount={unreadMentionsCount}
|
||||
unblurredAvatarPath={unblurredAvatarPath}
|
||||
uuid={uuid}
|
||||
serviceId={serviceId}
|
||||
/>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ export type GroupListItemConversationType = Pick<
|
|||
disabledReason: DisabledReason | undefined;
|
||||
membersCount: number;
|
||||
memberships: ReadonlyArray<{
|
||||
uuid: AciString;
|
||||
aci: AciString;
|
||||
isAdmin: boolean;
|
||||
}>;
|
||||
};
|
||||
|
|
|
@ -203,14 +203,14 @@ export function Mention(): JSX.Element {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
replacementText: 'Shoe',
|
||||
conversationID: 'x',
|
||||
start: 113,
|
||||
},
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
replacementText: 'Shoe',
|
||||
conversationID: 'x',
|
||||
start: 237,
|
||||
|
@ -235,7 +235,7 @@ export function MentionRegexp(): JSX.Element {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
replacementText: 'RegExp',
|
||||
conversationID: 'x',
|
||||
start: 0,
|
||||
|
@ -260,7 +260,7 @@ export function MentionNoMatches(): JSX.Element {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
replacementText: 'Neo',
|
||||
conversationID: 'x',
|
||||
start: 0,
|
||||
|
@ -284,14 +284,14 @@ export const _MentionNoMatches = (): JSX.Element => {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
replacementText: 'Shoe',
|
||||
conversationID: 'x',
|
||||
start: 113,
|
||||
},
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_3,
|
||||
mentionAci: SERVICE_ID_3,
|
||||
replacementText: 'Shoe',
|
||||
conversationID: 'x',
|
||||
start: 237,
|
||||
|
@ -316,14 +316,14 @@ export function DoubleMention(): JSX.Element {
|
|||
bodyRanges: [
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_2,
|
||||
mentionAci: SERVICE_ID_2,
|
||||
replacementText: 'Alice',
|
||||
conversationID: 'x',
|
||||
start: 4,
|
||||
},
|
||||
{
|
||||
length: 1,
|
||||
mentionUuid: SERVICE_ID_1,
|
||||
mentionAci: SERVICE_ID_1,
|
||||
replacementText: 'Bob',
|
||||
conversationID: 'x',
|
||||
start: 6,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue