commit b64d0f3

default  ·  2023-02-08 12:28:03 +0000 UTC
parent 3fcc139
New function timeline_here().
2 files changed,  +11, -3
M data.c
M snac.h
M data.c
+10, -3
 1@@ -827,6 +827,15 @@ xs_str *timeline_fn_by_md5(snac *snac, const char *md5)
 2 }
 3 
 4 
 5+int timeline_here(snac *snac, const char *md5)
 6+/* checks if an object is in the user cache */
 7+{
 8+    xs *fn = timeline_fn_by_md5(snac, md5);
 9+
10+    return !(fn == NULL);
11+}
12+
13+
14 int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg)
15 /* gets a message from the timeline */
16 {
17@@ -929,9 +938,7 @@ xs_list *timeline_top_level(snac *snac, xs_list *list)
18                 break;
19 
20             /* well, there is a parent... but is it here? */
21-            xs *pfn = timeline_fn_by_md5(snac, line2);
22-
23-            if (pfn == NULL)
24+            if (!timeline_here(snac, line2))
25                 break;
26 
27             /* it's here! try again with its own parent */
M snac.h
+1, -0
1@@ -92,6 +92,7 @@ int follower_check(snac *snac, const char *actor);
2 d_char *follower_list(snac *snac);
3 
4 double timeline_mtime(snac *snac);
5+int timeline_here(snac *snac, const char *md5);
6 int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg);
7 int timeline_del(snac *snac, char *id);
8 d_char *timeline_simple_list(snac *snac, const char *idx_name, int skip, int show);