diff options
| author | 2023-12-17 15:21:16 +0100 | |
|---|---|---|
| committer | 2023-12-17 15:21:16 +0100 | |
| commit | f8196b4ef6369b5cbaf746cbaf6101eba1fb783b (patch) | |
| tree | e1142beb5839eaa332778c83c79cbfe5b0b0573e | |
| parent | Fixed shared inbox distribution logic for Delete messages. (diff) | |
| download | snac2-f8196b4ef6369b5cbaf746cbaf6101eba1fb783b.tar.gz snac2-f8196b4ef6369b5cbaf746cbaf6101eba1fb783b.tar.xz snac2-f8196b4ef6369b5cbaf746cbaf6101eba1fb783b.zip | |
New function srv_archive_qitem().
| -rw-r--r-- | activitypub.c | 4 | ||||
| -rw-r--r-- | data.c | 14 | ||||
| -rw-r--r-- | snac.h | 1 |
3 files changed, 18 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c index 130c283..fa06a89 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -2135,8 +2135,10 @@ void process_queue_item(xs_dict *q_item) | |||
| 2135 | 2135 | ||
| 2136 | unlink(tmpfn); | 2136 | unlink(tmpfn); |
| 2137 | 2137 | ||
| 2138 | if (cnt == 0) | 2138 | if (cnt == 0) { |
| 2139 | srv_archive_qitem(q_item); | ||
| 2139 | srv_debug(1, xs_fmt("no valid recipients for %s", tmpfn)); | 2140 | srv_debug(1, xs_fmt("no valid recipients for %s", tmpfn)); |
| 2141 | } | ||
| 2140 | } | 2142 | } |
| 2141 | } | 2143 | } |
| 2142 | else | 2144 | else |
| @@ -2752,3 +2752,17 @@ void srv_archive_error(const char *prefix, const xs_str *err, | |||
| 2752 | fclose(f); | 2752 | fclose(f); |
| 2753 | } | 2753 | } |
| 2754 | } | 2754 | } |
| 2755 | |||
| 2756 | |||
| 2757 | void srv_archive_qitem(xs_dict *q_item) | ||
| 2758 | /* archives a q_item in the error folder */ | ||
| 2759 | { | ||
| 2760 | xs *ntid = tid(0); | ||
| 2761 | xs *fn = xs_fmt("%s/error/%s_qitem", srv_basedir, ntid); | ||
| 2762 | FILE *f; | ||
| 2763 | |||
| 2764 | if ((f = fopen(fn, "w")) != NULL) { | ||
| 2765 | xs_json_dump(q_item, 4, f); | ||
| 2766 | fclose(f); | ||
| 2767 | } | ||
| 2768 | } | ||
| @@ -64,6 +64,7 @@ void srv_archive(const char *direction, const char *url, xs_dict *req, | |||
| 64 | const char *body, int b_size); | 64 | const char *body, int b_size); |
| 65 | void srv_archive_error(const char *prefix, const xs_str *err, | 65 | void srv_archive_error(const char *prefix, const xs_str *err, |
| 66 | const xs_dict *req, const xs_val *data); | 66 | const xs_dict *req, const xs_val *data); |
| 67 | void srv_archive_qitem(xs_dict *q_item); | ||
| 67 | 68 | ||
| 68 | double mtime_nl(const char *fn, int *n_link); | 69 | double mtime_nl(const char *fn, int *n_link); |
| 69 | #define mtime(fn) mtime_nl(fn, NULL) | 70 | #define mtime(fn) mtime_nl(fn, NULL) |