summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--activitypub.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/activitypub.c b/activitypub.c
index 114e35c..720e83a 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -115,7 +115,7 @@ int activitypub_request(snac *user, const char *url, xs_dict **data)
115} 115}
116 116
117 117
118int actor_request(const char *actor, xs_dict **data) 118int actor_request(snac *user, const char *actor, xs_dict **data)
119/* request an actor */ 119/* request an actor */
120{ 120{
121 int status; 121 int status;
@@ -129,7 +129,7 @@ int actor_request(const char *actor, xs_dict **data)
129 129
130 if (status != 200) { 130 if (status != 200) {
131 /* actor data non-existent or stale: get from the net */ 131 /* actor data non-existent or stale: get from the net */
132 status = activitypub_request(NULL, actor, &payload); 132 status = activitypub_request(user, actor, &payload);
133 133
134 if (valid_status(status)) { 134 if (valid_status(status)) {
135 /* renew data */ 135 /* renew data */
@@ -207,7 +207,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level)
207 207
208 /* request (and drop) the actor for this entry */ 208 /* request (and drop) the actor for this entry */
209 if (!xs_is_null(actor)) 209 if (!xs_is_null(actor))
210 actor_request(actor, NULL); 210 actor_request(snac, actor, NULL);
211 211
212 /* does it have an ancestor? */ 212 /* does it have an ancestor? */
213 char *in_reply_to = xs_dict_get(object, "inReplyTo"); 213 char *in_reply_to = xs_dict_get(object, "inReplyTo");
@@ -331,7 +331,7 @@ xs_str *get_actor_inbox(const char *actor)
331 xs *data = NULL; 331 xs *data = NULL;
332 char *v = NULL; 332 char *v = NULL;
333 333
334 if (valid_status(actor_request(actor, &data))) { 334 if (valid_status(actor_request(NULL, actor, &data))) {
335 /* try first endpoints/sharedInbox */ 335 /* try first endpoints/sharedInbox */
336 if ((v = xs_dict_get(data, "endpoints"))) 336 if ((v = xs_dict_get(data, "endpoints")))
337 v = xs_dict_get(v, "sharedInbox"); 337 v = xs_dict_get(v, "sharedInbox");
@@ -1127,7 +1127,7 @@ xs_dict *msg_follow(snac *snac, const char *q)
1127 } 1127 }
1128 1128
1129 /* request the actor */ 1129 /* request the actor */
1130 status = actor_request(actor, &actor_o); 1130 status = actor_request(snac, actor, &actor_o);
1131 1131
1132 if (valid_status(status)) { 1132 if (valid_status(status)) {
1133 /* check if the actor is an alias */ 1133 /* check if the actor is an alias */
@@ -1560,7 +1560,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1560 } 1560 }
1561 1561
1562 /* bring the actor */ 1562 /* bring the actor */
1563 a_status = actor_request(actor, &actor_o); 1563 a_status = actor_request(snac, actor, &actor_o);
1564 1564
1565 /* do not retry permanent failures */ 1565 /* do not retry permanent failures */
1566 if (a_status == 404 || a_status == 410 || a_status < 0) { 1566 if (a_status == 404 || a_status == 410 || a_status < 0) {
@@ -1748,7 +1748,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1748 /* bring the actor */ 1748 /* bring the actor */
1749 xs *who_o = NULL; 1749 xs *who_o = NULL;
1750 1750
1751 if (valid_status(actor_request(who, &who_o))) { 1751 if (valid_status(actor_request(snac, who, &who_o))) {
1752 timeline_admire(snac, object, actor, 0); 1752 timeline_admire(snac, object, actor, 0);
1753 snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object)); 1753 snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
1754 do_notify = 1; 1754 do_notify = 1;