summaryrefslogtreecommitdiff
path: root/internal/processing
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2024-03-13 14:45:50 +0100
committerLibravatar GitHub <noreply@github.com>2024-03-13 14:45:50 +0100
commit92bf1f779bd86756f78f94283e6085e6fe2f5de0 (patch)
treece4476d509959321f14c1a3167cbe18dc62eb105 /internal/processing
parent[feature] Process outgoing Move from clientAPI (#2750) (diff)
downloadgotosocial-92bf1f779bd86756f78f94283e6085e6fe2f5de0.tar.xz
[chore] Expose move endpoint again, small settings panel fixes (#2752)
Diffstat (limited to 'internal/processing')
-rw-r--r--internal/processing/account/move.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/internal/processing/account/move.go b/internal/processing/account/move.go
index ca8dd4dea..a68c8f750 100644
--- a/internal/processing/account/move.go
+++ b/internal/processing/account/move.go
@@ -154,6 +154,17 @@ func (p *Processor) MoveSelf(
}
}
+ // If originAcct has already moved, ensure
+ // this move reattempt is to the same account.
+ if originAcct.IsMoving() &&
+ originAcct.MovedToURI != targetAcct.URI {
+ err := fmt.Errorf(
+ "your account is already Moving or has Moved to %s; you cannot also Move to %s",
+ originAcct.MovedToURI, targetAcct.URI,
+ )
+ return gtserror.NewErrorUnprocessableEntity(err, err.Error())
+ }
+
// Target account MUST be aliased to this
// account for this to be a valid Move.
if !slices.Contains(targetAcct.AlsoKnownAsURIs, originAcct.URI) {