diff options
| author | 2025-01-09 18:37:09 +0100 | |
|---|---|---|
| committer | 2025-01-09 18:37:09 +0100 | |
| commit | c25360468c56286a50f52128f548bfd9e8cb7b6b (patch) | |
| tree | 0976f649bf960c593e1f5c0ff96e8b1088764291 /activitypub.c | |
| parent | Deleted useless check. (diff) | |
| download | penes-snac2-c25360468c56286a50f52128f548bfd9e8cb7b6b.tar.gz penes-snac2-c25360468c56286a50f52128f548bfd9e8cb7b6b.tar.xz penes-snac2-c25360468c56286a50f52128f548bfd9e8cb7b6b.zip | |
Added a way to archive ignored messages.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 11 |
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) | |||
| 1853 | /* reject uninteresting messages right now */ | 1853 | /* reject uninteresting messages right now */ |
| 1854 | if (xs_match(type, "Add|View|Reject|Read|Remove")) { | 1854 | if (xs_match(type, "Add|View|Reject|Read|Remove")) { |
| 1855 | srv_debug(0, xs_fmt("Ignored message of type '%s'", type)); | 1855 | srv_debug(0, xs_fmt("Ignored message of type '%s'", type)); |
| 1856 | |||
| 1857 | /* archive the ignored activity */ | ||
| 1858 | xs *ntid = tid(0); | ||
| 1859 | xs *fn = xs_fmt("%s/ignored/%s.json", srv_basedir, ntid); | ||
| 1860 | FILE *f; | ||
| 1861 | |||
| 1862 | if ((f = fopen(fn, "w")) != NULL) { | ||
| 1863 | xs_json_dump(msg, 4, f); | ||
| 1864 | fclose(f); | ||
| 1865 | } | ||
| 1866 | |||
| 1856 | return -1; | 1867 | return -1; |
| 1857 | } | 1868 | } |
| 1858 | 1869 | ||