From 4f45f30ef9da8ba0a8511acd53bdcf2054d91a18 Mon Sep 17 00:00:00 2001 From: Anthony Bilinski Date: Wed, 30 Mar 2022 20:41:28 -0700 Subject: [PATCH] fix(history): Fix alias removal SQL query after group history addition --- src/persistence/history.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/persistence/history.cpp b/src/persistence/history.cpp index f4682dfa1..b25c4f33c 100644 --- a/src/persistence/history.cpp +++ b/src/persistence/history.cpp @@ -315,8 +315,9 @@ void History::removeChatHistory(const ChatId& chatId) queryString += QStringLiteral("; " "DELETE FROM aliases WHERE id NOT IN ( " - " SELECT DISTINCT sender_alias FROM " - " text_messages JOIN file_transfers);"); + " SELECT DISTINCT sender_alias FROM text_messages " + " UNION " + " SELECT DISTINCT sender_alias FROM file_transfers);"); queryString += QStringLiteral( "DELETE FROM authors WHERE id NOT IN ( "