diff --git a/src/app_service/service/chat/service.nim b/src/app_service/service/chat/service.nim index 3899eb9c9e..4eca16c031 100644 --- a/src/app_service/service/chat/service.nim +++ b/src/app_service/service/chat/service.nim @@ -489,7 +489,7 @@ QtObject: let leaveGroupResponse = status_chat.leaveGroupChat(chatId) self.emitUpdate(leaveGroupResponse) - discard status_chat.deactivateChat(chatId) + discard status_chat.deactivateChat(chatId, preserveHistory = chat.chatType == chat_dto.ChatType.OneToOne) var channelGroupId = chat.communityId if (channelGroupId == ""): @@ -497,7 +497,6 @@ QtObject: self.channelGroups[channelGroupId].chats.delete(self.getChatIndex(channelGroupId, chatId)) self.chats.del(chatId) - discard status_chat.deleteMessagesByChatId(chatId) self.events.emit(SIGNAL_CHAT_LEFT, ChatArgs(chatId: chatId)) except Exception as e: error "Error deleting channel", chatId, msg = e.msg diff --git a/src/app_service/service/message/service.nim b/src/app_service/service/message/service.nim index 0069ed24f7..70cfe284a7 100644 --- a/src/app_service/service/message/service.nim +++ b/src/app_service/service/message/service.nim @@ -190,12 +190,6 @@ QtObject: result.msgCursor = initTable[string, MessageCursor]() result.pinnedMsgCursor = initTable[string, MessageCursor]() - proc removeMessageWithId(messages: var seq[MessageDto], msgId: string) = - for i in 0..