From ebcd3e3e433c7b6faf36ce742e52a3447bcd305b Mon Sep 17 00:00:00 2001 From: Evan Hahn <69474926+EvanHahn-Signal@users.noreply.github.com> Date: Fri, 10 Dec 2021 17:15:00 -0600 Subject: [PATCH] Remove unused `getAllPrivateConversations` SQL function --- ts/sql/Client.ts | 5 ----- ts/sql/Interface.ts | 1 - ts/sql/Server.ts | 17 ----------------- 3 files changed, 23 deletions(-) diff --git a/ts/sql/Client.ts b/ts/sql/Client.ts index c2ed7e9ca1..e63da5dd79 100644 --- a/ts/sql/Client.ts +++ b/ts/sql/Client.ts @@ -205,7 +205,6 @@ const dataInterface: ClientInterface = { getAllConversations, getAllConversationIds, - getAllPrivateConversations, getAllGroupsInvolvingUuid, searchConversations, @@ -1024,10 +1023,6 @@ async function getAllConversationIds() { return ids; } -async function getAllPrivateConversations() { - return channels.getAllPrivateConversations(); -} - async function getAllGroupsInvolvingUuid(uuid: UUIDStringType) { return channels.getAllGroupsInvolvingUuid(uuid); } diff --git a/ts/sql/Interface.ts b/ts/sql/Interface.ts index 893e49b085..af01a44fb2 100644 --- a/ts/sql/Interface.ts +++ b/ts/sql/Interface.ts @@ -357,7 +357,6 @@ export type DataInterface = { getAllConversations: () => Promise<Array<ConversationType>>; getAllConversationIds: () => Promise<Array<string>>; - getAllPrivateConversations: () => Promise<Array<ConversationType>>; getAllGroupsInvolvingUuid: ( id: UUIDStringType ) => Promise<Array<ConversationType>>; diff --git a/ts/sql/Server.ts b/ts/sql/Server.ts index f025ce813d..4f5bf49a72 100644 --- a/ts/sql/Server.ts +++ b/ts/sql/Server.ts @@ -201,7 +201,6 @@ const dataInterface: ServerInterface = { getAllConversations, getAllConversationIds, - getAllPrivateConversations, getAllGroupsInvolvingUuid, searchConversations, @@ -1491,22 +1490,6 @@ async function getAllConversationIds(): Promise<Array<string>> { return rows.map(row => row.id); } -async function getAllPrivateConversations(): Promise<Array<ConversationType>> { - const db = getInstance(); - const rows: ConversationRows = db - .prepare<EmptyQuery>( - ` - SELECT json, profileLastFetchedAt - FROM conversations - WHERE type = 'private' - ORDER BY id ASC; - ` - ) - .all(); - - return rows.map(row => rowToConversation(row)); -} - async function getAllGroupsInvolvingUuid( uuid: UUIDStringType ): Promise<Array<ConversationType>> {