From d389e7b150df6ecd215c7b661b294ea153ad0103 Mon Sep 17 00:00:00 2001 From: Tobi Smethurst <31960611+tsmethurst@users.noreply.github.com> Date: Mon, 5 Jul 2021 13:23:03 +0200 Subject: Domain block (#76) * start work on admin domain blocking * move stuff around + further work on domain blocks * move + restructure processor * prep work for deleting account * tidy * go fmt * formatting * domain blocking more work * check domain blocks way earlier on * progress on delete account * delete more stuff when an account is gone * and more... * domain blocky block block * get individual domain block, delete a block --- .../synchronous/streaming/streamdelete.go | 51 ---------------------- 1 file changed, 51 deletions(-) delete mode 100644 internal/processing/synchronous/streaming/streamdelete.go (limited to 'internal/processing/synchronous/streaming/streamdelete.go') diff --git a/internal/processing/synchronous/streaming/streamdelete.go b/internal/processing/synchronous/streaming/streamdelete.go deleted file mode 100644 index 2282c29ae..000000000 --- a/internal/processing/synchronous/streaming/streamdelete.go +++ /dev/null @@ -1,51 +0,0 @@ -package streaming - -import ( - "fmt" - "strings" - - "github.com/superseriousbusiness/gotosocial/internal/gtsmodel" -) - -func (p *processor) StreamDelete(statusID string) error { - errs := []string{} - - // we want to range through ALL streams for ALL accounts here to make sure it's very clear to everyone that the status has been deleted - p.streamMap.Range(func(k interface{}, v interface{}) bool { - // the key of this map should be an accountID (string) - accountID, ok := k.(string) - if !ok { - errs = append(errs, "key in streamMap was not a string!") - return false - } - - // the value of the map should be a buncha streams - streamsForAccount, ok := v.(*gtsmodel.StreamsForAccount) - if !ok { - errs = append(errs, fmt.Sprintf("stream map error for account stream %s", accountID)) - } - - // lock the streams while we work on them - streamsForAccount.Lock() - defer streamsForAccount.Unlock() - for _, stream := range streamsForAccount.Streams { - // lock each individual stream as we work on it - stream.Lock() - defer stream.Unlock() - if stream.Connected { - stream.Messages <- >smodel.Message{ - Stream: []string{stream.Type}, - Event: "delete", - Payload: statusID, - } - } - } - return true - }) - - if len(errs) != 0 { - return fmt.Errorf("one or more errors streaming status delete: %s", strings.Join(errs, ";")) - } - - return nil -} -- cgit v1.2.3