diff options
| author | 2022-12-16 07:16:00 +0100 | |
|---|---|---|
| committer | 2022-12-16 07:16:00 +0100 | |
| commit | 25acaf178cc8a4112a5a150f5ee45bf69192cc0e (patch) | |
| tree | 84267c8d738e10a755d66e6c046fb5cc3ccbf99e | |
| parent | New function enqueue_message(). (diff) | |
| download | snac2-25acaf178cc8a4112a5a150f5ee45bf69192cc0e.tar.gz snac2-25acaf178cc8a4112a5a150f5ee45bf69192cc0e.tar.xz snac2-25acaf178cc8a4112a5a150f5ee45bf69192cc0e.zip | |
Replaced all calls to post() with enqueue_message().
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | data.c | 2 | ||||
| -rw-r--r-- | html.c | 10 | ||||
| -rw-r--r-- | main.c | 4 |
4 files changed, 9 insertions, 9 deletions
diff --git a/activitypub.c b/activitypub.c index 79ec98b..a193ac9 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -827,7 +827,7 @@ int process_message(snac *snac, char *msg, char *req) | |||
| 827 | xs *f_msg = xs_dup(msg); | 827 | xs *f_msg = xs_dup(msg); |
| 828 | xs *reply = msg_accept(snac, f_msg, actor); | 828 | xs *reply = msg_accept(snac, f_msg, actor); |
| 829 | 829 | ||
| 830 | post(snac, reply); | 830 | enqueue_message(snac, reply); |
| 831 | 831 | ||
| 832 | if (xs_is_null(xs_dict_get(f_msg, "published"))) { | 832 | if (xs_is_null(xs_dict_get(f_msg, "published"))) { |
| 833 | /* add a date if it doesn't include one (Mastodon) */ | 833 | /* add a date if it doesn't include one (Mastodon) */ |
| @@ -1397,7 +1397,7 @@ void enqueue_message(snac *snac, char *msg) | |||
| 1397 | 1397 | ||
| 1398 | _enqueue_put(fn, qmsg); | 1398 | _enqueue_put(fn, qmsg); |
| 1399 | 1399 | ||
| 1400 | snac_debug(snac, 1, xs_fmt("enqueue_message %s", id)); | 1400 | snac_debug(snac, 0, xs_fmt("enqueue_message %s", id)); |
| 1401 | } | 1401 | } |
| 1402 | 1402 | ||
| 1403 | 1403 | ||
| @@ -1320,7 +1320,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | |||
| 1320 | 1320 | ||
| 1321 | c_msg = msg_create(&snac, msg); | 1321 | c_msg = msg_create(&snac, msg); |
| 1322 | 1322 | ||
| 1323 | post(&snac, c_msg); | 1323 | enqueue_message(&snac, c_msg); |
| 1324 | 1324 | ||
| 1325 | timeline_add(&snac, xs_dict_get(msg, "id"), msg, in_reply_to, NULL); | 1325 | timeline_add(&snac, xs_dict_get(msg, "id"), msg, in_reply_to, NULL); |
| 1326 | } | 1326 | } |
| @@ -1345,7 +1345,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | |||
| 1345 | xs *msg = msg_admiration(&snac, id, "Like"); | 1345 | xs *msg = msg_admiration(&snac, id, "Like"); |
| 1346 | 1346 | ||
| 1347 | if (msg != NULL) { | 1347 | if (msg != NULL) { |
| 1348 | post(&snac, msg); | 1348 | enqueue_message(&snac, msg); |
| 1349 | timeline_admire(&snac, msg, id, snac.actor, 1); | 1349 | timeline_admire(&snac, msg, id, snac.actor, 1); |
| 1350 | } | 1350 | } |
| 1351 | } | 1351 | } |
| @@ -1354,7 +1354,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | |||
| 1354 | xs *msg = msg_admiration(&snac, id, "Announce"); | 1354 | xs *msg = msg_admiration(&snac, id, "Announce"); |
| 1355 | 1355 | ||
| 1356 | if (msg != NULL) { | 1356 | if (msg != NULL) { |
| 1357 | post(&snac, msg); | 1357 | enqueue_message(&snac, msg); |
| 1358 | timeline_admire(&snac, msg, id, snac.actor, 0); | 1358 | timeline_admire(&snac, msg, id, snac.actor, 0); |
| 1359 | } | 1359 | } |
| 1360 | } | 1360 | } |
| @@ -1407,7 +1407,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | |||
| 1407 | /* it's a post by us: generate a delete */ | 1407 | /* it's a post by us: generate a delete */ |
| 1408 | xs *msg = msg_delete(&snac, id); | 1408 | xs *msg = msg_delete(&snac, id); |
| 1409 | 1409 | ||
| 1410 | post(&snac, msg); | 1410 | enqueue_message(&snac, msg); |
| 1411 | 1411 | ||
| 1412 | /* FIXME: also post this Tombstone to people | 1412 | /* FIXME: also post this Tombstone to people |
| 1413 | that Announce'd it */ | 1413 | that Announce'd it */ |
| @@ -1474,7 +1474,7 @@ int html_post_handler(d_char *req, char *q_path, d_char *payload, int p_size, | |||
| 1474 | xs *a_msg = msg_actor(&snac); | 1474 | xs *a_msg = msg_actor(&snac); |
| 1475 | xs *u_msg = msg_update(&snac, a_msg); | 1475 | xs *u_msg = msg_update(&snac, a_msg); |
| 1476 | 1476 | ||
| 1477 | post(&snac, u_msg); | 1477 | enqueue_message(&snac, u_msg); |
| 1478 | 1478 | ||
| 1479 | status = 303; | 1479 | status = 303; |
| 1480 | } | 1480 | } |
| @@ -175,7 +175,7 @@ int main(int argc, char *argv[]) | |||
| 175 | xs *msg = msg_admiration(&snac, url, "Announce"); | 175 | xs *msg = msg_admiration(&snac, url, "Announce"); |
| 176 | 176 | ||
| 177 | if (msg != NULL) { | 177 | if (msg != NULL) { |
| 178 | post(&snac, msg); | 178 | enqueue_message(&snac, msg); |
| 179 | 179 | ||
| 180 | if (dbglevel) { | 180 | if (dbglevel) { |
| 181 | xs *j = xs_json_dumps_pp(msg, 4); | 181 | xs *j = xs_json_dumps_pp(msg, 4); |
| @@ -290,7 +290,7 @@ int main(int argc, char *argv[]) | |||
| 290 | printf("%s\n", j); | 290 | printf("%s\n", j); |
| 291 | } | 291 | } |
| 292 | 292 | ||
| 293 | post(&snac, c_msg); | 293 | enqueue_message(&snac, c_msg); |
| 294 | 294 | ||
| 295 | timeline_add(&snac, xs_dict_get(msg, "id"), msg, in_reply_to, NULL); | 295 | timeline_add(&snac, xs_dict_get(msg, "id"), msg, in_reply_to, NULL); |
| 296 | 296 | ||