summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--activitypub.c6
-rw-r--r--data.c13
-rw-r--r--main.c2
-rw-r--r--snac.h1
4 files changed, 21 insertions, 1 deletions
diff --git a/activitypub.c b/activitypub.c
index a375584..065fbcd 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2915,6 +2915,12 @@ void process_user_queue_item(snac *user, xs_dict *q_item)
2915 } 2915 }
2916 } 2916 }
2917 else 2917 else
2918 if (strcmp(type, "collect_replies") == 0) {
2919 const char *post = xs_dict_get(q_item, "message");
2920
2921 collect_replies(user, post);
2922 }
2923 else
2918 snac_log(user, xs_fmt("unexpected user q_item type '%s'", type)); 2924 snac_log(user, xs_fmt("unexpected user q_item type '%s'", type));
2919} 2925}
2920 2926
diff --git a/data.c b/data.c
index 70bd031..ca5e3ed 100644
--- a/data.c
+++ b/data.c
@@ -3576,6 +3576,19 @@ void enqueue_notify_webhook(snac *user, const xs_dict *noti, int retries)
3576} 3576}
3577 3577
3578 3578
3579void enqueue_collect_replies(snac *user, const char *post)
3580/* enqueues a collect replies request */
3581{
3582 xs *qmsg = _new_qmsg("collect_replies", post, 0);
3583 const char *ntid = xs_dict_get(qmsg, "ntid");
3584 xs *fn = xs_fmt("%s/queue/%s.json", user->basedir, ntid);
3585
3586 qmsg = _enqueue_put(fn, qmsg);
3587
3588 snac_debug(user, 1, xs_fmt("enqueue_collect_replies %s", post));
3589}
3590
3591
3579int was_question_voted(snac *user, const char *id) 3592int was_question_voted(snac *user, const char *id)
3580/* returns true if the user voted in this poll */ 3593/* returns true if the user voted in this poll */
3581{ 3594{
diff --git a/main.c b/main.c
index 0a78489..e53bdf8 100644
--- a/main.c
+++ b/main.c
@@ -731,7 +731,7 @@ int main(int argc, char *argv[])
731 } 731 }
732 732
733 if (strcmp(cmd, "collect_replies") == 0) { /** **/ 733 if (strcmp(cmd, "collect_replies") == 0) { /** **/
734 collect_replies(&snac, url); 734 enqueue_collect_replies(&snac, url);
735 735
736 return 0; 736 return 0;
737 } 737 }
diff --git a/snac.h b/snac.h
index 82c4a98..363855f 100644
--- a/snac.h
+++ b/snac.h
@@ -297,6 +297,7 @@ void enqueue_verify_links(snac *user);
297void enqueue_actor_refresh(snac *user, const char *actor, int forward_secs); 297void enqueue_actor_refresh(snac *user, const char *actor, int forward_secs);
298void enqueue_webmention(const xs_dict *msg); 298void enqueue_webmention(const xs_dict *msg);
299void enqueue_notify_webhook(snac *user, const xs_dict *noti, int retries); 299void enqueue_notify_webhook(snac *user, const xs_dict *noti, int retries);
300void enqueue_collect_replies(snac *user, const char *post);
300 301
301int was_question_voted(snac *user, const char *id); 302int was_question_voted(snac *user, const char *id);
302 303