mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-15 01:55:03 +00:00
New function is_msg_public().
This commit is contained in:
parent
e0e86d269a
commit
c37a99b97c
1 changed files with 18 additions and 1 deletions
|
@ -379,7 +379,7 @@ void process_queue(snac *snac)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
d_char *recipent_list(snac *snac, char *msg, int expand_public)
|
d_char *recipient_list(snac *snac, char *msg, int expand_public)
|
||||||
/* returns the list of recipients for a message */
|
/* returns the list of recipients for a message */
|
||||||
{
|
{
|
||||||
d_char *list = xs_list_new();
|
d_char *list = xs_list_new();
|
||||||
|
@ -414,6 +414,23 @@ d_char *recipent_list(snac *snac, char *msg, int expand_public)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
int is_msg_public(snac *snac, char *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;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/** HTTP handlers */
|
/** HTTP handlers */
|
||||||
|
|
||||||
int activitypub_get_handler(d_char *req, char *q_path,
|
int activitypub_get_handler(d_char *req, char *q_path,
|
||||||
|
|
Loading…
Reference in a new issue