From ecde1c219e583d45e5ef46dcdd82c24b888fef1b Mon Sep 17 00:00:00 2001 From: default Date: Wed, 7 Jun 2023 12:04:59 +0200 Subject: New function enqueue_request_replies(). This way, the (potentially expensive and slow) call to timeline_request_replies() is detached from actions like replying a message from the web ui. --- data.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'data.c') diff --git a/data.c b/data.c index 27f62a9..8da0888 100644 --- a/data.c +++ b/data.c @@ -1935,6 +1935,19 @@ void enqueue_close_question(snac *user, const char *id, int end_secs) } +void enqueue_request_replies(snac *user, const char *id) +/* enqueues a request for the replies of a message */ +{ + xs *qmsg = _new_qmsg("request_replies", id, 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_request_replies %s", id)); +} + + int was_question_voted(snac *user, const char *id) /* returns true if the user voted in this poll */ { -- cgit v1.2.3