diff options
| author | 2024-05-08 11:06:33 +0200 | |
|---|---|---|
| committer | 2024-05-08 11:06:33 +0200 | |
| commit | 34c8968cfb0aaa14ed901115c1addd1886916b79 (patch) | |
| tree | 23cc30c78da959f813f523fc254744e33c6ae69f | |
| parent | Renamed to content_search(). (diff) | |
| download | penes-snac2-34c8968cfb0aaa14ed901115c1addd1886916b79.tar.gz penes-snac2-34c8968cfb0aaa14ed901115c1addd1886916b79.tar.xz penes-snac2-34c8968cfb0aaa14ed901115c1addd1886916b79.zip | |
Minor tweaks to content_search().
| -rw-r--r-- | data.c | 13 |
1 files changed, 5 insertions, 8 deletions
| @@ -2491,7 +2491,7 @@ void notify_clear(snac *snac) | |||
| 2491 | /** searches **/ | 2491 | /** searches **/ |
| 2492 | 2492 | ||
| 2493 | xs_list *content_search(snac *user, const xs_list *timeline, | 2493 | xs_list *content_search(snac *user, const xs_list *timeline, |
| 2494 | const char *regex, int max_secs, int *timeout) | 2494 | const char *regex, int max_secs, int *timeout) |
| 2495 | /* returns a list of posts which content matches the regex */ | 2495 | /* returns a list of posts which content matches the regex */ |
| 2496 | { | 2496 | { |
| 2497 | xs_list *r = xs_list_new(); | 2497 | xs_list *r = xs_list_new(); |
| @@ -2514,14 +2514,11 @@ xs_list *content_search(snac *user, const xs_list *timeline, | |||
| 2514 | break; | 2514 | break; |
| 2515 | } | 2515 | } |
| 2516 | 2516 | ||
| 2517 | int status; | 2517 | /* if from a user, must be in any timeline */ |
| 2518 | 2518 | if (user && !timeline_here(user, v)) | |
| 2519 | if (user) | 2519 | continue; |
| 2520 | status = timeline_get_by_md5(user, v, &post); | ||
| 2521 | else | ||
| 2522 | status = object_get_by_md5(v, &post); | ||
| 2523 | 2520 | ||
| 2524 | if (!valid_status(status)) | 2521 | if (!valid_status(object_get_by_md5(v, &post))) |
| 2525 | continue; | 2522 | continue; |
| 2526 | 2523 | ||
| 2527 | /* must be a Note */ | 2524 | /* must be a Note */ |