summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2023-06-07 12:04:59 +0200
committerGravatar default2023-06-07 12:04:59 +0200
commitecde1c219e583d45e5ef46dcdd82c24b888fef1b (patch)
treeef3861be55944b489151d045efaec61ae4c41713 /activitypub.c
parentChanged timeline_request_replies() to receive an id and not an object. (diff)
downloadsnac2-ecde1c219e583d45e5ef46dcdd82c24b888fef1b.tar.gz
snac2-ecde1c219e583d45e5ef46dcdd82c24b888fef1b.tar.xz
snac2-ecde1c219e583d45e5ef46dcdd82c24b888fef1b.zip
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.c13
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)
143} 143}
144 144
145 145
146void timeline_request_replies(snac *user, const char *id);
147
148int timeline_request(snac *snac, char **id, xs_str **wrk) 146int timeline_request(snac *snac, char **id, xs_str **wrk)
149/* ensures that an entry and its ancestors are in the timeline */ 147/* ensures that an entry and its ancestors are in the timeline */
150{ 148{
@@ -191,7 +189,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk)
191 } 189 }
192 } 190 }
193 191
194 timeline_request_replies(snac, *id); 192 enqueue_request_replies(snac, *id);
195 } 193 }
196 194
197 return status; 195 return status;
@@ -1679,7 +1677,14 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
1679 update_question(snac, id); 1677 update_question(snac, id);
1680 } 1678 }
1681 else 1679 else
1682 snac_log(snac, xs_fmt("unexpected q_item type '%s'", type)); 1680 if (strcmp(type, "request_replies") == 0) {
1681 const char *id = xs_dict_get(q_item, "message");
1682
1683 if (!xs_is_null(id))
1684 timeline_request_replies(snac, id);
1685 }
1686 else
1687 snac_log(snac, xs_fmt("unexpected user q_item type '%s'", type));
1683} 1688}
1684 1689
1685 1690