浏览代码

Added a way to archive ignored messages.

default 1 年之前
父节点
当前提交
c25360468c
共有 1 个文件被更改,包括 11 次插入0 次删除
  1. 11 0
      activitypub.c

+ 11 - 0
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;
     }