Possible or at least partial solution to issue #133 where Announce activities are filtered to prevent overwhelming conversations with redundant workarounds for Mastodon behaviour.

This commit is contained in:
Mike Macgirvin 2023-12-16 08:52:19 +11:00
parent 9b079dd584
commit c72c37fffb
2 changed files with 3 additions and 16 deletions

View file

@ -749,18 +749,6 @@ class Notifier implements DaemonInterface
// default: zot or nomad protocol
// Prevent zot6/Nomad delivery of group comment boosts, which are not required for conversational platforms.
// ActivityPub conversational platforms may wish to filter these if they don't want or require them.
// We will assume here that if $target_item exists and has a verb that it is an actual item structure
// so we won't need to check the existence of the other item fields prior to evaluation.
// This shouldn't produce false positives on comment boosts that were generated on other platforms
// because we won't be delivering them.
if (isset($target_item) && isset($target_item['verb']) && $target_item['verb'] === 'Announce' && $target_item['author_xchan'] === $target_item['owner_xchan'] && ! intval($target_item['item_thread_top'])) {
continue;
}
$hash = new_uuid();
$env = (($hub_env && $hub_env[$hub['hubloc_site_id']]) ? $hub_env[$hub['hubloc_site_id']] : '');

View file

@ -98,16 +98,15 @@ class Channel extends Controller
// An ActivityStreams actor record is more or less required for ActivityStreams compliance
// unless the actor object is inlined into every activity/object. This implies that it
// is more or less required for the Zot6 protocol, which uses ActivityStreams as a content
// serialisation and which doesn't always include the full actor record with every
// is more or less required for the Nomad/Zot6 protocols, which use ActivityStreams as a content
// serialisation and which don't always include the full actor record with every
// activity/object.
// "more or less" means it isn't spelled out in the ActivityStreams spec, but a number of
// things will break in subtle ways if it isn't provided.
// The ActivityPub protocol requires an 'inbox', which will not be present in this record
// if/when the ActivityPub protocol is disabled. This will be the case when using the Redmatrix
// fork of Zap; which disables ActivityPub connectivity by default.
// if/when the ActivityPub protocol is disabled.
if (ActivityStreams::is_as_request()) {
// Somebody may attempt an ActivityStreams fetch on one of our message permalinks