From 840fde45f17940c8fba7ac5151e96de2fe1a606f Mon Sep 17 00:00:00 2001 From: default Date: Sun, 24 Mar 2024 06:23:48 +0100 Subject: [PATCH] Only reply to direct Ping activities. --- activitypub.c | 6 ++++++ 1 file changed, 6 insertions(+) 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) return !xs_is_null(object) && strcmp(snac->actor, object) == 0; } + /* only accept Ping directed to us */ + if (xs_match(type, "Ping")) { + char *dest = xs_dict_get(c_msg, "to"); + return !xs_is_null(dest) && strcmp(snac->actor, dest) == 0; + } + /* if it's not a Create or Update, allow as is */ if (!xs_match(type, "Create|Update")) { return 1;