diff options
| -rw-r--r-- | data.c | 13 | ||||
| -rw-r--r-- | snac.h | 1 |
2 files changed, 11 insertions, 3 deletions
| @@ -827,6 +827,15 @@ xs_str *timeline_fn_by_md5(snac *snac, const char *md5) | |||
| 827 | } | 827 | } |
| 828 | 828 | ||
| 829 | 829 | ||
| 830 | int timeline_here(snac *snac, const char *md5) | ||
| 831 | /* checks if an object is in the user cache */ | ||
| 832 | { | ||
| 833 | xs *fn = timeline_fn_by_md5(snac, md5); | ||
| 834 | |||
| 835 | return !(fn == NULL); | ||
| 836 | } | ||
| 837 | |||
| 838 | |||
| 830 | int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg) | 839 | int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg) |
| 831 | /* gets a message from the timeline */ | 840 | /* gets a message from the timeline */ |
| 832 | { | 841 | { |
| @@ -929,9 +938,7 @@ xs_list *timeline_top_level(snac *snac, xs_list *list) | |||
| 929 | break; | 938 | break; |
| 930 | 939 | ||
| 931 | /* well, there is a parent... but is it here? */ | 940 | /* well, there is a parent... but is it here? */ |
| 932 | xs *pfn = timeline_fn_by_md5(snac, line2); | 941 | if (!timeline_here(snac, line2)) |
| 933 | |||
| 934 | if (pfn == NULL) | ||
| 935 | break; | 942 | break; |
| 936 | 943 | ||
| 937 | /* it's here! try again with its own parent */ | 944 | /* it's here! try again with its own parent */ |
| @@ -92,6 +92,7 @@ int follower_check(snac *snac, const char *actor); | |||
| 92 | d_char *follower_list(snac *snac); | 92 | d_char *follower_list(snac *snac); |
| 93 | 93 | ||
| 94 | double timeline_mtime(snac *snac); | 94 | double timeline_mtime(snac *snac); |
| 95 | int timeline_here(snac *snac, const char *md5); | ||
| 95 | int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg); | 96 | int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg); |
| 96 | int timeline_del(snac *snac, char *id); | 97 | int timeline_del(snac *snac, char *id); |
| 97 | d_char *timeline_simple_list(snac *snac, const char *idx_name, int skip, int show); | 98 | d_char *timeline_simple_list(snac *snac, const char *idx_name, int skip, int show); |