mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-22 13:25:04 +00:00
Also store local referrers in the local timeline.
This commit is contained in:
parent
5321295005
commit
1c8878c3da
1 changed files with 7 additions and 4 deletions
11
data.c
11
data.c
|
@ -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 */
|
/* writes a timeline entry and refreshes the ancestors */
|
||||||
{
|
{
|
||||||
xs *fn = _timeline_new_fn(snac, id);
|
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 */
|
/* related to this user? link to local timeline */
|
||||||
if (xs_startswith(id, snac->actor) ||
|
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/");
|
xs *lfn = xs_replace(fn, "/timeline/", "/local/");
|
||||||
link(fn, lfn);
|
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);
|
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));
|
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);
|
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",
|
snac_log(snac, xs_fmt("timeline_admire (%s) %s %s",
|
||||||
like ? "Like" : "Announce", id, admirer));
|
like ? "Like" : "Announce", id, admirer));
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
snac_log(snac, xs_fmt("timeline_admire ignored for unknown object %s", id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue