summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2024-03-24 11:30:07 +0100
committerGravatar default2024-03-24 11:30:07 +0100
commitb598cb51769c3b8ec668aa0de458761e4bc589da (patch)
tree531de40bc470d6aad93d35a89e3c9e7ffda425b7 /activitypub.c
parentAdded a message saying Pongs are seen through the log. (diff)
downloadsnac2-b598cb51769c3b8ec668aa0de458761e4bc589da.tar.gz
snac2-b598cb51769c3b8ec668aa0de458761e4bc589da.tar.xz
snac2-b598cb51769c3b8ec668aa0de458761e4bc589da.zip
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)
625 const char *type = xs_dict_get(c_msg, "type"); 625 const char *type = xs_dict_get(c_msg, "type");
626 const char *actor = xs_dict_get(c_msg, "actor"); 626 const char *actor = xs_dict_get(c_msg, "actor");
627 627
628 if (strcmp(actor, snac->actor) == 0) {
629 /* message by myself? (most probably via the shared-inbox) reject */
630 snac_debug(snac, 1, xs_fmt("ignoring message by myself"));
631 return 0;
632 }
633
628 if (xs_match(type, "Like|Announce")) { 634 if (xs_match(type, "Like|Announce")) {
629 const char *object = xs_dict_get(c_msg, "object"); 635 const char *object = xs_dict_get(c_msg, "object");
630 636