summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2024-06-17 17:28:10 +0200
committerGravatar default2024-06-17 17:28:10 +0200
commitf7665079fe669ba6260c45f81cda6d90ae4e9d81 (patch)
tree65711ae9e52192b543b7534fb71472eb8d71b7a4 /activitypub.c
parentDeleted repeated code. (diff)
downloadsnac2-f7665079fe669ba6260c45f81cda6d90ae4e9d81.tar.gz
snac2-f7665079fe669ba6260c45f81cda6d90ae4e9d81.tar.xz
snac2-f7665079fe669ba6260c45f81cda6d90ae4e9d81.zip
Only send notes and poll to the collected inboxes.
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/activitypub.c b/activitypub.c
index 6bd4b65..4bfc4da 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -2182,16 +2182,16 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
2182 2182
2183 if (strcmp(type, "message") == 0) { 2183 if (strcmp(type, "message") == 0) {
2184 const xs_dict *msg = xs_dict_get(q_item, "message"); 2184 const xs_dict *msg = xs_dict_get(q_item, "message");
2185 xs *rcpts = recipient_list(snac, msg, 1); 2185 xs *rcpts = recipient_list(snac, msg, 1);
2186 xs_set inboxes; 2186 xs_set inboxes;
2187 xs_list *p;
2188 const xs_str *actor; 2187 const xs_str *actor;
2188 int c;
2189 2189
2190 xs_set_init(&inboxes); 2190 xs_set_init(&inboxes);
2191 2191
2192 /* iterate the recipients */ 2192 /* iterate the recipients */
2193 p = rcpts; 2193 c = 0;
2194 while (xs_list_iter(&p, &actor)) { 2194 while (xs_list_next(rcpts, &actor, &c)) {
2195 xs *inbox = get_actor_inbox(actor); 2195 xs *inbox = get_actor_inbox(actor);
2196 2196
2197 if (inbox != NULL) { 2197 if (inbox != NULL) {
@@ -2203,14 +2203,14 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
2203 snac_log(snac, xs_fmt("cannot find inbox for %s", actor)); 2203 snac_log(snac, xs_fmt("cannot find inbox for %s", actor));
2204 } 2204 }
2205 2205
2206 /* if it's public, send to the collected inboxes */ 2206 /* if it's a public note or question, send to the collected inboxes */
2207 if (is_msg_public(msg)) { 2207 if (xs_match(xs_dict_get_def(msg, "type", ""), "Create") && is_msg_public(msg)) {
2208 if (xs_type(xs_dict_get(srv_config, "disable_inbox_collection")) != XSTYPE_TRUE) { 2208 if (xs_type(xs_dict_get(srv_config, "disable_inbox_collection")) != XSTYPE_TRUE) {
2209 xs *shibx = inbox_list(); 2209 xs *shibx = inbox_list();
2210 const xs_str *inbox; 2210 const xs_str *inbox;
2211 2211
2212 p = shibx; 2212 c = 0;
2213 while (xs_list_iter(&p, &inbox)) { 2213 while (xs_list_next(shibx, &inbox, &c)) {
2214 if (xs_set_add(&inboxes, inbox) == 1) 2214 if (xs_set_add(&inboxes, inbox) == 1)
2215 enqueue_output(snac, msg, inbox, 0, 0); 2215 enqueue_output(snac, msg, inbox, 0, 0);
2216 } 2216 }