summaryrefslogtreecommitdiff
path: root/internal/processing/streaming/streamstatus.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/streaming/streamstatus.go')
-rw-r--r--internal/processing/streaming/streamstatus.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/internal/processing/streaming/streamstatus.go b/internal/processing/streaming/streamstatus.go
index 8d026252d..f4d6b2629 100644
--- a/internal/processing/streaming/streamstatus.go
+++ b/internal/processing/streaming/streamstatus.go
@@ -8,6 +8,7 @@ import (
"github.com/sirupsen/logrus"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/stream"
)
func (p *processor) StreamStatusToAccount(s *apimodel.Status, account *gtsmodel.Account) error {
@@ -21,7 +22,7 @@ func (p *processor) StreamStatusToAccount(s *apimodel.Status, account *gtsmodel.
return nil
}
- streamsForAccount, ok := v.(*gtsmodel.StreamsForAccount)
+ streamsForAccount, ok := v.(*stream.StreamsForAccount)
if !ok {
return errors.New("stream map error")
}
@@ -33,13 +34,13 @@ func (p *processor) StreamStatusToAccount(s *apimodel.Status, account *gtsmodel.
streamsForAccount.Lock()
defer streamsForAccount.Unlock()
- for _, stream := range streamsForAccount.Streams {
- stream.Lock()
- defer stream.Unlock()
- if stream.Connected {
- l.Debugf("streaming status to stream id %s", stream.ID)
- stream.Messages <- &gtsmodel.Message{
- Stream: []string{stream.Type},
+ for _, s := range streamsForAccount.Streams {
+ s.Lock()
+ defer s.Unlock()
+ if s.Connected {
+ l.Debugf("streaming status to stream id %s", s.ID)
+ s.Messages <- &stream.Message{
+ Stream: []string{s.Type},
Event: "update",
Payload: string(statusBytes),
}