diff options
author | default <nobody@localhost> | 2023-06-07 12:04:59 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2023-06-07 12:04:59 +0200 |
commit | ecde1c219e583d45e5ef46dcdd82c24b888fef1b (patch) | |
tree | ef3861be55944b489151d045efaec61ae4c41713 /activitypub.c | |
parent | e926fa23098f594b52d560f20043fd1a47329848 (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 'activitypub.c')
-rw-r--r-- | activitypub.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/activitypub.c b/activitypub.c index f9e7077..10e0e64 100644 --- a/activitypub.c +++ b/activitypub.c @@ -143,8 +143,6 @@ int actor_request(snac *snac, const char *actor, xs_dict **data) } -void timeline_request_replies(snac *user, const char *id); - int timeline_request(snac *snac, char **id, xs_str **wrk) /* ensures that an entry and its ancestors are in the timeline */ { @@ -191,7 +189,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk) } } - timeline_request_replies(snac, *id); + enqueue_request_replies(snac, *id); } return status; @@ -1679,7 +1677,14 @@ void process_user_queue_item(snac *snac, xs_dict *q_item) update_question(snac, id); } else - snac_log(snac, xs_fmt("unexpected q_item type '%s'", type)); + if (strcmp(type, "request_replies") == 0) { + const char *id = xs_dict_get(q_item, "message"); + + if (!xs_is_null(id)) + timeline_request_replies(snac, id); + } + else + snac_log(snac, xs_fmt("unexpected user q_item type '%s'", type)); } |