summaryrefslogtreecommitdiff
path: root/internal/processing/streaming/streamdelete.go
diff options
context:
space:
mode:
authorLibravatar kim <89579420+NyaaaWhatsUpDoc@users.noreply.github.com>2021-09-03 10:27:40 +0100
committerLibravatar GitHub <noreply@github.com>2021-09-03 10:27:40 +0100
commit25edd57eaf3eecf0b449a4dabb5b5fc5d6ae7687 (patch)
treeb6cffb65d46a07f59d5393a257973910d4116227 /internal/processing/streaming/streamdelete.go
parentsession name fix (#185) (diff)
parentreview changes (diff)
downloadgotosocial-25edd57eaf3eecf0b449a4dabb5b5fc5d6ae7687.tar.xz
Merge pull request #186 from superseriousbusiness/struct_validation
Struct validation
Diffstat (limited to 'internal/processing/streaming/streamdelete.go')
-rw-r--r--internal/processing/streaming/streamdelete.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/internal/processing/streaming/streamdelete.go b/internal/processing/streaming/streamdelete.go
index 2282c29ae..cd541bc57 100644
--- a/internal/processing/streaming/streamdelete.go
+++ b/internal/processing/streaming/streamdelete.go
@@ -4,7 +4,7 @@ import (
"fmt"
"strings"
- "github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/stream"
)
func (p *processor) StreamDelete(statusID string) error {
@@ -20,7 +20,7 @@ func (p *processor) StreamDelete(statusID string) error {
}
// the value of the map should be a buncha streams
- streamsForAccount, ok := v.(*gtsmodel.StreamsForAccount)
+ streamsForAccount, ok := v.(*stream.StreamsForAccount)
if !ok {
errs = append(errs, fmt.Sprintf("stream map error for account stream %s", accountID))
}
@@ -28,13 +28,13 @@ func (p *processor) StreamDelete(statusID string) error {
// lock the streams while we work on them
streamsForAccount.Lock()
defer streamsForAccount.Unlock()
- for _, stream := range streamsForAccount.Streams {
+ for _, s := range streamsForAccount.Streams {
// lock each individual stream as we work on it
- stream.Lock()
- defer stream.Unlock()
- if stream.Connected {
- stream.Messages <- &gtsmodel.Message{
- Stream: []string{stream.Type},
+ s.Lock()
+ defer s.Unlock()
+ if s.Connected {
+ s.Messages <- &stream.Message{
+ Stream: []string{s.Type},
Event: "delete",
Payload: statusID,
}