commit c253604

default  ·  2025-01-09 17:37:09 +0000 UTC
parent 74cd356
Added a way to archive ignored messages.
1 files changed,  +11, -0
+11, -0
 1@@ -1853,6 +1853,17 @@ int process_input_message(snac *snac, const xs_dict *msg, const xs_dict *req)
 2     /* reject uninteresting messages right now */
 3     if (xs_match(type, "Add|View|Reject|Read|Remove")) {
 4         srv_debug(0, xs_fmt("Ignored message of type '%s'", type));
 5+
 6+        /* archive the ignored activity */
 7+        xs *ntid = tid(0);
 8+        xs *fn = xs_fmt("%s/ignored/%s.json", srv_basedir, ntid);
 9+        FILE *f;
10+
11+        if ((f = fopen(fn, "w")) != NULL) {
12+            xs_json_dump(msg, 4, f);
13+            fclose(f);
14+        }
15+
16         return -1;
17     }
18