diff options
| author | 2025-05-03 19:16:21 +0200 | |
|---|---|---|
| committer | 2025-05-03 19:16:21 +0200 | |
| commit | 605b60c06ea882cd61df7f2d834c02cce6dd254d (patch) | |
| tree | c56a85ff869ce1d2db6e523f87c33023ea272146 | |
| parent | Revert adding links as attachments. (diff) | |
| download | penes-snac2-605b60c06ea882cd61df7f2d834c02cce6dd254d.tar.gz penes-snac2-605b60c06ea882cd61df7f2d834c02cce6dd254d.tar.xz penes-snac2-605b60c06ea882cd61df7f2d834c02cce6dd254d.zip | |
New function enqueue_webmention().
The q_msg is queued, but nothing is done yet.
| -rw-r--r-- | data.c | 13 | ||||
| -rw-r--r-- | html.c | 4 | ||||
| -rw-r--r-- | main.c | 1 | ||||
| -rw-r--r-- | snac.h | 1 |
4 files changed, 18 insertions, 1 deletions
| @@ -3473,6 +3473,19 @@ void enqueue_actor_refresh(snac *user, const char *actor, int forward_secs) | |||
| 3473 | } | 3473 | } |
| 3474 | 3474 | ||
| 3475 | 3475 | ||
| 3476 | void enqueue_webmention(const xs_dict *msg) | ||
| 3477 | /* enqueues a webmention for the post */ | ||
| 3478 | { | ||
| 3479 | xs *qmsg = _new_qmsg("webmention", msg, 0); | ||
| 3480 | const char *ntid = xs_dict_get(qmsg, "ntid"); | ||
| 3481 | xs *fn = xs_fmt("%s/queue/%s.json", srv_basedir, ntid); | ||
| 3482 | |||
| 3483 | qmsg = _enqueue_put(fn, qmsg); | ||
| 3484 | |||
| 3485 | srv_debug(1, xs_fmt("enqueue_webmention")); | ||
| 3486 | } | ||
| 3487 | |||
| 3488 | |||
| 3476 | int was_question_voted(snac *user, const char *id) | 3489 | int was_question_voted(snac *user, const char *id) |
| 3477 | /* returns true if the user voted in this poll */ | 3490 | /* returns true if the user voted in this poll */ |
| 3478 | { | 3491 | { |
| @@ -4488,8 +4488,10 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 4488 | snac_log(&snac, xs_fmt("cannot get object '%s' for editing", edit_id)); | 4488 | snac_log(&snac, xs_fmt("cannot get object '%s' for editing", edit_id)); |
| 4489 | } | 4489 | } |
| 4490 | 4490 | ||
| 4491 | if (c_msg != NULL) | 4491 | if (c_msg != NULL) { |
| 4492 | enqueue_message(&snac, c_msg); | 4492 | enqueue_message(&snac, c_msg); |
| 4493 | enqueue_webmention(msg); | ||
| 4494 | } | ||
| 4493 | 4495 | ||
| 4494 | history_del(&snac, "timeline.html_"); | 4496 | history_del(&snac, "timeline.html_"); |
| 4495 | } | 4497 | } |
| @@ -830,6 +830,7 @@ int main(int argc, char *argv[]) | |||
| 830 | } | 830 | } |
| 831 | 831 | ||
| 832 | enqueue_message(&snac, c_msg); | 832 | enqueue_message(&snac, c_msg); |
| 833 | enqueue_webmention(msg); | ||
| 833 | 834 | ||
| 834 | timeline_add(&snac, xs_dict_get(msg, "id"), msg); | 835 | timeline_add(&snac, xs_dict_get(msg, "id"), msg); |
| 835 | 836 | ||
| @@ -289,6 +289,7 @@ void enqueue_close_question(snac *user, const char *id, int end_secs); | |||
| 289 | void enqueue_object_request(snac *user, const char *id, int forward_secs); | 289 | void enqueue_object_request(snac *user, const char *id, int forward_secs); |
| 290 | void enqueue_verify_links(snac *user); | 290 | void enqueue_verify_links(snac *user); |
| 291 | void enqueue_actor_refresh(snac *user, const char *actor, int forward_secs); | 291 | void enqueue_actor_refresh(snac *user, const char *actor, int forward_secs); |
| 292 | void enqueue_webmention(const xs_dict *msg); | ||
| 292 | int was_question_voted(snac *user, const char *id); | 293 | int was_question_voted(snac *user, const char *id); |
| 293 | 294 | ||
| 294 | xs_list *user_queue(snac *snac); | 295 | xs_list *user_queue(snac *snac); |