summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-05-15 13:36:59 +0200
committerdefault <nobody@localhost>2024-05-15 13:36:59 +0200
commite7fa6d992061b04038128320acef4c894ae69500 (patch)
tree1714047f9d98d51d352c2d24b333fcef115b5d93 /data.c
parent0a6df8e504569be4caf39930c473f12b328e5b2a (diff)
Skip hidden posts in content_search().
Diffstat (limited to 'data.c')
-rw-r--r--data.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/data.c b/data.c
index 5abbeaf..0cceefd 100644
--- a/data.c
+++ b/data.c
@@ -2381,6 +2381,11 @@ xs_list *content_search(snac *user, const char *regex,
if (!xs_match(xs_dict_get_def(post, "type", "-"), POSTLIKE_OBJECT_TYPE))
continue;
+ const char *id = xs_dict_get(post, "id");
+
+ if (id == NULL || is_hidden(user, id))
+ continue;
+
char *content = xs_dict_get(post, "content");
if (xs_is_null(content))