Skip to content

Take control over your live stream video by running it yourself. Streaming + chat out of the box.

Fix chat history backlog query. Closes #748

Gabe Kangas36ceb626741b
diff --git a/core/chat/persistence.go b/core/chat/persistence.go
index b302cee706..98c3df30f0 100644
--- a/core/chat/persistence.go
+++ b/core/chat/persistence.go
@@ -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)
}