Started support for Peertube's Video object.

This commit is contained in:
default 2024-01-14 18:41:09 +01:00
parent ee0c6386cc
commit 5b0fa0a656

View file

@ -1553,7 +1553,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
type = "Note"; type = "Note";
/* reject uninteresting messages right now */ /* reject uninteresting messages right now */
if (strcmp(type, "Add") == 0) { if (xs_match(type, "Add|View")) {
srv_debug(0, xs_fmt("Ignored message of type '%s'", type)); srv_debug(0, xs_fmt("Ignored message of type '%s'", type));
return -1; return -1;
} }
@ -1822,17 +1822,17 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
snac_log(snac, xs_fmt("updated actor %s", actor)); snac_log(snac, xs_fmt("updated actor %s", actor));
} }
else else
if (xs_match(utype, "Note|Page|Article")) { /** **/ if (xs_match(utype, "Note|Page|Article|Video")) { /** **/
const char *id = xs_dict_get(object, "id"); const char *id = xs_dict_get(object, "id");
if (object_here(id)) { if (object_here(id)) {
object_add_ow(id, object); object_add_ow(id, object);
timeline_touch(snac); timeline_touch(snac);
snac_log(snac, xs_fmt("updated post %s", id)); snac_log(snac, xs_fmt("updated '%s' %s", utype, id));
} }
else else
snac_log(snac, xs_fmt("dropped update for unknown post %s", id)); snac_log(snac, xs_fmt("dropped update for unknown '%s' %s", utype, id));
} }
else else
if (strcmp(utype, "Question") == 0) { /** **/ if (strcmp(utype, "Question") == 0) { /** **/
@ -1847,9 +1847,12 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
if (closed != NULL) if (closed != NULL)
do_notify = 1; do_notify = 1;
} }
else else {
srv_archive_error("unsupported_update", "unsupported_update", req, msg);
snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype)); snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype));
} }
}
else else
if (strcmp(type, "Delete") == 0) { /** **/ if (strcmp(type, "Delete") == 0) { /** **/
if (xs_type(object) == XSTYPE_DICT) if (xs_type(object) == XSTYPE_DICT)
@ -1874,8 +1877,11 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
enqueue_output_by_actor(snac, rsp, actor, 0); enqueue_output_by_actor(snac, rsp, actor, 0);
} }
else else {
srv_archive_error("unsupported_type", "unsupported_type", req, msg);
snac_debug(snac, 1, xs_fmt("process_input_message type '%s' ignored", type)); snac_debug(snac, 1, xs_fmt("process_input_message type '%s' ignored", type));
}
if (do_notify) { if (do_notify) {
notify(snac, type, utype, actor, msg); notify(snac, type, utype, actor, msg);