summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2022-09-26 09:08:03 +0200
committerdefault <nobody@localhost>2022-09-26 09:08:03 +0200
commit74aef6994a9ae6655706ac65514e117cf8073f72 (patch)
treee460a068e64300421527cb0d095d3bd8f083a44a /activitypub.c
parent1c8878c3dac3bba7ed2d758a1dc7b012f5c6a355 (diff)
Link to local if the child id is from this actor.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/activitypub.c b/activitypub.c
index ca24103..9fa5ba8 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -71,7 +71,7 @@ int actor_request(snac *snac, char *actor, d_char **data)
}
-void timeline_request(snac *snac, char *id)
+void timeline_request(snac *snac, char *id, char *referrer)
/* ensures that an entry and its ancestors are in the timeline */
{
if (!xs_is_null(id)) {
@@ -88,10 +88,10 @@ void timeline_request(snac *snac, char *id)
char *in_reply_to = xs_dict_get(object, "inReplyTo");
/* recurse! */
- timeline_request(snac, in_reply_to);
+ timeline_request(snac, in_reply_to, referrer);
/* finally store */
- timeline_add(snac, id, object, in_reply_to, NULL);
+ timeline_add(snac, id, object, in_reply_to, referrer);
}
}
}
@@ -280,7 +280,7 @@ void process_message(snac *snac, char *msg, char *req)
char *id = xs_dict_get(object, "id");
char *in_reply_to = xs_dict_get(object, "inReplyTo");
- timeline_request(snac, in_reply_to);
+ timeline_request(snac, in_reply_to, NULL);
if (timeline_add(snac, id, msg, in_reply_to, NULL))
snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id));
@@ -307,7 +307,7 @@ void process_message(snac *snac, char *msg, char *req)
if (xs_type(object) == XSTYPE_DICT)
object = xs_dict_get(object, "id");
- timeline_request(snac, object);
+ timeline_request(snac, object, actor);
timeline_admire(snac, object, actor, 0);
snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));