commit 6faa4e6c7f0afad8f7a3162c2c9d0088ce1d85e1
parent 9c3e75646de30aec82a4d699b18398c4377cd1ea
Author: n0tr1v <n0tr1v@protonmail.com>
Date: Sun, 15 Jan 2023 19:06:12 -0800
add doc
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/pkg/database/tableChatMessages.go b/pkg/database/tableChatMessages.go
@@ -276,7 +276,7 @@ func GetRoomChatMessagesByDate(roomID RoomID, dt time.Time) (out []ChatMessage,
}
func GetChatMessages(roomID RoomID, username string, userID UserID, displayPms int64, mentionsOnly, displayHellbanned, displayIgnored, displayModerators bool) (out ChatMessages, err error) {
-
+
cmp := func(t, t2 ChatMessage) bool { return t.ID > t2.ID }
q := DB.
@@ -317,6 +317,10 @@ func GetChatMessages(roomID RoomID, username string, userID UserID, displayPms i
//-----------
+ // Get all the HB messages that are more recent than the oldest non-HB message.
+ // We do this in case someone in HB keep spamming the room.
+ // So we still have 150 non-HB messages for normal folks and we get all the spam for the people in HB.
+
var out2 []ChatMessage
if displayHellbanned {
q2 := q.Where("is_hellbanned = 1 AND id > ?", minID)