summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-12-15 21:43:34 +0100
committerdefault <nobody@localhost>2023-12-15 21:43:34 +0100
commit3e3dee8a2f8c95afeaafeb76610982b5ea9ada1a (patch)
tree11e438aa852a231d9713798d684be17984f12236
parent0dd4739cc674c55de31b935f0c3956bf155216bc (diff)
Avoid propagating Undo messages innecesarily.
-rw-r--r--activitypub.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/activitypub.c b/activitypub.c
index 80b8a22..5154ecc 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -468,6 +468,11 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
return 0;
}
+ /* if it's an Undo, it must be from someone we follow */
+ if (strcmp(type, "Undo") == 0) {
+ return following_check(snac, xs_dict_get(c_msg, "actor"));
+ }
+
/* if it's not a Create or Update, allow */
if (!xs_match(type, "Create|Update"))
return 1;