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

@ -33,6 +33,7 @@ import { assert, strictAssert } from '../util/assert';
import { cleanDataForIpc } from './cleanDataForIpc';
import type { ReactionType } from '../types/Reactions';
import type { ConversationColorType, CustomColorType } from '../types/Colors';
import type { UUIDStringType } from '../types/UUID';
import type { ProcessGroupCallRingRequestResult } from '../types/Calling';
import type { RemoveAllConfiguration } from '../types/RemoveAllConfiguration';
import createTaskWithTimeout from '../textsecure/TaskWithTimeout';
@ -204,7 +205,7 @@ const dataInterface: ClientInterface = {
getAllConversations,
getAllConversationIds,
getAllPrivateConversations,
getAllGroupsInvolvingId,
getAllGroupsInvolvingUuid,
searchConversations,
searchMessages,
@ -1044,15 +1045,15 @@ async function getAllPrivateConversations({
return collection;
}
async function getAllGroupsInvolvingId(
id: string,
async function getAllGroupsInvolvingUuid(
uuid: UUIDStringType,
{
ConversationCollection,
}: {
ConversationCollection: typeof ConversationModelCollectionType;
}
) {
const conversations = await channels.getAllGroupsInvolvingId(id);
const conversations = await channels.getAllGroupsInvolvingUuid(uuid);
const collection = new ConversationCollection();
collection.add(conversations);
@ -1325,11 +1326,11 @@ async function getNewerMessagesByConversation(
}
async function getLastConversationMessages({
conversationId,
ourConversationId,
ourUuid,
Message,
}: {
conversationId: string;
ourConversationId: string;
ourUuid: UUIDStringType;
Message: typeof MessageModel;
}): Promise<LastConversationMessagesType> {
const {
@ -1338,7 +1339,7 @@ async function getLastConversationMessages({
hasUserInitiatedMessages,
} = await channels.getLastConversationMessages({
conversationId,
ourConversationId,
ourUuid,
});
return {