commit 3e2891b

default  ·  2022-12-02 19:44:51 +0000 UTC
parent 4819c42
Renamed timeline_here() to object_here().
3 files changed,  +11, -11
M data.c
M snac.h
+1, -1
1@@ -85,7 +85,7 @@ int timeline_request(snac *snac, char *id, char *referrer)
2 
3     if (!xs_is_null(id)) {
4         /* is the admired object already there? */
5-        if (!timeline_here(snac, id)) {
6+        if (!object_here(id)) {
7             xs *object = NULL;
8 
9             /* no; download it */
M data.c
+9, -9
 1@@ -411,6 +411,15 @@ d_char *_object_fn(const char *id)
 2 }
 3 
 4 
 5+int object_here(char *id)
 6+/* checks if an object is already downloaded */
 7+{
 8+    xs *fn = _object_fn(id);
 9+
10+    return mtime(fn) > 0.0;
11+}
12+
13+
14 int object_get_by_md5(const char *md5, d_char **obj, const char *type)
15 /* returns a stored object, optionally of the requested type */
16 {
17@@ -758,15 +767,6 @@ d_char *_timeline_find_fn(snac *snac, char *id)
18 }
19 
20 
21-int timeline_here(snac *snac, char *id)
22-/* checks if an object is already downloaded */
23-{
24-    xs *fn = _timeline_find_fn(snac, id);
25-
26-    return fn != NULL;
27-}
28-
29-
30 d_char *timeline_find(snac *snac, char *id)
31 /* gets a message from the timeline by id */
32 {
M snac.h
+1, -1
 1@@ -60,6 +60,7 @@ int index_first(const char *fn, char *buf, int size);
 2 d_char *index_list(const char *fn, int max);
 3 d_char *index_list_desc(const char *fn, int max);
 4 
 5+int object_here(char *id);
 6 int object_get_by_md5(const char *md5, d_char **obj, const char *type);
 7 int object_get(const char *id, d_char **obj, const char *type);
 8 int object_del(const char *id);
 9@@ -75,7 +76,6 @@ int follower_check(snac *snac, const char *actor);
10 d_char *follower_list(snac *snac);
11 
12 double timeline_mtime(snac *snac);
13-int timeline_here(snac *snac, char *id);
14 d_char *_timeline_find_fn(snac *snac, char *id);
15 d_char *timeline_find(snac *snac, char *id);
16 int timeline_del(snac *snac, char *id);