]> git.mxchange.org Git - friendica.git/commitdiff
Make AP "direct messages" more compatible to Mastodon
authorMichael <heluecht@pirati.ca>
Fri, 17 May 2019 17:58:42 +0000 (17:58 +0000)
committerMichael <heluecht@pirati.ca>
Fri, 17 May 2019 17:58:42 +0000 (17:58 +0000)
src/Protocol/ActivityPub/Transmitter.php

index 1b418a7a54207e70afb8a7c722f3234660f1060c..7576c95738d4e94fb507d31a6f865f689edbd2d2 100644 (file)
@@ -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'] = '';