From f6fc70c4e2bee396fa3737b2c0b43de2025318c7 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 17 May 2019 17:58:42 +0000 Subject: [PATCH] Make AP "direct messages" more compatible to Mastodon --- src/Protocol/ActivityPub/Transmitter.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 1b418a7a5..7576c9573 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -645,6 +645,12 @@ class Transmitter $reply = DBA::selectFirst('mail', ['uri'], ['parent-uri' => $mail['parent-uri'], 'reply' => false]); + // Making the post more compatible for Mastodon by: + // - Making it a note and not an article (no title) + // - Moving the title into the "summary" field that is used as a "content warning" + $mail['body'] = '[abstract]' . $mail['title'] . "[/abstract]\n".$mail['body']; + $mail['title'] = ''; + $mail['author-link'] = $mail['owner-link'] = $mail['from-url']; $mail['allow_cid'] = '<'.$mail['contact-id'].'>'; $mail['allow_gid'] = '';