diff options
Diffstat (limited to 'mastoapi.c')
| -rw-r--r-- | mastoapi.c | 25 |
1 files changed, 7 insertions, 18 deletions
| @@ -1500,24 +1500,9 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1500 | if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0) | 1500 | if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0) |
| 1501 | continue; | 1501 | continue; |
| 1502 | 1502 | ||
| 1503 | /* discard private users */ | 1503 | /* discard messages from private users */ |
| 1504 | { | 1504 | if (is_msg_from_private_user(msg)) |
| 1505 | const char *atto = get_atto(msg); | 1505 | continue; |
| 1506 | xs *l = xs_split(atto, "/"); | ||
| 1507 | const char *uid = xs_list_get(l, -1); | ||
| 1508 | snac p_user; | ||
| 1509 | int skip = 1; | ||
| 1510 | |||
| 1511 | if (uid && user_open(&p_user, uid)) { | ||
| 1512 | if (xs_type(xs_dict_get(p_user.config, "private")) != XSTYPE_TRUE) | ||
| 1513 | skip = 0; | ||
| 1514 | |||
| 1515 | user_free(&p_user); | ||
| 1516 | } | ||
| 1517 | |||
| 1518 | if (skip) | ||
| 1519 | continue; | ||
| 1520 | } | ||
| 1521 | 1506 | ||
| 1522 | /* convert the Note into a Mastodon status */ | 1507 | /* convert the Note into a Mastodon status */ |
| 1523 | xs *st = mastoapi_status(user, msg); | 1508 | xs *st = mastoapi_status(user, msg); |
| @@ -1564,6 +1549,10 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, | |||
| 1564 | if (!is_msg_public(msg)) | 1549 | if (!is_msg_public(msg)) |
| 1565 | continue; | 1550 | continue; |
| 1566 | 1551 | ||
| 1552 | /* discard messages from private users */ | ||
| 1553 | if (is_msg_from_private_user(msg)) | ||
| 1554 | continue; | ||
| 1555 | |||
| 1567 | /* convert the Note into a Mastodon status */ | 1556 | /* convert the Note into a Mastodon status */ |
| 1568 | xs *st = mastoapi_status(NULL, msg); | 1557 | xs *st = mastoapi_status(NULL, msg); |
| 1569 | 1558 | ||