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, if (strcmp(type, "Note") != 0 && strcmp(type, "Question") != 0) continue; - /* discard private users */ - { - const char *atto = get_atto(msg); - xs *l = xs_split(atto, "/"); - const char *uid = xs_list_get(l, -1); - snac p_user; - int skip = 1; - - if (uid && user_open(&p_user, uid)) { - if (xs_type(xs_dict_get(p_user.config, "private")) != XSTYPE_TRUE) - skip = 0; - - user_free(&p_user); - } - - if (skip) - continue; - } + /* discard messages from private users */ + if (is_msg_from_private_user(msg)) + continue; /* convert the Note into a Mastodon status */ xs *st = mastoapi_status(user, msg); @@ -1564,6 +1549,10 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path, if (!is_msg_public(msg)) continue; + /* discard messages from private users */ + if (is_msg_from_private_user(msg)) + continue; + /* convert the Note into a Mastodon status */ xs *st = mastoapi_status(NULL, msg); |