aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data.c13
-rw-r--r--html.c4
-rw-r--r--main.c1
-rw-r--r--snac.h1
4 files changed, 18 insertions, 1 deletions
diff --git a/data.c b/data.c
index 7d33f77..73332ef 100644
--- a/data.c
+++ b/data.c
@@ -3473,6 +3473,19 @@ void enqueue_actor_refresh(snac *user, const char *actor, int forward_secs)
}
+void enqueue_webmention(const xs_dict *msg)
+/* enqueues a webmention for the post */
+{
+ xs *qmsg = _new_qmsg("webmention", msg, 0);
+ const char *ntid = xs_dict_get(qmsg, "ntid");
+ xs *fn = xs_fmt("%s/queue/%s.json", srv_basedir, ntid);
+
+ qmsg = _enqueue_put(fn, qmsg);
+
+ srv_debug(1, xs_fmt("enqueue_webmention"));
+}
+
+
int was_question_voted(snac *user, const char *id)
/* returns true if the user voted in this poll */
{
diff --git a/html.c b/html.c
index 0652892..e114ea7 100644
--- a/html.c
+++ b/html.c
@@ -4488,8 +4488,10 @@ int html_post_handler(const xs_dict *req, const char *q_path,
snac_log(&snac, xs_fmt("cannot get object '%s' for editing", edit_id));
}
- if (c_msg != NULL)
+ if (c_msg != NULL) {
enqueue_message(&snac, c_msg);
+ enqueue_webmention(msg);
+ }
history_del(&snac, "timeline.html_");
}
diff --git a/main.c b/main.c
index a6fb6fd..80df2d0 100644
--- a/main.c
+++ b/main.c
@@ -830,6 +830,7 @@ int main(int argc, char *argv[])
}
enqueue_message(&snac, c_msg);
+ enqueue_webmention(msg);
timeline_add(&snac, xs_dict_get(msg, "id"), msg);
diff --git a/snac.h b/snac.h
index 06f9568..d9d0cfd 100644
--- a/snac.h
+++ b/snac.h
@@ -289,6 +289,7 @@ void enqueue_close_question(snac *user, const char *id, int end_secs);
void enqueue_object_request(snac *user, const char *id, int forward_secs);
void enqueue_verify_links(snac *user);
void enqueue_actor_refresh(snac *user, const char *actor, int forward_secs);
+void enqueue_webmention(const xs_dict *msg);
int was_question_voted(snac *user, const char *id);
xs_list *user_queue(snac *snac);