summaryrefslogtreecommitdiff
path: root/internal/federation/federatingdb/undo.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/federation/federatingdb/undo.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/federation/federatingdb/undo.go')
-rw-r--r--internal/federation/federatingdb/undo.go9
1 files changed, 5 insertions, 4 deletions
diff --git a/internal/federation/federatingdb/undo.go b/internal/federation/federatingdb/undo.go
index 0fa38114d..481c2d787 100644
--- a/internal/federation/federatingdb/undo.go
+++ b/internal/federation/federatingdb/undo.go
@@ -27,6 +27,7 @@ import (
"github.com/go-fed/activity/streams"
"github.com/go-fed/activity/streams/vocab"
"github.com/sirupsen/logrus"
+ "github.com/superseriousbusiness/gotosocial/internal/ap"
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/util"
@@ -72,7 +73,7 @@ func (f *federatingDB) Undo(ctx context.Context, undo vocab.ActivityStreamsUndo)
continue
}
switch iter.GetType().GetTypeName() {
- case string(gtsmodel.ActivityStreamsFollow):
+ case ap.ActivityFollow:
// UNDO FOLLOW
ASFollow, ok := iter.GetType().(vocab.ActivityStreamsFollow)
if !ok {
@@ -101,11 +102,11 @@ func (f *federatingDB) Undo(ctx context.Context, undo vocab.ActivityStreamsUndo)
}
l.Debug("follow undone")
return nil
- case string(gtsmodel.ActivityStreamsLike):
+ case ap.ActivityLike:
// UNDO LIKE
- case string(gtsmodel.ActivityStreamsAnnounce):
+ case ap.ActivityAnnounce:
// UNDO BOOST/REBLOG/ANNOUNCE
- case string(gtsmodel.ActivityStreamsBlock):
+ case ap.ActivityBlock:
// UNDO BLOCK
ASBlock, ok := iter.GetType().(vocab.ActivityStreamsBlock)
if !ok {