summaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-11-24 13:00:24 +0100
committerdefault <nobody@localhost>2022-11-24 13:00:24 +0100
commit233ba75d1edfde60dd73474dc7f962f00fdd1580 (patch)
tree2ef6d78c57ffc39b29df14a893c734dd3f895949 /data.c
parent177c362425f83360c63ca361def3267ff98baebf (diff)
New function object_admire().
Diffstat (limited to 'data.c')
-rw-r--r--data.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/data.c b/data.c
index f782d7f..6820537 100644
--- a/data.c
+++ b/data.c
@@ -463,6 +463,19 @@ d_char *object_children(const char *id)
}
+int object_admire(const char *id, const char *actor, int like)
+/* actor likes or announces this object */
+{
+ xs *fn = _object_fn(id);
+
+ fn = xs_replace_i(fn, ".json", like ? "_l.idx" : "_a.idx");
+
+ srv_debug(0, xs_fmt("object_admire (%s) %s %s", like ? "Like" : "Announce", actor, fn));
+
+ return index_add(fn, actor);
+}
+
+
d_char *_follower_fn(snac *snac, char *actor)
{
xs *md5 = xs_md5_hex(actor, strlen(actor));
@@ -921,6 +934,8 @@ void timeline_admire(snac *snac, char *id, char *admirer, int like)
}
else
snac_log(snac, xs_fmt("timeline_admire ignored for unknown object %s", id));
+
+ object_admire(id, admirer, like);
}