summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-02-08 13:28:03 +0100
committerdefault <nobody@localhost>2023-02-08 13:28:03 +0100
commitb64d0f338d6014799a82138619cbc9588775982f (patch)
tree57b6268790285eef8879f15296303474a11d82dc /data.c
parent3fcc139d6651a7d1c4fb431b3a9ee17cac897b27 (diff)
New function timeline_here().
Diffstat (limited to 'data.c')
-rw-r--r--data.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/data.c b/data.c
index 3a3d992..a166b35 100644
--- a/data.c
+++ b/data.c
@@ -827,6 +827,15 @@ xs_str *timeline_fn_by_md5(snac *snac, const char *md5)
}
+int timeline_here(snac *snac, const char *md5)
+/* checks if an object is in the user cache */
+{
+ xs *fn = timeline_fn_by_md5(snac, md5);
+
+ return !(fn == NULL);
+}
+
+
int timeline_get_by_md5(snac *snac, const char *md5, xs_dict **msg)
/* gets a message from the timeline */
{
@@ -929,9 +938,7 @@ xs_list *timeline_top_level(snac *snac, xs_list *list)
break;
/* well, there is a parent... but is it here? */
- xs *pfn = timeline_fn_by_md5(snac, line2);
-
- if (pfn == NULL)
+ if (!timeline_here(snac, line2))
break;
/* it's here! try again with its own parent */