diff options
author | default <nobody@localhost> | 2023-02-20 09:32:44 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-02-20 09:32:44 +0100 |
commit | 5230435b31ec2ca159901831c97dfa62646c993d (patch) | |
tree | 24a831e61f4153313a124352155cd7dcf8bee56c /activitypub.c | |
parent | 9083bef5cb5ab6d36dcba3f80ef736352ad076ac (diff) |
New boolean argument 'priv' to msg_note().
Diffstat (limited to 'activitypub.c')
-rw-r--r-- | activitypub.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/activitypub.c b/activitypub.c index fc01466..2d84b0e 100644 --- a/activitypub.c +++ b/activitypub.c @@ -632,7 +632,8 @@ d_char *msg_follow(snac *snac, char *url_or_uid) } -xs_dict *msg_note(snac *snac, xs_str *content, xs_val *rcpts, xs_str *in_reply_to, xs_list *attach) +xs_dict *msg_note(snac *snac, xs_str *content, xs_val *rcpts, + xs_str *in_reply_to, xs_list *attach, int priv) /* creates a 'Note' message */ { xs *ntid = tid(0); @@ -702,8 +703,7 @@ xs_dict *msg_note(snac *snac, xs_str *content, xs_val *rcpts, xs_str *in_reply_t ctxt = xs_dup(v); /* if this message is public, ours will also be */ - if (is_msg_public(snac, p_msg) && - xs_list_in(to, public_address) == -1) + if (!priv && is_msg_public(snac, p_msg) && xs_list_in(to, public_address) == -1) to = xs_list_append(to, public_address); } @@ -749,7 +749,7 @@ xs_dict *msg_note(snac *snac, xs_str *content, xs_val *rcpts, xs_str *in_reply_t } /* no recipients? must be for everybody */ - if (xs_list_len(to) == 0) + if (!priv && xs_list_len(to) == 0) to = xs_list_append(to, public_address); /* delete all cc recipients that also are in the to */ |