diff --git a/config/defaults.config.php b/config/defaults.config.php index c1ecbb421..694f75c22 100644 --- a/config/defaults.config.php +++ b/config/defaults.config.php @@ -135,6 +135,10 @@ return [ // Disables the check if a mail address is in a valid format and can be resolved via DNS. 'disable_email_validation' => false, + // disable_mentions_removal (Boolean) + // Disables the automatic removal of implicit mentions in ActivityPub postings. + 'disable_mentions_removal' => false, + // disable_url_validation (Boolean) // Disables the DNS lookup of an URL. 'disable_url_validation' => false, diff --git a/src/Protocol/ActivityPub/Processor.php b/src/Protocol/ActivityPub/Processor.php index c3b41a1ae..f4befcd6f 100644 --- a/src/Protocol/ActivityPub/Processor.php +++ b/src/Protocol/ActivityPub/Processor.php @@ -689,6 +689,10 @@ class Processor */ private static function removeImplicitMentionsFromBody($body, array $implicit_mentions) { + if (Config::get('system', 'disable_mentions_removal')) { + return $body; + } + $kept_mentions = []; // Extract one prepended mention at a time from the body