diff options
author | FChannel <> | 2022-06-04 11:08:51 -0700 |
---|---|---|
committer | FChannel <> | 2022-06-19 12:53:29 -0700 |
commit | 89795236377c1db1821c7ccbbc48a94562a70995 (patch) | |
tree | 75fa016c2073008d766ef9da22ca5c4405ae8bb0 /route | |
parent | fbc0e5e5f910ea64b6b18be1a354817c195a6f04 (diff) |
made view reported posts less gimped
Diffstat (limited to 'route')
-rw-r--r-- | route/routes/admin.go | 24 | ||||
-rw-r--r-- | route/structs.go | 2 |
2 files changed, 2 insertions, 24 deletions
diff --git a/route/routes/admin.go b/route/routes/admin.go index 86e12c6..dfa7313 100644 --- a/route/routes/admin.go +++ b/route/routes/admin.go @@ -226,12 +226,8 @@ func AdminActorIndex(ctx *fiber.Ctx) error { reqActivity.Id = actor.Followers follower, _ := reqActivity.GetCollection() - reqActivity.Id = actor.Id + "/reported" - reported, _ := activitypub.GetActorCollectionReq(reqActivity.Id) - var following []string var followers []string - var reports []db.Report for _, e := range follow.Items { following = append(following, e.Id) @@ -241,28 +237,10 @@ func AdminActorIndex(ctx *fiber.Ctx) error { followers = append(followers, e.Id) } - for _, e := range reported.Items { - var r db.Report - r.Count = int(e.Size) - r.ID = e.Id - r.Reason = e.Content - reports = append(reports, r) - } - - localReports, _ := db.GetLocalReport(actor.Name) - - for _, e := range localReports { - var r db.Report - r.Count = e.Count - r.ID = e.ID - r.Reason = e.Reason - reports = append(reports, r) - } - var data route.AdminPage data.Following = following data.Followers = followers - data.Reported = reports + data.Reported, _ = db.GetLocalReport(actor.Name) data.Domain = config.Domain data.IsLocal, _ = actor.IsLocal() diff --git a/route/structs.go b/route/structs.go index 7b1c2b8..fbfb327 100644 --- a/route/structs.go +++ b/route/structs.go @@ -37,7 +37,7 @@ type AdminPage struct { Boards []webfinger.Board Following []string Followers []string - Reported []db.Report + Reported map[string]db.Reports Domain string IsLocal bool PostBlacklist []util.PostBlacklist |