New verify_links q_item.

This commit is contained in:
default 2024-02-20 05:31:34 +01:00
parent ada3e978c5
commit 34349112f6
3 changed files with 18 additions and 0 deletions

View file

@ -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));
}

13
data.c
View file

@ -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 */
{

1
snac.h
View file

@ -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);