diff options
| author | 2025-11-29 06:08:37 +0100 | |
|---|---|---|
| committer | 2025-11-29 06:08:37 +0100 | |
| commit | 5c2c7b27aca8bec59f90007481e5e2c6e961827f (patch) | |
| tree | d07dd72c332c45a8855363a52dd74267e482ef22 /activitypub.c | |
| parent | Some attachments are of type 'Video' instead of a MIME type (bsky). (diff) | |
| download | snac2-5c2c7b27aca8bec59f90007481e5e2c6e961827f.tar.gz snac2-5c2c7b27aca8bec59f90007481e5e2c6e961827f.tar.xz snac2-5c2c7b27aca8bec59f90007481e5e2c6e961827f.zip | |
New function is_msg_mine().
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 14 |
1 files changed, 14 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 | { |