diff options
| author | 2022-09-26 09:08:03 +0200 | |
|---|---|---|
| committer | 2022-09-26 09:08:03 +0200 | |
| commit | 74aef6994a9ae6655706ac65514e117cf8073f72 (patch) | |
| tree | e460a068e64300421527cb0d095d3bd8f083a44a /activitypub.c | |
| parent | Also store local referrers in the local timeline. (diff) | |
| download | snac2-74aef6994a9ae6655706ac65514e117cf8073f72.tar.gz snac2-74aef6994a9ae6655706ac65514e117cf8073f72.tar.xz snac2-74aef6994a9ae6655706ac65514e117cf8073f72.zip | |
Link to local if the child id is from this actor.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 10 |
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) | |||
| 71 | } | 71 | } |
| 72 | 72 | ||
| 73 | 73 | ||
| 74 | void timeline_request(snac *snac, char *id) | 74 | void timeline_request(snac *snac, char *id, char *referrer) |
| 75 | /* ensures that an entry and its ancestors are in the timeline */ | 75 | /* ensures that an entry and its ancestors are in the timeline */ |
| 76 | { | 76 | { |
| 77 | if (!xs_is_null(id)) { | 77 | if (!xs_is_null(id)) { |
| @@ -88,10 +88,10 @@ void timeline_request(snac *snac, char *id) | |||
| 88 | char *in_reply_to = xs_dict_get(object, "inReplyTo"); | 88 | char *in_reply_to = xs_dict_get(object, "inReplyTo"); |
| 89 | 89 | ||
| 90 | /* recurse! */ | 90 | /* recurse! */ |
| 91 | timeline_request(snac, in_reply_to); | 91 | timeline_request(snac, in_reply_to, referrer); |
| 92 | 92 | ||
| 93 | /* finally store */ | 93 | /* finally store */ |
| 94 | timeline_add(snac, id, object, in_reply_to, NULL); | 94 | timeline_add(snac, id, object, in_reply_to, referrer); |
| 95 | } | 95 | } |
| 96 | } | 96 | } |
| 97 | } | 97 | } |
| @@ -280,7 +280,7 @@ void process_message(snac *snac, char *msg, char *req) | |||
| 280 | char *id = xs_dict_get(object, "id"); | 280 | char *id = xs_dict_get(object, "id"); |
| 281 | char *in_reply_to = xs_dict_get(object, "inReplyTo"); | 281 | char *in_reply_to = xs_dict_get(object, "inReplyTo"); |
| 282 | 282 | ||
| 283 | timeline_request(snac, in_reply_to); | 283 | timeline_request(snac, in_reply_to, NULL); |
| 284 | 284 | ||
| 285 | if (timeline_add(snac, id, msg, in_reply_to, NULL)) | 285 | if (timeline_add(snac, id, msg, in_reply_to, NULL)) |
| 286 | snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id)); | 286 | snac_log(snac, xs_fmt("new 'Note' %s %s", actor, id)); |
| @@ -307,7 +307,7 @@ void process_message(snac *snac, char *msg, char *req) | |||
| 307 | if (xs_type(object) == XSTYPE_DICT) | 307 | if (xs_type(object) == XSTYPE_DICT) |
| 308 | object = xs_dict_get(object, "id"); | 308 | object = xs_dict_get(object, "id"); |
| 309 | 309 | ||
| 310 | timeline_request(snac, object); | 310 | timeline_request(snac, object, actor); |
| 311 | 311 | ||
| 312 | timeline_admire(snac, object, actor, 0); | 312 | timeline_admire(snac, object, actor, 0); |
| 313 | snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object)); | 313 | snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object)); |