snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 34349112f6bfa6a7a25f778d2eabfa2b0aa00f9e
parent ada3e978c5d8ba16e15c0ee081f4c1a4b703195c
Author: default <nobody@localhost>
Date:   Tue, 20 Feb 2024 05:31:34 +0100

New verify_links q_item.

Diffstat:
Mactivitypub.c | 4++++
Mdata.c | 13+++++++++++++
Msnac.h | 1+
3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/activitypub.c b/activitypub.c @@ -2192,6 +2192,10 @@ void process_user_queue_item(snac *snac, xs_dict *q_item) 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 @@ -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 @@ -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);