summaryrefslogtreecommitdiff
path: root/mastoapi.c
diff options
context:
space:
mode:
Diffstat (limited to 'mastoapi.c')
-rw-r--r--mastoapi.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/mastoapi.c b/mastoapi.c
index a81e86e..a9e8aa8 100644
--- a/mastoapi.c
+++ b/mastoapi.c
@@ -701,7 +701,7 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
701/* converts an ActivityPub note to a Mastodon status */ 701/* converts an ActivityPub note to a Mastodon status */
702{ 702{
703 xs *actor = NULL; 703 xs *actor = NULL;
704 actor_get(xs_dict_get(msg, "attributedTo"), &actor); 704 actor_get(get_atto(msg), &actor);
705 705
706 /* if the author is not here, discard */ 706 /* if the author is not here, discard */
707 if (actor == NULL) 707 if (actor == NULL)
@@ -967,7 +967,7 @@ xs_dict *mastoapi_status(snac *snac, const xs_dict *msg)
967 st = xs_dict_set(st, "in_reply_to_id", irt_mid); 967 st = xs_dict_set(st, "in_reply_to_id", irt_mid);
968 968
969 char *at = NULL; 969 char *at = NULL;
970 if (!xs_is_null(at = xs_dict_get(irto, "attributedTo"))) { 970 if (!xs_is_null(at = get_atto(irto))) {
971 xs *at_md5 = xs_md5_hex(at, strlen(at)); 971 xs *at_md5 = xs_md5_hex(at, strlen(at));
972 st = xs_dict_set(st, "in_reply_to_account_id", at_md5); 972 st = xs_dict_set(st, "in_reply_to_account_id", at_md5);
973 } 973 }
@@ -1443,7 +1443,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
1443 from = xs_dict_get(msg, "audience"); 1443 from = xs_dict_get(msg, "audience");
1444 1444
1445 if (from == NULL) 1445 if (from == NULL)
1446 from = xs_dict_get(msg, "attributedTo"); 1446 from = get_atto(msg);
1447 1447
1448 if (from == NULL) 1448 if (from == NULL)
1449 continue; 1449 continue;
@@ -1525,7 +1525,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
1525 1525
1526 /* discard private users */ 1526 /* discard private users */
1527 { 1527 {
1528 const char *atto = xs_dict_get(msg, "attributedTo"); 1528 const char *atto = get_atto(msg);
1529 xs *l = xs_split(atto, "/"); 1529 xs *l = xs_split(atto, "/");
1530 const char *uid = xs_list_get(l, -1); 1530 const char *uid = xs_list_get(l, -1);
1531 snac p_user; 1531 snac p_user;
@@ -1825,7 +1825,7 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
1825 1825
1826 if (valid_status(object_get_by_md5(id, &msg))) { 1826 if (valid_status(object_get_by_md5(id, &msg))) {
1827 if (op == NULL) { 1827 if (op == NULL) {
1828 if (!is_muted(&snac1, xs_dict_get(msg, "attributedTo"))) { 1828 if (!is_muted(&snac1, get_atto(msg))) {
1829 /* return the status itself */ 1829 /* return the status itself */
1830 out = mastoapi_status(&snac1, msg); 1830 out = mastoapi_status(&snac1, msg);
1831 } 1831 }
@@ -2435,7 +2435,7 @@ int mastoapi_post_handler(const xs_dict *req, const char *q_path,
2435 2435
2436 if (valid_status(timeline_get_by_md5(&snac, mid, &msg))) { 2436 if (valid_status(timeline_get_by_md5(&snac, mid, &msg))) {
2437 const char *id = xs_dict_get(msg, "id"); 2437 const char *id = xs_dict_get(msg, "id");
2438 const char *atto = xs_dict_get(msg, "attributedTo"); 2438 const char *atto = get_atto(msg);
2439 2439
2440 xs_list *opts = xs_dict_get(msg, "oneOf"); 2440 xs_list *opts = xs_dict_get(msg, "oneOf");
2441 if (opts == NULL) 2441 if (opts == NULL)