commit 25acaf1
default
·
2022-12-16 06:16:00 +0000 UTC
parent 427f734
Replaced all calls to post() with enqueue_message().
4 files changed,
+9,
-9
+1,
-1
1@@ -827,7 +827,7 @@ int process_message(snac *snac, char *msg, char *req)
2 xs *f_msg = xs_dup(msg);
3 xs *reply = msg_accept(snac, f_msg, actor);
4
5- post(snac, reply);
6+ enqueue_message(snac, reply);
7
8 if (xs_is_null(xs_dict_get(f_msg, "published"))) {
9 /* add a date if it doesn't include one (Mastodon) */
M
data.c
+1,
-1
1@@ -1397,7 +1397,7 @@ void enqueue_message(snac *snac, char *msg)
2
3 _enqueue_put(fn, qmsg);
4
5- snac_debug(snac, 1, xs_fmt("enqueue_message %s", id));
6+ snac_debug(snac, 0, xs_fmt("enqueue_message %s", id));
7 }
8
9
M
html.c
+5,
-5
1@@ -1320,7 +1320,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
2
3 c_msg = msg_create(&snac, msg);
4
5- post(&snac, c_msg);
6+ enqueue_message(&snac, c_msg);
7
8 timeline_add(&snac, xs_dict_get(msg, "id"), msg, in_reply_to, NULL);
9 }
10@@ -1345,7 +1345,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
11 xs *msg = msg_admiration(&snac, id, "Like");
12
13 if (msg != NULL) {
14- post(&snac, msg);
15+ enqueue_message(&snac, msg);
16 timeline_admire(&snac, msg, id, snac.actor, 1);
17 }
18 }
19@@ -1354,7 +1354,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
20 xs *msg = msg_admiration(&snac, id, "Announce");
21
22 if (msg != NULL) {
23- post(&snac, msg);
24+ enqueue_message(&snac, msg);
25 timeline_admire(&snac, msg, id, snac.actor, 0);
26 }
27 }
28@@ -1407,7 +1407,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
29 /* it's a post by us: generate a delete */
30 xs *msg = msg_delete(&snac, id);
31
32- post(&snac, msg);
33+ enqueue_message(&snac, msg);
34
35 /* FIXME: also post this Tombstone to people
36 that Announce'd it */
37@@ -1474,7 +1474,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size,
38 xs *a_msg = msg_actor(&snac);
39 xs *u_msg = msg_update(&snac, a_msg);
40
41- post(&snac, u_msg);
42+ enqueue_message(&snac, u_msg);
43
44 status = 303;
45 }
M
main.c
+2,
-2
1@@ -175,7 +175,7 @@ int main(int argc, char *argv[])
2 xs *msg = msg_admiration(&snac, url, "Announce");
3
4 if (msg != NULL) {
5- post(&snac, msg);
6+ enqueue_message(&snac, msg);
7
8 if (dbglevel) {
9 xs *j = xs_json_dumps_pp(msg, 4);
10@@ -290,7 +290,7 @@ int main(int argc, char *argv[])
11 printf("%s\n", j);
12 }
13
14- post(&snac, c_msg);
15+ enqueue_message(&snac, c_msg);
16
17 timeline_add(&snac, xs_dict_get(msg, "id"), msg, in_reply_to, NULL);
18