diff options
author | FChannel <> | 2022-06-04 11:55:19 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 60752f58ab0eade30e88c1e98ad530a4b151586e (patch) | |
tree | 421b06b577250ff13f40bf05773332beea857523 /route/routes/actor.go | |
parent | 89795236377c1db1821c7ccbbc48a94562a70995 (diff) |
redirect to OP thread if not OP
Diffstat (limited to 'route/routes/actor.go')
-rw-r--r-- | route/routes/actor.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/route/routes/actor.go b/route/routes/actor.go index e1372ee..fc9795a 100644 --- a/route/routes/actor.go +++ b/route/routes/actor.go @@ -398,6 +398,12 @@ func ActorPostGet(ctx *fiber.Ctx) error { inReplyTo := actor.Id + "/" + postId + // check if actually OP if not redirect to op to get full thread + var obj = activitypub.ObjectBase{Id: inReplyTo} + if OP, _ := obj.GetOP(); OP != obj.Id { + return ctx.Redirect(config.Domain+"/"+actor.Name+"/"+util.ShortURL(actor.Outbox, OP)+"#"+util.ShortURL(actor.Outbox, inReplyTo), http.StatusMovedPermanently) + } + var data route.PageData re = regexp.MustCompile("f(\\w|[!@#$%^&*<>])+-(\\w|[!@#$%^&*<>])+") |