summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/activitypub.c b/activitypub.c
index a852256..ef2dae4 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(snac *user, const char *actor, xs_dict **data) 118int actor_request(const char *actor, xs_dict **data)
119/* request an actor */ 119/* request an actor */
120{ 120{
121 int status, status2; 121 int status, status2;
@@ -129,7 +129,7 @@ int actor_request(snac *user, 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 status2 = activitypub_request(user, actor, &payload); 132 status2 = activitypub_request(NULL, actor, &payload);
133 133
134 if (valid_status(status2)) { 134 if (valid_status(status2)) {
135 /* renew data */ 135 /* renew data */
@@ -205,7 +205,7 @@ int timeline_request(snac *snac, char **id, xs_str **wrk, int level)
205 205
206 /* request (and drop) the actor for this entry */ 206 /* request (and drop) the actor for this entry */
207 if (!xs_is_null(actor)) 207 if (!xs_is_null(actor))
208 actor_request(snac, actor, NULL); 208 actor_request(actor, NULL);
209 209
210 /* does it have an ancestor? */ 210 /* does it have an ancestor? */
211 char *in_reply_to = xs_dict_get(object, "inReplyTo"); 211 char *in_reply_to = xs_dict_get(object, "inReplyTo");
@@ -329,7 +329,7 @@ xs_str *get_actor_inbox(snac *snac, const char *actor)
329 xs *data = NULL; 329 xs *data = NULL;
330 char *v = NULL; 330 char *v = NULL;
331 331
332 if (valid_status(actor_request(snac, actor, &data))) { 332 if (valid_status(actor_request(actor, &data))) {
333 /* try first endpoints/sharedInbox */ 333 /* try first endpoints/sharedInbox */
334 if ((v = xs_dict_get(data, "endpoints"))) 334 if ((v = xs_dict_get(data, "endpoints")))
335 v = xs_dict_get(v, "sharedInbox"); 335 v = xs_dict_get(v, "sharedInbox");
@@ -1093,7 +1093,7 @@ xs_dict *msg_follow(snac *snac, const char *q)
1093 } 1093 }
1094 1094
1095 /* request the actor */ 1095 /* request the actor */
1096 status = actor_request(snac, actor, &actor_o); 1096 status = actor_request(actor, &actor_o);
1097 1097
1098 if (valid_status(status)) { 1098 if (valid_status(status)) {
1099 /* check if the actor is an alias */ 1099 /* check if the actor is an alias */
@@ -1499,7 +1499,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1499 utype = "(null)"; 1499 utype = "(null)";
1500 1500
1501 /* bring the actor */ 1501 /* bring the actor */
1502 a_status = actor_request(snac, actor, &actor_o); 1502 a_status = actor_request(actor, &actor_o);
1503 1503
1504 /* do not retry permanent failures */ 1504 /* do not retry permanent failures */
1505 if (a_status == 404 || a_status == 410 || a_status < 0) { 1505 if (a_status == 404 || a_status == 410 || a_status < 0) {
@@ -1681,7 +1681,7 @@ int process_input_message(snac *snac, xs_dict *msg, xs_dict *req)
1681 /* bring the actor */ 1681 /* bring the actor */
1682 xs *who_o = NULL; 1682 xs *who_o = NULL;
1683 1683
1684 if (valid_status(actor_request(snac, who, &who_o))) { 1684 if (valid_status(actor_request(who, &who_o))) {
1685 timeline_admire(snac, object, actor, 0); 1685 timeline_admire(snac, object, actor, 0);
1686 snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object)); 1686 snac_log(snac, xs_fmt("new 'Announce' %s %s", actor, object));
1687 do_notify = 1; 1687 do_notify = 1;