summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2022-11-01 20:13:23 +0100
committerGravatar default2022-11-01 20:13:23 +0100
commit34a2b47e85351a6fcab123ca0124229d5058c47b (patch)
tree026cd4975cb79285f5ba3c49e02b14e7ab8338aa
parentAdded rel=nofollow to the admin link. (diff)
downloadpenes-snac2-34a2b47e85351a6fcab123ca0124229d5058c47b.tar.gz
penes-snac2-34a2b47e85351a6fcab123ca0124229d5058c47b.tar.xz
penes-snac2-34a2b47e85351a6fcab123ca0124229d5058c47b.zip
Don't store objects other than 'Note' in timeline_request().
-rw-r--r--activitypub.c24
1 files changed, 14 insertions, 10 deletions
diff --git a/activitypub.c b/activitypub.c
index 0ee0bf6..f3c7093 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -91,20 +91,24 @@ int timeline_request(snac *snac, char *id, char *referrer)
91 status = activitypub_request(snac, id, &object); 91 status = activitypub_request(snac, id, &object);
92 92
93 if (valid_status(status)) { 93 if (valid_status(status)) {
94 char *actor = xs_dict_get(object, "attributedTo"); 94 char *type = xs_dict_get(object, "type");
95 95
96 /* request (and drop) the actor for this entry */ 96 if (!xs_is_null(type) && strcmp(type, "Note") == 0) {
97 if (!xs_is_null(actor)) 97 char *actor = xs_dict_get(object, "attributedTo");
98 actor_request(snac, actor, NULL);
99 98
100 /* does it have an ancestor? */ 99 /* request (and drop) the actor for this entry */
101 char *in_reply_to = xs_dict_get(object, "inReplyTo"); 100 if (!xs_is_null(actor))
101 actor_request(snac, actor, NULL);
102
103 /* does it have an ancestor? */
104 char *in_reply_to = xs_dict_get(object, "inReplyTo");
102 105
103 /* recurse! */ 106 /* recurse! */
104 timeline_request(snac, in_reply_to, referrer); 107 timeline_request(snac, in_reply_to, referrer);
105 108
106 /* finally store */ 109 /* finally store */
107 timeline_add(snac, id, object, in_reply_to, referrer); 110 timeline_add(snac, id, object, in_reply_to, referrer);
111 }
108 } 112 }
109 } 113 }
110 } 114 }