summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-25 12:42:42 +0100
committerdefault <nobody@localhost>2022-11-25 12:42:42 +0100
commit4bbebe8e4e4f2a43c4c7d0d193f6bc4a228a461d (patch)
treedca95d1c8a2cc4fd51116308f3a8c4bb24f7cd60 /data.c
parent9df1cb129e1702f1a271a948033447167c5c06d7 (diff)
Started maintaining timeline.idx and local.idx.
Diffstat (limited to 'data.c')
-rw-r--r--data.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/data.c b/data.c
index c01a611..1febf7a 100644
--- a/data.c
+++ b/data.c
@@ -924,7 +924,16 @@ int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer
if ((ret = _timeline_write(snac, id, msg, parent, referrer))) {
snac_debug(snac, 1, xs_fmt("timeline_add %s", id));
+
object_add(id, o_msg);
+
+ xs *idx = xs_fmt("%s/timeline.idx", snac->basedir);
+ index_add(idx, id);
+
+ if (xs_startswith(id, snac->actor)) {
+ idx = xs_replace_i(idx, "timeline.", "local.");
+ index_add(idx, id);
+ }
}
return ret;