Use UUIDs in group database schema

This commit is contained in:
Fedor Indutny 2021-10-26 15:59:08 -07:00 committed by GitHub
parent 74fde10ff5
commit 63fcdbe787
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
79 changed files with 4530 additions and 3664 deletions

View file

@ -37,6 +37,7 @@ import type { PropsType as ProfileChangeNotificationPropsType } from '../../comp
import type { QuotedAttachmentType } from '../../components/conversation/Quote';
import { getDomain, isStickerPack } from '../../types/LinkPreview';
import type { UUIDStringType } from '../../types/UUID';
import type { EmbeddedContactType } from '../../types/EmbeddedContact';
import { embeddedContactSelector } from '../../types/EmbeddedContact';
@ -99,7 +100,7 @@ export type GetPropsForBubbleOptions = Readonly<{
conversationSelector: GetConversationByIdType;
ourConversationId: string;
ourNumber?: string;
ourUuid?: string;
ourUuid: UUIDStringType;
selectedMessageId?: string;
selectedMessageCounter?: number;
regionCode: string;
@ -772,7 +773,7 @@ export function isGroupV2Change(message: MessageAttributesType): boolean {
function getPropsForGroupV2Change(
message: MessageAttributesType,
{ conversationSelector, ourConversationId }: GetPropsForBubbleOptions
{ conversationSelector, ourUuid }: GetPropsForBubbleOptions
): GroupsV2Props {
const change = message.groupV2Change;
@ -784,7 +785,7 @@ function getPropsForGroupV2Change(
return {
groupName: conversation?.type === 'group' ? conversation?.name : undefined,
ourConversationId,
ourUuid,
change,
};
}
@ -806,7 +807,7 @@ function getPropsForGroupV1Migration(
const droppedGV2MemberIds = message.droppedGV2MemberIds || [];
const invitedMembers = invitedGV2Members.map(item =>
conversationSelector(item.conversationId)
conversationSelector(item.uuid)
);
const droppedMembers = droppedGV2MemberIds.map(conversationId =>
conversationSelector(conversationId)
@ -825,7 +826,7 @@ function getPropsForGroupV1Migration(
invitedMembers: rawInvitedMembers,
} = migration;
const invitedMembers = rawInvitedMembers.map(item =>
conversationSelector(item.conversationId)
conversationSelector(item.uuid)
);
const droppedMembers = droppedMemberIds.map(conversationId =>
conversationSelector(conversationId)