From 34349112f6bfa6a7a25f778d2eabfa2b0aa00f9e Mon Sep 17 00:00:00 2001 From: default Date: Tue, 20 Feb 2024 05:31:34 +0100 Subject: [PATCH] New verify_links q_item. --- activitypub.c | 4 ++++ data.c | 13 +++++++++++++ snac.h | 1 + 3 files changed, 18 insertions(+) diff --git a/activitypub.c b/activitypub.c index bd0efd4..e389915 100644 --- a/activitypub.c +++ b/activitypub.c @@ -2191,6 +2191,10 @@ void process_user_queue_item(snac *snac, xs_dict *q_item) if (!xs_is_null(id)) timeline_request_replies(snac, id); } + else + if (strcmp(type, "verify_links") == 0) { + verify_links(snac); + } else snac_log(snac, xs_fmt("unexpected user q_item type '%s'", type)); } diff --git a/data.c b/data.c index e35a5dd..e0a2d82 100644 --- a/data.c +++ b/data.c @@ -2365,6 +2365,19 @@ void enqueue_close_question(snac *user, const char *id, int end_secs) } +void enqueue_verify_links(snac *user) +/* enqueues a link verification */ +{ + xs *qmsg = _new_qmsg("verify_links", "", 0); + char *ntid = xs_dict_get(qmsg, "ntid"); + xs *fn = xs_fmt("%s/queue/%s.json", user->basedir, ntid); + + qmsg = _enqueue_put(fn, qmsg); + + snac_debug(user, 0, xs_fmt("enqueue_verify_links %s", user->actor)); +} + + void enqueue_request_replies(snac *user, const char *id) /* enqueues a request for the replies of a message */ { diff --git a/snac.h b/snac.h index a4b45d0..8de3a83 100644 --- a/snac.h +++ b/snac.h @@ -211,6 +211,7 @@ void enqueue_telegram(const xs_str *msg, const char *bot, const char *chat_id); void enqueue_ntfy(const xs_str *msg, const char *ntfy_server, const char *ntfy_token); void enqueue_message(snac *snac, const xs_dict *msg); void enqueue_close_question(snac *user, const char *id, int end_secs); +void enqueue_verify_links(snac *user); void enqueue_request_replies(snac *user, const char *id); int was_question_voted(snac *user, const char *id);