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

@ -3,6 +3,7 @@
import { compact } from 'lodash';
import type { ConversationAttributesType } from '../model-types.d';
import type { UUIDStringType } from '../types/UUID';
import { isDirectConversation } from './whatTypeOfConversation';
export function getConversationMembers(
@ -15,7 +16,7 @@ export function getConversationMembers(
if (conversationAttrs.membersV2) {
const { includePendingMembers } = options;
const members: Array<{ conversationId: string }> = includePendingMembers
const members: Array<{ uuid: UUIDStringType }> = includePendingMembers
? [
...(conversationAttrs.membersV2 || []),
...(conversationAttrs.pendingMembersV2 || []),
@ -24,9 +25,7 @@ export function getConversationMembers(
return compact(
members.map(member => {
const conversation = window.ConversationController.get(
member.conversationId
);
const conversation = window.ConversationController.get(member.uuid);
// In groups we won't sent to contacts we believe are unregistered
if (conversation && conversation.isUnregistered()) {