diff options
| author | 2023-12-15 21:43:34 +0100 | |
|---|---|---|
| committer | 2023-12-15 21:43:34 +0100 | |
| commit | 3e3dee8a2f8c95afeaafeb76610982b5ea9ada1a (patch) | |
| tree | 11e438aa852a231d9713798d684be17984f12236 /activitypub.c | |
| parent | Added some spacing to the Operations... form. (diff) | |
| download | snac2-3e3dee8a2f8c95afeaafeb76610982b5ea9ada1a.tar.gz snac2-3e3dee8a2f8c95afeaafeb76610982b5ea9ada1a.tar.xz snac2-3e3dee8a2f8c95afeaafeb76610982b5ea9ada1a.zip | |
Avoid propagating Undo messages innecesarily.
Diffstat (limited to 'activitypub.c')
| -rw-r--r-- | activitypub.c | 5 |
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) | |||
| 468 | return 0; | 468 | return 0; |
| 469 | } | 469 | } |
| 470 | 470 | ||
| 471 | /* if it's an Undo, it must be from someone we follow */ | ||
| 472 | if (strcmp(type, "Undo") == 0) { | ||
| 473 | return following_check(snac, xs_dict_get(c_msg, "actor")); | ||
| 474 | } | ||
| 475 | |||
| 471 | /* if it's not a Create or Update, allow */ | 476 | /* if it's not a Create or Update, allow */ |
| 472 | if (!xs_match(type, "Create|Update")) | 477 | if (!xs_match(type, "Create|Update")) |
| 473 | return 1; | 478 | return 1; |