summaryrefslogtreecommitdiff
path: root/internal/processing/fromclientapi.go
diff options
context:
space:
mode:
authorLibravatar tobi <31960611+tsmethurst@users.noreply.github.com>2023-01-23 13:14:21 +0100
committerLibravatar GitHub <noreply@github.com>2023-01-23 13:14:21 +0100
commite9747247d58a0423d5e40fda5c5b37b4b4526495 (patch)
tree5574b05f1dec1ad88c49b9891f1e54719f1b9eb1 /internal/processing/fromclientapi.go
parent[chore] bump go version to 1.19.5 (#1377) (diff)
downloadgotosocial-e9747247d58a0423d5e40fda5c5b37b4b4526495.tar.xz
[feature] Implement `/api/v1/reports` endpoints on client API (#1330)
* start adding report client api * route + test reports get * start report create endpoint * you can create reports now babyy * stub account report processor * add single reportGet endpoint * fix test * add more filtering params to /api/v1/reports GET * update swagger * use marshalIndent in tests * add + test missing Link info
Diffstat (limited to 'internal/processing/fromclientapi.go')
-rw-r--r--internal/processing/fromclientapi.go13
1 files changed, 13 insertions, 0 deletions
diff --git a/internal/processing/fromclientapi.go b/internal/processing/fromclientapi.go
index d2512632e..997e76691 100644
--- a/internal/processing/fromclientapi.go
+++ b/internal/processing/fromclientapi.go
@@ -121,6 +121,12 @@ func (p *processor) ProcessFromClientAPI(ctx context.Context, clientMsg messages
// DELETE ACCOUNT/PROFILE
return p.processDeleteAccountFromClientAPI(ctx, clientMsg)
}
+ case ap.ActivityFlag:
+ // FLAG
+ if clientMsg.APObjectType == ap.ObjectProfile {
+ // FLAG/REPORT A PROFILE
+ return p.processReportAccountFromClientAPI(ctx, clientMsg)
+ }
}
return nil
}
@@ -338,6 +344,13 @@ func (p *processor) processDeleteAccountFromClientAPI(ctx context.Context, clien
return p.accountProcessor.Delete(ctx, clientMsg.TargetAccount, origin)
}
+func (p *processor) processReportAccountFromClientAPI(ctx context.Context, clientMsg messages.FromClientAPI) error {
+ // TODO: in a separate PR, handle side effects of flag/report
+ // 1. email admin(s)
+ // 2. federate report if necessary
+ return nil
+}
+
// TODO: move all the below functions into federation.Federator
func (p *processor) federateAccountDelete(ctx context.Context, account *gtsmodel.Account) error {