summaryrefslogtreecommitdiff
path: root/activitypub.c
diff options
context:
space:
mode:
authorGravatar default2024-03-24 06:23:48 +0100
committerGravatar default2024-03-24 06:23:48 +0100
commit840fde45f17940c8fba7ac5151e96de2fe1a606f (patch)
treecb6e107492400d963d18e5a1c6acc76b8f16f6ce /activitypub.c
parentIn the 'ping' cmdline, really resolve via webfinger if necessary. (diff)
downloadsnac2-840fde45f17940c8fba7ac5151e96de2fe1a606f.tar.gz
snac2-840fde45f17940c8fba7ac5151e96de2fe1a606f.tar.xz
snac2-840fde45f17940c8fba7ac5151e96de2fe1a606f.zip
Only reply to direct Ping activities.
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 376082d..2b4ff81 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -659,6 +659,12 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
659 return !xs_is_null(object) && strcmp(snac->actor, object) == 0; 659 return !xs_is_null(object) && strcmp(snac->actor, object) == 0;
660 } 660 }
661 661
662 /* only accept Ping directed to us */
663 if (xs_match(type, "Ping")) {
664 char *dest = xs_dict_get(c_msg, "to");
665 return !xs_is_null(dest) && strcmp(snac->actor, dest) == 0;
666 }
667
662 /* if it's not a Create or Update, allow as is */ 668 /* if it's not a Create or Update, allow as is */
663 if (!xs_match(type, "Create|Update")) { 669 if (!xs_match(type, "Create|Update")) {
664 return 1; 670 return 1;