summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar default2024-05-05 01:58:27 +0200
committerGravatar default2024-05-05 01:58:27 +0200
commitbe9cf2f5550f68ef4e86b547d7247a0bd498521d (patch)
tree107681587a33ea0cc61cb1ac2793abec71a0a522 /html.c
parentNew function enqueue_object_request(). (diff)
downloadpenes-snac2-be9cf2f5550f68ef4e86b547d7247a0bd498521d.tar.gz
penes-snac2-be9cf2f5550f68ef4e86b547d7247a0bd498521d.tar.xz
penes-snac2-be9cf2f5550f68ef4e86b547d7247a0bd498521d.zip
Enqueue an object request for closed polls.
It seems that Pleroma does not send poll updates on close (or never).
Diffstat (limited to 'html.c')
-rw-r--r--html.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/html.c b/html.c
index 45c665c..9de1cca 100644
--- a/html.c
+++ b/html.c
@@ -3300,6 +3300,25 @@ int html_post_handler(const xs_dict *req, const char *q_path,
3300 timeline_add(&snac, xs_dict_get(msg, "id"), msg); 3300 timeline_add(&snac, xs_dict_get(msg, "id"), msg);
3301 } 3301 }
3302 3302
3303 {
3304 /* get the poll object */
3305 xs *poll = NULL;
3306
3307 if (valid_status(object_get(irt, &poll))) {
3308 char *date = xs_dict_get(poll, "endTime");
3309 if (xs_is_null(date))
3310 date = xs_dict_get(poll, "closed");
3311
3312 if (!xs_is_null(date)) {
3313 time_t t = xs_parse_iso_date(date, 0) - time(NULL);
3314
3315 /* request the poll when it's closed;
3316 Pleroma does not send and update when the poll closes */
3317 enqueue_object_request(&snac, irt, t + 2);
3318 }
3319 }
3320 }
3321
3303 status = 303; 3322 status = 303;
3304 } 3323 }
3305 3324