From 32f31e490b028ee6e9d9c4fc8706bba31e11aa88 Mon Sep 17 00:00:00 2001 From: default Date: Tue, 30 May 2023 06:12:10 +0200 Subject: [PATCH] Log when a poll is closed. --- activitypub.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/activitypub.c b/activitypub.c index 62d4cda..c29a14b 100644 --- a/activitypub.c +++ b/activitypub.c @@ -1399,7 +1399,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req) } else if (strcmp(utype, "Note") == 0) { - char *id = xs_dict_get(object, "id"); + const char *id = xs_dict_get(object, "id"); object_add_ow(id, object); timeline_touch(snac); @@ -1408,12 +1408,13 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req) } else if (strcmp(utype, "Question") == 0) { - char *id = xs_dict_get(object, "id"); + const char *id = xs_dict_get(object, "id"); + const char *closed = xs_dict_get(object, "closed"); object_add_ow(id, object); timeline_touch(snac); - snac_log(snac, xs_fmt("updated poll %s", id)); + snac_log(snac, xs_fmt("%s poll %s", closed == NULL ? "updated" : "closed", id)); } else snac_log(snac, xs_fmt("ignored 'Update' for object type '%s'", utype));