summaryrefslogtreecommitdiff
path: root/internal/api/client/timelines
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client/timelines')
-rw-r--r--internal/api/client/timelines/home.go7
-rw-r--r--internal/api/client/timelines/list.go7
-rw-r--r--internal/api/client/timelines/public.go7
-rw-r--r--internal/api/client/timelines/tag.go7
4 files changed, 28 insertions, 0 deletions
diff --git a/internal/api/client/timelines/home.go b/internal/api/client/timelines/home.go
index a7e7717da..55928dd3a 100644
--- a/internal/api/client/timelines/home.go
+++ b/internal/api/client/timelines/home.go
@@ -113,6 +113,13 @@ func (m *Module) HomeTimelineGETHandler(c *gin.Context) {
return
}
+ if authed.Account.IsMoving() {
+ // For moving/moved accounts, just return
+ // empty to avoid breaking client apps.
+ apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONArray)
+ return
+ }
+
if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil {
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/timelines/list.go b/internal/api/client/timelines/list.go
index dc5f21424..25695bf0e 100644
--- a/internal/api/client/timelines/list.go
+++ b/internal/api/client/timelines/list.go
@@ -112,6 +112,13 @@ func (m *Module) ListTimelineGETHandler(c *gin.Context) {
return
}
+ if authed.Account.IsMoving() {
+ // For moving/moved accounts, just return
+ // empty to avoid breaking client apps.
+ apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONArray)
+ return
+ }
+
if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil {
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/timelines/public.go b/internal/api/client/timelines/public.go
index 8eb34edc7..c4ffbc6c8 100644
--- a/internal/api/client/timelines/public.go
+++ b/internal/api/client/timelines/public.go
@@ -124,6 +124,13 @@ func (m *Module) PublicTimelineGETHandler(c *gin.Context) {
return
}
+ if authed.Account != nil && authed.Account.IsMoving() {
+ // For moving/moved accounts, just return
+ // empty to avoid breaking client apps.
+ apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONArray)
+ return
+ }
+
if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil {
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1)
return
diff --git a/internal/api/client/timelines/tag.go b/internal/api/client/timelines/tag.go
index e66955a73..258184355 100644
--- a/internal/api/client/timelines/tag.go
+++ b/internal/api/client/timelines/tag.go
@@ -114,6 +114,13 @@ func (m *Module) TagTimelineGETHandler(c *gin.Context) {
return
}
+ if authed.Account.IsMoving() {
+ // For moving/moved accounts, just return
+ // empty to avoid breaking client apps.
+ apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONArray)
+ return
+ }
+
if _, err := apiutil.NegotiateAccept(c, apiutil.JSONAcceptHeaders...); err != nil {
apiutil.ErrorHandler(c, gtserror.NewErrorNotAcceptable(err, err.Error()), m.processor.InstanceGetV1)
return