From f6fc70c4e2bee396fa3737b2c0b43de2025318c7 Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 17 May 2019 17:58:42 +0000 Subject: [PATCH 1/2] 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'] = ''; From d81b7c840e065162e78249ad31ac35c94058f93e Mon Sep 17 00:00:00 2001 From: Michael Date: Fri, 17 May 2019 18:00:00 +0000 Subject: [PATCH 2/2] Adding missing spaces --- src/Protocol/ActivityPub/Transmitter.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Protocol/ActivityPub/Transmitter.php b/src/Protocol/ActivityPub/Transmitter.php index 7576c9573..88e047c13 100644 --- a/src/Protocol/ActivityPub/Transmitter.php +++ b/src/Protocol/ActivityPub/Transmitter.php @@ -648,7 +648,7 @@ class Transmitter // 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['body'] = '[abstract]' . $mail['title'] . "[/abstract]\n" . $mail['body']; $mail['title'] = ''; $mail['author-link'] = $mail['owner-link'] = $mail['from-url'];