diff options
| author | 2022-12-02 20:44:51 +0100 | |
|---|---|---|
| committer | 2022-12-02 20:44:51 +0100 | |
| commit | 3e2891b100c3359bf3ff85e01447270f0aab3be1 (patch) | |
| tree | 8882ff9b29248f12e14b0fa7ce57a5062f6db944 | |
| parent | More old code deletions. (diff) | |
| download | snac2-3e2891b100c3359bf3ff85e01447270f0aab3be1.tar.gz snac2-3e2891b100c3359bf3ff85e01447270f0aab3be1.tar.xz snac2-3e2891b100c3359bf3ff85e01447270f0aab3be1.zip | |
Renamed timeline_here() to object_here().
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | data.c | 18 | ||||
| -rw-r--r-- | snac.h | 2 |
3 files changed, 11 insertions, 11 deletions
diff --git a/activitypub.c b/activitypub.c index 764f69d..09fa55e 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -85,7 +85,7 @@ int timeline_request(snac *snac, char *id, char *referrer) | |||
| 85 | 85 | ||
| 86 | if (!xs_is_null(id)) { | 86 | if (!xs_is_null(id)) { |
| 87 | /* is the admired object already there? */ | 87 | /* is the admired object already there? */ |
| 88 | if (!timeline_here(snac, id)) { | 88 | if (!object_here(id)) { |
| 89 | xs *object = NULL; | 89 | xs *object = NULL; |
| 90 | 90 | ||
| 91 | /* no; download it */ | 91 | /* no; download it */ |
| @@ -411,6 +411,15 @@ d_char *_object_fn(const char *id) | |||
| 411 | } | 411 | } |
| 412 | 412 | ||
| 413 | 413 | ||
| 414 | int object_here(char *id) | ||
| 415 | /* checks if an object is already downloaded */ | ||
| 416 | { | ||
| 417 | xs *fn = _object_fn(id); | ||
| 418 | |||
| 419 | return mtime(fn) > 0.0; | ||
| 420 | } | ||
| 421 | |||
| 422 | |||
| 414 | int object_get_by_md5(const char *md5, d_char **obj, const char *type) | 423 | int object_get_by_md5(const char *md5, d_char **obj, const char *type) |
| 415 | /* returns a stored object, optionally of the requested type */ | 424 | /* returns a stored object, optionally of the requested type */ |
| 416 | { | 425 | { |
| @@ -758,15 +767,6 @@ d_char *_timeline_find_fn(snac *snac, char *id) | |||
| 758 | } | 767 | } |
| 759 | 768 | ||
| 760 | 769 | ||
| 761 | int timeline_here(snac *snac, char *id) | ||
| 762 | /* checks if an object is already downloaded */ | ||
| 763 | { | ||
| 764 | xs *fn = _timeline_find_fn(snac, id); | ||
| 765 | |||
| 766 | return fn != NULL; | ||
| 767 | } | ||
| 768 | |||
| 769 | |||
| 770 | d_char *timeline_find(snac *snac, char *id) | 770 | d_char *timeline_find(snac *snac, char *id) |
| 771 | /* gets a message from the timeline by id */ | 771 | /* gets a message from the timeline by id */ |
| 772 | { | 772 | { |
| @@ -60,6 +60,7 @@ int index_first(const char *fn, char *buf, int size); | |||
| 60 | d_char *index_list(const char *fn, int max); | 60 | d_char *index_list(const char *fn, int max); |
| 61 | d_char *index_list_desc(const char *fn, int max); | 61 | d_char *index_list_desc(const char *fn, int max); |
| 62 | 62 | ||
| 63 | int object_here(char *id); | ||
| 63 | int object_get_by_md5(const char *md5, d_char **obj, const char *type); | 64 | int object_get_by_md5(const char *md5, d_char **obj, const char *type); |
| 64 | int object_get(const char *id, d_char **obj, const char *type); | 65 | int object_get(const char *id, d_char **obj, const char *type); |
| 65 | int object_del(const char *id); | 66 | int object_del(const char *id); |
| @@ -75,7 +76,6 @@ int follower_check(snac *snac, const char *actor); | |||
| 75 | d_char *follower_list(snac *snac); | 76 | d_char *follower_list(snac *snac); |
| 76 | 77 | ||
| 77 | double timeline_mtime(snac *snac); | 78 | double timeline_mtime(snac *snac); |
| 78 | int timeline_here(snac *snac, char *id); | ||
| 79 | d_char *_timeline_find_fn(snac *snac, char *id); | 79 | d_char *_timeline_find_fn(snac *snac, char *id); |
| 80 | d_char *timeline_find(snac *snac, char *id); | 80 | d_char *timeline_find(snac *snac, char *id); |
| 81 | int timeline_del(snac *snac, char *id); | 81 | int timeline_del(snac *snac, char *id); |