commit 5b0fa0a

default  ·  2024-01-14 17:41:09 +0000 UTC
parent ee0c638
Started support for Peertube's Video object.
1 files changed,  +12, -6
+12, -6
 1@@ -1553,7 +1553,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
 2         type = "Note";
 3 
 4     /* reject uninteresting messages right now */
 5-    if (strcmp(type, "Add") == 0) {
 6+    if (xs_match(type, "Add|View")) {
 7         srv_debug(0, xs_fmt("Ignored message of type '%s'", type));
 8         return -1;
 9     }
10@@ -1822,17 +1822,17 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
11             snac_log(snac, xs_fmt("updated actor %s", actor));
12         }
13         else
14-        if (xs_match(utype, "Note|Page|Article")) { /** **/
15+        if (xs_match(utype, "Note|Page|Article|Video")) { /** **/
16             const char *id = xs_dict_get(object, "id");
17 
18             if (object_here(id)) {
19                 object_add_ow(id, object);
20                 timeline_touch(snac);
21 
22-                snac_log(snac, xs_fmt("updated post %s", id));
23+                snac_log(snac, xs_fmt("updated '%s' %s", utype, id));
24             }
25             else
26-                snac_log(snac, xs_fmt("dropped update for unknown post %s", id));
27+                snac_log(snac, xs_fmt("dropped update for unknown '%s' %s", utype, id));
28         }
29         else
30         if (strcmp(utype, "Question") == 0) { /** **/
31@@ -1847,8 +1847,11 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
32             if (closed != NULL)
33                 do_notify = 1;
34         }
35-        else
36+        else {
37+            srv_archive_error("unsupported_update", "unsupported_update", req, msg);
38+
39             snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype));
40+        }
41     }
42     else
43     if (strcmp(type, "Delete") == 0) { /** **/
44@@ -1874,8 +1877,11 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
45 
46         enqueue_output_by_actor(snac, rsp, actor, 0);
47     }
48-    else
49+    else {
50+        srv_archive_error("unsupported_type", "unsupported_type", req, msg);
51+
52         snac_debug(snac, 1, xs_fmt("process_input_message type '%s' ignored", type));
53+    }
54 
55     if (do_notify) {
56         notify(snac, type, utype, actor, msg);