diff options
author | default <nobody@localhost> | 2022-09-26 07:32:44 +0200 |
---|---|---|
committer | default <nobody@localhost> | 2022-09-26 07:32:44 +0200 |
commit | 1c8878c3dac3bba7ed2d758a1dc7b012f5c6a355 (patch) | |
tree | b2610dcda61232791d026e5ea2a747587f4a7d64 /data.c | |
parent | 5321295005c898f401bf6485c97954845ad96b4c (diff) |
Also store local referrers in the local timeline.
Diffstat (limited to 'data.c')
-rw-r--r-- | data.c | 11 |
1 files changed, 7 insertions, 4 deletions
@@ -400,7 +400,7 @@ d_char *_timeline_new_fn(snac *snac, char *id) } -void _timeline_write(snac *snac, char *id, char *msg, char *parent) +void _timeline_write(snac *snac, char *id, char *msg, char *parent, char *referrer) /* writes a timeline entry and refreshes the ancestors */ { xs *fn = _timeline_new_fn(snac, id); @@ -417,7 +417,8 @@ void _timeline_write(snac *snac, char *id, char *msg, char *parent) /* related to this user? link to local timeline */ if (xs_startswith(id, snac->actor) || - (!xs_is_null(parent) && xs_startswith(parent, snac->actor))) { + (!xs_is_null(parent) && xs_startswith(parent, snac->actor)) || + (!xs_is_null(referrer) && xs_startswith(referrer, snac->actor))) { xs *lfn = xs_replace(fn, "/timeline/", "/local/"); link(fn, lfn); @@ -557,7 +558,7 @@ int timeline_add(snac *snac, char *id, char *o_msg, char *parent, char *referrer msg = xs_dict_set(msg, "_snac", md); - _timeline_write(snac, id, msg, parent); + _timeline_write(snac, id, msg, parent, referrer); snac_log(snac, xs_fmt("timeline_add %s", id)); @@ -602,11 +603,13 @@ void timeline_admire(snac *snac, char *id, char *admirer, int like) unlink(ofn); - _timeline_write(snac, id, msg, xs_dict_get(meta, "parent")); + _timeline_write(snac, id, msg, xs_dict_get(meta, "parent"), admirer); snac_log(snac, xs_fmt("timeline_admire (%s) %s %s", like ? "Like" : "Announce", id, admirer)); } + else + snac_log(snac, xs_fmt("timeline_admire ignored for unknown object %s", id)); } |