]> git.mxchange.org Git - friendica.git/commitdiff
New BBCode constant for Bluesky
authorMichael <heluecht@pirati.ca>
Mon, 5 Jun 2023 04:31:19 +0000 (04:31 +0000)
committerMichael <heluecht@pirati.ca>
Mon, 5 Jun 2023 04:31:19 +0000 (04:31 +0000)
src/Content/Text/BBCode.php
src/Content/Text/Plaintext.php

index 0e5ee9d4e2e03600e470e8ad9a5f5fcb91a0f79e..e321b13e70378c25c5431c1df97f6bbf21b6b430 100644 (file)
@@ -62,6 +62,7 @@ class BBCode
        const TWITTER      = 8;
        const BACKLINK     = 8;
        const ACTIVITYPUB  = 9;
+       const BLUESKY      = 10;
 
        const TOP_ANCHOR = '<br class="top-anchor">';
        const BOTTOM_ANCHOR = '<br class="button-anchor">';
@@ -1771,7 +1772,7 @@ class BBCode
                                        $text
                                );
 
-                               if (in_array($simple_html, [self::OSTATUS, self::TWITTER])) {
+                               if (in_array($simple_html, [self::OSTATUS, self::TWITTER, self::BLUESKY])) {
                                        $text = preg_replace_callback("/([^#@!])\[url\=([^\]]*)\](.*?)\[\/url\]/ism", [self::class, 'expandLinksCallback'], $text);
                                        //$text = preg_replace("/[^#@!]\[url\=([^\]]*)\](.*?)\[\/url\]/ism", ' $2 [url]$1[/url]', $text);
                                        $text = preg_replace("/\[bookmark\=([^\]]*)\](.*?)\[\/bookmark\]/ism", ' $2 [url]$1[/url]', $text);
index b297f75b367acf20c2297d8b448b8e4b76baec09..86d720a02a4e33f85a4c3616ec053924d5ec45d6 100644 (file)
@@ -137,6 +137,10 @@ class Plaintext
                                $abstract = BBCode::getAbstract($item['body'], Protocol::STATUSNET);
                                break;
 
+                       case BBCode::BLUESKY:
+                               $abstract = BBCode::getAbstract($item['body'], Protocol::BLUESKY);
+                               break;
+       
                        default: // We don't know the exact target.
                                // We fetch an abstract since there is a posting limit.
                                if ($limit > 0) {