diff options
Diffstat (limited to 'html.c')
| -rw-r--r-- | html.c | 19 |
1 files changed, 19 insertions, 0 deletions
| @@ -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 | ||