diff options
| -rw-r--r-- | data.c | 2 | ||||
| -rw-r--r-- | html.c | 19 |
2 files changed, 20 insertions, 1 deletions
| @@ -2662,7 +2662,7 @@ void enqueue_object_request(snac *user, const char *id, int forward_secs) | |||
| 2662 | 2662 | ||
| 2663 | qmsg = _enqueue_put(fn, qmsg); | 2663 | qmsg = _enqueue_put(fn, qmsg); |
| 2664 | 2664 | ||
| 2665 | snac_debug(user, 0, xs_fmt("enqueue_object_request %s", id)); | 2665 | snac_debug(user, 0, xs_fmt("enqueue_object_request %s %d", id, forward_secs)); |
| 2666 | } | 2666 | } |
| 2667 | 2667 | ||
| 2668 | 2668 | ||
| @@ -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 | ||