diff options
| -rw-r--r-- | activitypub.c | 14 | ||||
| -rw-r--r-- | snac.h | 1 |
2 files changed, 15 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c index 2c0fa2e..65eed05 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -669,6 +669,20 @@ xs_list *recipient_list(snac *snac, const xs_dict *msg, int expand_public) | |||
| 669 | } | 669 | } |
| 670 | 670 | ||
| 671 | 671 | ||
| 672 | int is_msg_mine(snac *user, const char *id) | ||
| 673 | /* returns true if a post id is by the given user */ | ||
| 674 | { | ||
| 675 | int ret = 0; | ||
| 676 | |||
| 677 | if (xs_is_string(id)) { | ||
| 678 | xs *s1 = xs_fmt("%s/", user->actor); | ||
| 679 | ret = xs_startswith(id, s1); | ||
| 680 | } | ||
| 681 | |||
| 682 | return ret; | ||
| 683 | } | ||
| 684 | |||
| 685 | |||
| 672 | int is_msg_public(const xs_dict *msg) | 686 | int is_msg_public(const xs_dict *msg) |
| 673 | /* checks if a message is public */ | 687 | /* checks if a message is public */ |
| 674 | { | 688 | { |
| @@ -388,6 +388,7 @@ int send_to_inbox(snac *snac, const xs_str *inbox, const xs_dict *msg, | |||
| 388 | xs_str *get_actor_inbox(const char *actor, int shared); | 388 | xs_str *get_actor_inbox(const char *actor, int shared); |
| 389 | int send_to_actor(snac *snac, const char *actor, const xs_dict *msg, | 389 | int send_to_actor(snac *snac, const char *actor, const xs_dict *msg, |
| 390 | xs_val **payload, int *p_size, int timeout); | 390 | xs_val **payload, int *p_size, int timeout); |
| 391 | int is_msg_mine(snac *user, const char *id); | ||
| 391 | int is_msg_public(const xs_dict *msg); | 392 | int is_msg_public(const xs_dict *msg); |
| 392 | int is_msg_from_private_user(const xs_dict *msg); | 393 | int is_msg_from_private_user(const xs_dict *msg); |
| 393 | int is_msg_for_me(snac *snac, const xs_dict *msg); | 394 | int is_msg_for_me(snac *snac, const xs_dict *msg); |