0

Fix chat history backlog query. Closes #748

This commit is contained in:
Gabe Kangas 2021-02-21 12:13:46 -08:00
parent 3663c1bcfd
commit 765dd7efe2

View File

@ -109,7 +109,7 @@ func getChatModerationHistory() []models.ChatEvent {
func getChatHistory() []models.ChatEvent {
// Get all messages sent within the past 5hrs, max 50
var query = "SELECT * FROM messages WHERE datetime(timestamp) >=datetime('now', '-5 Hour') AND visible = 1 LIMIT 50"
var query = "SELECT * FROM (SELECT * FROM messages WHERE datetime(timestamp) >=datetime('now', '-5 Hour') AND visible = 1 ORDER BY timestamp DESC LIMIT 50) ORDER BY timestamp asc"
return getChat(query)
}