diff --git a/ts/sql/Server.ts b/ts/sql/Server.ts index 11cb2463686..fbfd2c8490f 100644 --- a/ts/sql/Server.ts +++ b/ts/sql/Server.ts @@ -2966,10 +2966,10 @@ async function getLastConversationActivity({ ourConversationId: string; }): Promise { const db = getInstance(); - const row = db - .prepare( - ` - SELECT * FROM messages + const row = prepare( + db, + ` + SELECT json FROM messages WHERE conversationId = $conversationId AND (type IS NULL @@ -2997,11 +2997,10 @@ async function getLastConversationActivity({ ORDER BY received_at DESC, sent_at DESC LIMIT 1; ` - ) - .get({ - conversationId, - ourConversationId, - }); + ).get({ + conversationId, + ourConversationId, + }); if (!row) { return undefined; @@ -3017,10 +3016,10 @@ async function getLastConversationPreview({ ourConversationId: string; }): Promise { const db = getInstance(); - const row = db - .prepare( - ` - SELECT * FROM messages + const row = prepare( + db, + ` + SELECT json FROM messages WHERE conversationId = $conversationId AND ( @@ -3043,11 +3042,10 @@ async function getLastConversationPreview({ ORDER BY received_at DESC, sent_at DESC LIMIT 1; ` - ) - .get({ - conversationId, - ourConversationId, - }); + ).get({ + conversationId, + ourConversationId, + }); if (!row) { return undefined;