Browse Source

Only ignore messages 5min after disconnect. Part of fixing #1268

pull/1309/head
Gabe Kangas 4 years ago
parent
commit
6fb383d04b
  1. 8
      core/chat/events.go

8
core/chat/events.go

@ -4,6 +4,7 @@ import ( @@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"strings"
"time"
"github.com/owncast/owncast/core/chat/events"
"github.com/owncast/owncast/core/data"
@ -80,10 +81,13 @@ func (s *ChatServer) userMessageSent(eventData chatClientEvent) { @@ -80,10 +81,13 @@ func (s *ChatServer) userMessageSent(eventData chatClientEvent) {
return
}
// Ignore if the stream in offline
if !getStatus().Online {
// Ignore if the stream has been offline
if !getStatus().Online && getStatus().LastDisconnectTime != nil {
disconnectedTime := getStatus().LastDisconnectTime.Time
if time.Since(disconnectedTime) > 5*time.Minute {
return
}
}
event.User = user.GetUserByToken(eventData.client.accessToken)

Loading…
Cancel
Save