diff options
| author | 2023-03-02 10:26:52 +0100 | |
|---|---|---|
| committer | 2023-03-02 10:26:52 +0100 | |
| commit | 4773d6c64cdee56c9c2b4061ef9587bd3c342b7b (patch) | |
| tree | 74f81515ab349534ec934743691bb93d201ef98d | |
| parent | Bumped version. (diff) | |
| download | snac2-4773d6c64cdee56c9c2b4061ef9587bd3c342b7b.tar.gz snac2-4773d6c64cdee56c9c2b4061ef9587bd3c342b7b.tar.xz snac2-4773d6c64cdee56c9c2b4061ef9587bd3c342b7b.zip | |
Output to the shared inboxes only the public messages.
| -rw-r--r-- | activitypub.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/activitypub.c b/activitypub.c index 1b89e3c..455a6fe 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -1101,19 +1101,22 @@ void process_user_queue_item(snac *snac, xs_dict *q_item) | |||
| 1101 | if (strcmp(type, "message") == 0) { | 1101 | if (strcmp(type, "message") == 0) { |
| 1102 | xs_dict *msg = xs_dict_get(q_item, "message"); | 1102 | xs_dict *msg = xs_dict_get(q_item, "message"); |
| 1103 | xs *rcpts = recipient_list(snac, msg, 1); | 1103 | xs *rcpts = recipient_list(snac, msg, 1); |
| 1104 | xs *shibx = inbox_list(); | ||
| 1105 | xs_set inboxes; | 1104 | xs_set inboxes; |
| 1106 | xs_list *p; | 1105 | xs_list *p; |
| 1107 | xs_str *v; | ||
| 1108 | xs_str *actor; | 1106 | xs_str *actor; |
| 1109 | 1107 | ||
| 1110 | xs_set_init(&inboxes); | 1108 | xs_set_init(&inboxes); |
| 1111 | 1109 | ||
| 1112 | /* send first to the collected inboxes */ | 1110 | /* if it's public, send first to the collected inboxes */ |
| 1113 | p = shibx; | 1111 | if (is_msg_public(snac, msg)) { |
| 1114 | while (xs_list_iter(&p, &v)) { | 1112 | xs *shibx = inbox_list(); |
| 1115 | if (xs_set_add(&inboxes, v) == 1) | 1113 | xs_str *v; |
| 1116 | enqueue_output(snac, msg, v, 0); | 1114 | |
| 1115 | p = shibx; | ||
| 1116 | while (xs_list_iter(&p, &v)) { | ||
| 1117 | if (xs_set_add(&inboxes, v) == 1) | ||
| 1118 | enqueue_output(snac, msg, v, 0); | ||
| 1119 | } | ||
| 1117 | } | 1120 | } |
| 1118 | 1121 | ||
| 1119 | /* iterate now the recipients */ | 1122 | /* iterate now the recipients */ |