summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-03-24 11:30:07 +0100
committerdefault <nobody@localhost>2024-03-24 11:30:07 +0100
commitb598cb51769c3b8ec668aa0de458761e4bc589da (patch)
tree531de40bc470d6aad93d35a89e3c9e7ffda425b7 /activitypub.c
parent58848dda64896eb51d8e832c3ea0fdda52f8b709 (diff)
Reject my own messages in is_msg_for_me().
Diffstat (limited to 'activitypub.c')
-rw-r--r--activitypub.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index 2b4ff81..8f9e01a 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -625,6 +625,12 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
const char *type = xs_dict_get(c_msg, "type");
const char *actor = xs_dict_get(c_msg, "actor");
+ if (strcmp(actor, snac->actor) == 0) {
+ /* message by myself? (most probably via the shared-inbox) reject */
+ snac_debug(snac, 1, xs_fmt("ignoring message by myself"));
+ return 0;
+ }
+
if (xs_match(type, "Like|Announce")) {
const char *object = xs_dict_get(c_msg, "object");