summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-05-24 09:43:11 +0200
committerdefault <nobody@localhost>2023-05-24 09:43:11 +0200
commita73636f671045daec1feee6ba521434b3549c595 (patch)
tree220e5faa794b7968b83d348f9d47a9dd414945e9
parentadcdb28b6f9ca3e21681f3503538df86ae949d1d (diff)
Questions (polls) are now stored (but not yet shown).
-rw-r--r--activitypub.c36
1 files changed, 25 insertions, 11 deletions
diff --git a/activitypub.c b/activitypub.c
index 406aee8..8a91f6a 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1135,23 +1135,29 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
}
else
if (strcmp(type, "Create") == 0) {
+ if (is_muted(snac, actor))
+ snac_log(snac, xs_fmt("ignored 'Create' + '%s' from muted actor %s", utype, actor));
+
if (strcmp(utype, "Note") == 0) {
- if (is_muted(snac, actor))
- snac_log(snac, xs_fmt("ignored 'Note' from muted actor %s", actor));
- else {
- char *id = xs_dict_get(object, "id");
- char *in_reply_to = xs_dict_get(object, "inReplyTo");
- xs *wrk = NULL;
+ char *id = xs_dict_get(object, "id");
+ char *in_reply_to = xs_dict_get(object, "inReplyTo");
+ xs *wrk = NULL;
- timeline_request(snac, &in_reply_to, &wrk);
+ timeline_request(snac, &in_reply_to, &wrk);
- if (timeline_add(snac, id, object)) {
- snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id));
- do_notify = 1;
- }
+ if (timeline_add(snac, id, object)) {
+ snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id));
+ do_notify = 1;
}
}
else
+ if (strcmp(utype, "Question") == 0) {
+ char *id = xs_dict_get(object, "id");
+
+ if (timeline_add(snac, id, object))
+ snac_log(snac, xs_fmt("new 'Question' %s %s", actor, id));
+ }
+ else
snac_debug(snac, 1, xs_fmt("ignored 'Create' for object type '%s'", utype));
}
else
@@ -1223,6 +1229,14 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
snac_log(snac, xs_fmt("updated post %s", id));
}
else
+ if (strcmp(utype, "Question") == 0) {
+ char *id = xs_dict_get(object, "id");
+
+ object_add_ow(id, object);
+
+ snac_log(snac, xs_fmt("updated poll %s", id));
+ }
+ else
snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype));
}
else