summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-03-02 09:15:40 +0100
committerdefault <nobody@localhost>2023-03-02 09:15:40 +0100
commit29b12498dd511b00586446b98f11ccb1d44088eb (patch)
tree3b7178a7770a4d99712b6b69f9848d7b71d51085 /activitypub.c
parente74ae0f58971e12422068f85e35fc7928206e9f9 (diff)
Simplified is_msg_public().
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c37
1 files changed, 2 insertions, 35 deletions
diff --git a/activitypub.c b/activitypub.c
index 498ba1f..79c20d7 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -279,46 +279,13 @@ d_char *recipient_list(snac *snac, char *msg, int expand_public)
}
-#if 0
-d_char *inbox_list(snac *snac, char *msg)
-/* returns the list of inboxes that are recipients of this message */
-{
- xs *rcpts = recipient_list(snac, msg, 1);
- xs_set inboxes;
- char *p, *v;
-
- xs_set_init(&inboxes);
-
- p = rcpts;
- while (xs_list_iter(&p, &v)) {
- xs *inbox;
-
- if ((inbox = get_actor_inbox(snac, v)) != NULL) {
- /* add the inbox if it's not already there */
- xs_set_add(&inboxes, inbox);
- }
- else
- snac_log(snac, xs_fmt("cannot find inbox for %s", v));
- }
-
- return xs_set_result(&inboxes);
-}
-#endif
-
-int is_msg_public(snac *snac, char *msg)
+int is_msg_public(snac *snac, xs_dict *msg)
/* checks if a message is public */
{
int ret = 0;
xs *rcpts = recipient_list(snac, msg, 0);
- char *p, *v;
-
- p = rcpts;
- while (!ret && xs_list_iter(&p, &v)) {
- if (strcmp(v, public_address) == 0)
- ret = 1;
- }
- return ret;
+ return xs_list_in(rcpts, public_address) != -1;
}