aboutsummaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-09 18:37:09 +0100
committerdefault <nobody@localhost>2025-01-09 18:37:09 +0100
commitc25360468c56286a50f52128f548bfd9e8cb7b6b (patch)
tree0976f649bf960c593e1f5c0ff96e8b1088764291 /activitypub.c
parent74cd356be8ba270c76202c7c55b5b07ab4bfd22c (diff)
Added a way to archive ignored messages.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index 24954e6..9f7e9a6 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1853,6 +1853,17 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
/* reject uninteresting messages right now */
if (xs_match(type, "Add|View|Reject|Read|Remove")) {
srv_debug(0, xs_fmt("Ignored message of type '%s'", type));
+
+ /* archive the ignored activity */
+ xs *ntid = tid(0);
+ xs *fn = xs_fmt("%s/ignored/%s.json", srv_basedir, ntid);
+ FILE *f;
+
+ if ((f = fopen(fn, "w")) != NULL) {
+ xs_json_dump(msg, 4, f);
+ fclose(f);
+ }
+
return -1;
}