diff options
author | default <nobody@localhost> | 2024-05-08 11:06:33 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2024-05-08 11:06:33 +0200 |
commit | 34c8968cfb0aaa14ed901115c1addd1886916b79 (patch) | |
tree | 23cc30c78da959f813f523fc254744e33c6ae69f /data.c | |
parent | 52ba7f030ed50f22b7fbf437e83c9415ed0e91ed (diff) |
Minor tweaks to content_search().
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 13 |
1 files changed, 5 insertions, 8 deletions
@@ -2491,7 +2491,7 @@ void notify_clear(snac *snac) /** searches **/ xs_list *content_search(snac *user, const xs_list *timeline, - const char *regex, int max_secs, int *timeout) + const char *regex, int max_secs, int *timeout) /* returns a list of posts which content matches the regex */ { xs_list *r = xs_list_new(); @@ -2514,14 +2514,11 @@ xs_list *content_search(snac *user, const xs_list *timeline, break; } - int status; - - if (user) - status = timeline_get_by_md5(user, v, &post); - else - status = object_get_by_md5(v, &post); + /* if from a user, must be in any timeline */ + if (user && !timeline_here(user, v)) + continue; - if (!valid_status(status)) + if (!valid_status(object_get_by_md5(v, &post))) continue; /* must be a Note */ |