summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-06-07 12:04:59 +0200
committerdefault <nobody@localhost>2023-06-07 12:04:59 +0200
commitecde1c219e583d45e5ef46dcdd82c24b888fef1b (patch)
treeef3861be55944b489151d045efaec61ae4c41713 /data.c
parente926fa23098f594b52d560f20043fd1a47329848 (diff)
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.
Diffstat (limited to 'data.c')
-rw-r--r--data.c13
1 files changed, 13 insertions, 0 deletions
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 */
{