mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-26 15:03:36 +00:00
Output to the shared inboxes only the public messages.
This commit is contained in:
parent
987f1d288b
commit
4773d6c64c
1 changed files with 10 additions and 7 deletions
|
@ -1101,19 +1101,22 @@ void process_user_queue_item(snac *snac, xs_dict *q_item)
|
||||||
if (strcmp(type, "message") == 0) {
|
if (strcmp(type, "message") == 0) {
|
||||||
xs_dict *msg = xs_dict_get(q_item, "message");
|
xs_dict *msg = xs_dict_get(q_item, "message");
|
||||||
xs *rcpts = recipient_list(snac, msg, 1);
|
xs *rcpts = recipient_list(snac, msg, 1);
|
||||||
xs *shibx = inbox_list();
|
|
||||||
xs_set inboxes;
|
xs_set inboxes;
|
||||||
xs_list *p;
|
xs_list *p;
|
||||||
xs_str *v;
|
|
||||||
xs_str *actor;
|
xs_str *actor;
|
||||||
|
|
||||||
xs_set_init(&inboxes);
|
xs_set_init(&inboxes);
|
||||||
|
|
||||||
/* send first to the collected inboxes */
|
/* if it's public, send first to the collected inboxes */
|
||||||
p = shibx;
|
if (is_msg_public(snac, msg)) {
|
||||||
while (xs_list_iter(&p, &v)) {
|
xs *shibx = inbox_list();
|
||||||
if (xs_set_add(&inboxes, v) == 1)
|
xs_str *v;
|
||||||
enqueue_output(snac, msg, v, 0);
|
|
||||||
|
p = shibx;
|
||||||
|
while (xs_list_iter(&p, &v)) {
|
||||||
|
if (xs_set_add(&inboxes, v) == 1)
|
||||||
|
enqueue_output(snac, msg, v, 0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* iterate now the recipients */
|
/* iterate now the recipients */
|
||||||
|
|
Loading…
Reference in a new issue