summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar default2023-12-15 22:25:14 +0100
committerGravatar default2023-12-15 22:25:14 +0100
commitf32c7dd813df6276011f233e06bf465e8865603d (patch)
treed79d039434a5751f0d246af0d18681bf8c421a5d
parentAvoid propagating Undo messages innecesarily. (diff)
downloadsnac2-f32c7dd813df6276011f233e06bf465e8865603d.tar.gz
snac2-f32c7dd813df6276011f233e06bf465e8865603d.tar.xz
snac2-f32c7dd813df6276011f233e06bf465e8865603d.zip
More tweaks to is_msg_for_me().
Diffstat (limited to '')
-rw-r--r--activitypub.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/activitypub.c b/activitypub.c
index 5154ecc..1513be3 100644
--- a/activitypub.c
+++ b/activitypub.c
@@ -464,8 +464,7 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
464 return 2; 464 return 2;
465 465
466 /* if it's by someone we don't follow, reject */ 466 /* if it's by someone we don't follow, reject */
467 if (!following_check(snac, xs_dict_get(c_msg, "actor"))) 467 return following_check(snac, xs_dict_get(c_msg, "actor"));
468 return 0;
469 } 468 }
470 469
471 /* if it's an Undo, it must be from someone we follow */ 470 /* if it's an Undo, it must be from someone we follow */
@@ -474,8 +473,9 @@ int is_msg_for_me(snac *snac, const xs_dict *c_msg)
474 } 473 }
475 474
476 /* if it's not a Create or Update, allow */ 475 /* if it's not a Create or Update, allow */
477 if (!xs_match(type, "Create|Update")) 476 if (!xs_match(type, "Create|Update")) {
478 return 1; 477 return 1;
478 }
479 479
480 xs_dict *msg = xs_dict_get(c_msg, "object"); 480 xs_dict *msg = xs_dict_get(c_msg, "object");
481 xs *rcpts = recipient_list(snac, msg, 0); 481 xs *rcpts = recipient_list(snac, msg, 0);