summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/activitypub.c b/activitypub.c
index 27f9c7c..15937c3 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -1058,8 +1058,10 @@ int update_question(snac *user, const char *id)
xs *now = xs_str_utctime(0, ISO_DATE_SPEC);
/* it's now greater than the endTime? */
- if (strcmp(now, end_time) > 0)
- msg = xs_dict_set(msg, "closed", end_time);
+ if (strcmp(now, end_time) > 0) {
+ xs *et = xs_dup(end_time);
+ msg = xs_dict_set(msg, "closed", et);
+ }
}
/* update the count of voters */
@@ -1541,6 +1543,14 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
}
}
else
+ if (strcmp(type, "close_question") == 0) {
+ /* the time for this question has ended */
+ const char *id = xs_dict_get(q_item, "message");
+
+ if (!xs_is_null(id))
+ update_question(snac, id);
+ }
+ else
snac_log(snac, xs_fmt("unexpected q_item type '%s'", type));
}