From 0e52fc4cb789b094c1028065b99fd0679a703c90 Mon Sep 17 00:00:00 2001 From: Matthias Reumann Date: Tue, 22 Aug 2023 09:11:42 +0200 Subject: [PATCH] Update query --- dao/chat.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dao/chat.go b/dao/chat.go index 9130dce48..e2b43d4a1 100644 --- a/dao/chat.go +++ b/dao/chat.go @@ -89,7 +89,7 @@ func (d chatDao) GetReactions(chatID uint) ([]model.ChatReaction, error) { func (d chatDao) GetVisibleChats(userID uint, streamID uint) ([]model.Chat, error) { var chats []model.Chat query := DB. - Preload("Replies"). + Preload("Replies", "(visible = 1) OR (user_id = ?)", userID). Preload("Reactions"). Preload("AddressedToUsers"). Where("(visible = 1) OR (user_id = ?)", userID).