]> git.mxchange.org Git - friendica.git/commitdiff
API: added positiv list for quote support
authorMichael <heluecht@pirati.ca>
Wed, 25 Jan 2023 06:26:17 +0000 (06:26 +0000)
committerMichael <heluecht@pirati.ca>
Wed, 25 Jan 2023 06:26:17 +0000 (06:26 +0000)
23 files changed:
src/Factory/Api/Mastodon/Status.php
src/Module/Api/Mastodon/Accounts/Statuses.php
src/Module/Api/Mastodon/Bookmarks.php
src/Module/Api/Mastodon/Favourited.php
src/Module/Api/Mastodon/Search.php
src/Module/Api/Mastodon/Statuses.php
src/Module/Api/Mastodon/Statuses/Bookmark.php
src/Module/Api/Mastodon/Statuses/Context.php
src/Module/Api/Mastodon/Statuses/Favourite.php
src/Module/Api/Mastodon/Statuses/Mute.php
src/Module/Api/Mastodon/Statuses/Pin.php
src/Module/Api/Mastodon/Statuses/Reblog.php
src/Module/Api/Mastodon/Statuses/Unbookmark.php
src/Module/Api/Mastodon/Statuses/Unfavourite.php
src/Module/Api/Mastodon/Statuses/Unmute.php
src/Module/Api/Mastodon/Statuses/Unpin.php
src/Module/Api/Mastodon/Statuses/Unreblog.php
src/Module/Api/Mastodon/Timelines/Home.php
src/Module/Api/Mastodon/Timelines/ListTimeline.php
src/Module/Api/Mastodon/Timelines/PublicTimeline.php
src/Module/Api/Mastodon/Timelines/Tag.php
src/Module/Api/Mastodon/Trends/Statuses.php
src/Module/BaseApi.php

index 1b569d57e5452c44dff100d10e70d454d9b5093c..c120825fd13170a5081b59e80f92c9eadb904355 100644 (file)
@@ -198,33 +198,6 @@ class Status extends BaseFactory
                        $poll = null;
                }
 
-               $shared = $this->contentItem->getSharedPost($item, ['uri-id']);
-               if (!empty($shared)) {
-                       $shared_uri_id = $shared['post']['uri-id'];
-
-                       foreach ($this->mstdnMentionFactory->createFromUriId($shared_uri_id)->getArrayCopy() as $mention) {
-                               if (!in_array($mention, $mentions)) {
-                                       $mentions[] = $mention;
-                               }
-                       }
-
-                       foreach ($this->mstdnTagFactory->createFromUriId($shared_uri_id) as $tag) {
-                               if (!in_array($tag, $tags)) {
-                                       $tags[] = $tag;
-                               }
-                       }
-
-                       foreach ($this->mstdnAttachementFactory->createFromUriId($shared_uri_id) as $attachment) {
-                               if (!in_array($attachment, $attachments)) {
-                                       $attachments[] = $attachment;
-                               }
-                       }
-
-                       if (empty($card->toArray())) {
-                               $card = $this->mstdnCardFactory->createFromUriId($shared_uri_id);
-                       }
-               }
-
                if ($display_quote) {
                        $quote = self::createQuote($item, $uid);
 
@@ -239,6 +212,33 @@ class Status extends BaseFactory
                                $quote = self::createQuote($item, $uid);
                        }
 
+                       $shared = $this->contentItem->getSharedPost($item, ['uri-id']);
+                       if (!empty($shared)) {
+                               $shared_uri_id = $shared['post']['uri-id'];
+
+                               foreach ($this->mstdnMentionFactory->createFromUriId($shared_uri_id)->getArrayCopy() as $mention) {
+                                       if (!in_array($mention, $mentions)) {
+                                               $mentions[] = $mention;
+                                       }
+                               }
+
+                               foreach ($this->mstdnTagFactory->createFromUriId($shared_uri_id) as $tag) {
+                                       if (!in_array($tag, $tags)) {
+                                               $tags[] = $tag;
+                                       }
+                               }
+
+                               foreach ($this->mstdnAttachementFactory->createFromUriId($shared_uri_id) as $attachment) {
+                                       if (!in_array($attachment, $attachments)) {
+                                               $attachments[] = $attachment;
+                                       }
+                               }
+
+                               if (empty($card->toArray())) {
+                                       $card = $this->mstdnCardFactory->createFromUriId($shared_uri_id);
+                               }
+                       }
+
                        $item['body'] = $this->contentItem->addSharedPost($item);
 
                        if (!is_null($item['raw-body'])) {
index 6b1a64a5de899f8e211d22fd863d4587de1b5d6d..13f4aafd68b4606243dfbb551c65bf9cf37a4739 100644 (file)
@@ -113,11 +113,13 @@ class Statuses extends BaseApi
                        $items = Post::selectForUser($uid, ['uri-id'], $condition, $params);
                }
 
+               $display_quotes = self::appSupportsQuotes();
+
                $statuses = [];
                while ($item = Post::fetch($items)) {
                        self::setBoundaries($item['uri-id']);
                        try {
-                               $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+                               $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, $display_quotes);
                        } catch (\Throwable $th) {
                                Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
                        }
index b027836ef4e27310ea568d32a4542a4f2b247227..b1e76f87f4dd7bcfd6dc127e11612967bf2f651f 100644 (file)
@@ -69,10 +69,12 @@ class Bookmarks extends BaseApi
 
                $items = Post::selectThreadForUser($uid, ['uri-id'], $condition, $params);
 
+               $display_quotes = self::appSupportsQuotes();
+
                $statuses = [];
                while ($item = Post::fetch($items)) {
                        self::setBoundaries($item['uri-id']);
-                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, $display_quotes);
                }
                DBA::close($items);
 
index 941c4a5530abdced9eaaaaa8c6e05108c9e7c39d..82bf11ebf8794bf0f52e9319214e0c0fbb778898 100644 (file)
@@ -45,8 +45,9 @@ class Favourited extends BaseApi
 
                $request = $this->getRequest([
                        'limit'      => 20,    // Maximum number of results to return. Defaults to 20.
-                       'min_id'     => 0,     // Return results immediately newer than id
                        'max_id'     => 0,     // Return results older than id
+                       'since_id'   => 0,     // Return results newer than this ID. Use HTTP Link header to paginate.
+                       'min_id'     => 0,     // Return results immediately newer than id
                        'with_muted' => false, // Pleroma extension: return activities by muted (not by blocked!) users.
                ], $request);
 
@@ -58,6 +59,10 @@ class Favourited extends BaseApi
                        $condition = DBA::mergeConditions($condition, ["`thr-parent-id` < ?", $request['max_id']]);
                }
 
+               if (!empty($request['since_id'])) {
+                       $condition = DBA::mergeConditions($condition, ["`thr-parent-id` > ?", $request['since_id']]);
+               }
+
                if (!empty($request['min_id'])) {
                        $condition = DBA::mergeConditions($condition, ["`thr-parent-id` > ?", $request['min_id']]);
 
@@ -66,10 +71,12 @@ class Favourited extends BaseApi
 
                $items = Post::selectForUser($uid, ['thr-parent-id'], $condition, $params);
 
+               $display_quotes = self::appSupportsQuotes();
+
                $statuses = [];
                while ($item = Post::fetch($items)) {
                        self::setBoundaries($item['thr-parent-id']);
-                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['thr-parent-id'], $uid);
+                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['thr-parent-id'], $uid, true, true, $display_quotes);
                }
                DBA::close($items);
 
index 72500cb62846f6cdfdaf4d06c49f8d05f2365e97..90bd50e6778d08135773887f3c5acf8d67b4967f 100644 (file)
@@ -142,7 +142,7 @@ class Search extends BaseApi
                        // If the user-specific search failed, we search and probe a public post
                        $item_id = Item::fetchByLink($q, $uid) ?: Item::fetchByLink($q);
                        if ($item_id && $item = Post::selectFirst(['uri-id'], ['id' => $item_id])) {
-                               return DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+                               return DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, self::appSupportsQuotes());
                        }
                }
 
@@ -176,10 +176,12 @@ class Search extends BaseApi
 
                $items = DBA::select($table, ['uri-id'], $condition, $params);
 
+               $display_quotes = self::appSupportsQuotes();
+
                $statuses = [];
                while ($item = Post::fetch($items)) {
                        self::setBoundaries($item['uri-id']);
-                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, $display_quotes);
                }
                DBA::close($items);
 
index 7419cccb38b6e2aa4c1e980c1a84d1160ea81425..993b827c3c9c7e935db5525d8232a684c4fe28b7 100644 (file)
@@ -88,7 +88,7 @@ class Statuses extends BaseApi
                Item::update($item, ['id' => $post['id']]);
                Item::updateDisplayCache($post['uri-id']);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($post['uri-id'], $uid));
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($post['uri-id'], $uid, true, true, self::appSupportsQuotes()));
        }
 
        protected function post(array $request = [])
@@ -269,7 +269,7 @@ class Statuses extends BaseApi
                if (!empty($id)) {
                        $item = Post::selectFirst(['uri-id'], ['id' => $id]);
                        if (!empty($item['uri-id'])) {
-                               System::jsonExit(DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid));
+                               System::jsonExit(DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, self::appSupportsQuotes()));
                        }
                }
 
@@ -308,7 +308,7 @@ class Statuses extends BaseApi
                        DI::mstdnError()->UnprocessableEntity();
                }
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, false));
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, false, true, self::appSupportsQuotes()));
        }
 
        private function getApp(): string
index 7696995596941b3712d707a9f18d59e555fe4fb1..b09a79afea0ac5f754b0bdabb64144d9f4395d68 100644 (file)
@@ -65,6 +65,6 @@ class Bookmark extends BaseApi
 
                Item::update(['starred' => true], ['id' => $item['id']]);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index c18a003d5634dda34406fe350d03f2a321527d4b..3fe3e5a4d2188de8ec823468448d5b6eb42b84c3 100644 (file)
@@ -45,6 +45,9 @@ class Context extends BaseApi
                }
 
                $request = $this->getRequest([
+                       'max_id'   => 0,  // Return results older than this id
+                       'since_id' => 0,  // Return results newer than this id
+                       'min_id'   => 0,  // Return results immediately newer than this id
                        'limit'    => 40, // Maximum number of results to return. Defaults to 40.
                ], $request);
 
@@ -55,17 +58,36 @@ class Context extends BaseApi
 
                $parent = Post::selectFirst(['parent-uri-id'], ['uri-id' => $id]);
                if (DBA::isResult($parent)) {
-                       $posts = Post::selectPosts(['uri-id', 'thr-parent-id'],
-                               ['parent-uri-id' => $parent['parent-uri-id'], 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]]);
+                       $params    = ['order' => ['uri-id' => true]];
+                       $condition = ['parent-uri-id' => $parent['parent-uri-id'], 'gravity' => [Item::GRAVITY_PARENT, Item::GRAVITY_COMMENT]];
+
+                       if (!empty($request['max_id'])) {
+                               $condition = DBA::mergeConditions($condition, ["`uri-id` < ?", $request['max_id']]);
+                       }
+       
+                       if (!empty($request['since_id'])) {
+                               $condition = DBA::mergeConditions($condition, ["`uri-id` > ?", $request['since_id']]);
+                       }
+       
+                       if (!empty($request['min_id'])) {
+                               $condition = DBA::mergeConditions($condition, ["`uri-id` > ?", $request['min_id']]);
+                               $params['order'] = ['uri-id'];
+                       }
+       
+                       $posts = Post::selectPosts(['uri-id', 'thr-parent-id'], $condition, $params);
                        while ($post = Post::fetch($posts)) {
                                if ($post['uri-id'] == $post['thr-parent-id']) {
                                        continue;
                                }
+                               self::setBoundaries($post['uri-id']);
+
                                $parents[$post['uri-id']] = $post['thr-parent-id'];
 
                                $children[$post['thr-parent-id']][] = $post['uri-id'];
                        }
                        DBA::close($posts);
+
+                       self::setLinkHeader();
                } else {
                        $parent = DBA::selectFirst('mail', ['parent-uri-id'], ['uri-id' => $id, 'uid' => $uid]);
                        if (DBA::isResult($parent)) {
@@ -90,8 +112,10 @@ class Context extends BaseApi
 
                asort($ancestors);
 
+               $display_quotes = self::appSupportsQuotes();
+
                foreach (array_slice($ancestors, 0, $request['limit']) as $ancestor) {
-                       $statuses['ancestors'][] = DI::mstdnStatus()->createFromUriId($ancestor, $uid);;
+                       $statuses['ancestors'][] = DI::mstdnStatus()->createFromUriId($ancestor, $uid, true, true, $display_quotes);;
                }
 
                $descendants = self::getChildren($id, $children);
@@ -99,7 +123,7 @@ class Context extends BaseApi
                asort($descendants);
 
                foreach (array_slice($descendants, 0, $request['limit']) as $descendant) {
-                       $statuses['descendants'][] = DI::mstdnStatus()->createFromUriId($descendant, $uid);
+                       $statuses['descendants'][] = DI::mstdnStatus()->createFromUriId($descendant, $uid, true, true, $display_quotes);
                }
 
                System::jsonExit($statuses);
index ed23891f0293341320c817ff25032d7bb322fefd..07e1771d9031184c12a3386393be75f6bd5f1a10 100644 (file)
@@ -49,6 +49,6 @@ class Favourite extends BaseApi
 
                Item::performActivity($item['id'], 'like', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid,true, true, self::appSupportsQuotes())->toArray());
        }
 }
index f00a7b6d5bcdb8dd620957be6c636e48cfecd5f7..29d6629612c9708aea178778ed1e2ad37c5438a9 100644 (file)
@@ -53,6 +53,6 @@ class Mute extends BaseApi
 
                Post\ThreadUser::setIgnored($this->parameters['id'], $uid, true);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index b5eb619d1e66b0e8bdec6ab4d603e417e9734d7b..1ca588c1aa71ed71e8580079c1cfabeb580f7954 100644 (file)
@@ -48,6 +48,6 @@ class Pin extends BaseApi
 
                Post\Collection::add($this->parameters['id'], Post\Collection::FEATURED, $item['author-id'], $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index 631f3e8fe1bf98a05c8c2c2f461f20e18cb09fdf..b705f6d493d6fab14a6ba9d0e227a21aa265fd32 100644 (file)
@@ -58,6 +58,6 @@ class Reblog extends BaseApi
                        Item::performActivity($item['id'], 'announce', $uid);
                }
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index d49a661367e250415522ec143c3f46282872d8e8..acc64a8103b80fd770a5379688e5aada0a048100 100644 (file)
@@ -65,6 +65,6 @@ class Unbookmark extends BaseApi
 
                Item::update(['starred' => false], ['id' => $item['id']]);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index a096ed7d6a3429b213f9d993dde824c265c45c87..f8a33319f173a2f61a892a3dcd3fd116b09f9e2d 100644 (file)
@@ -49,6 +49,6 @@ class Unfavourite extends BaseApi
 
                Item::performActivity($item['id'], 'unlike', $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index ed700eeb01d2c73defb4c9a7752744df963ac89c..41b4cbd14ec02c06bbb5d53222c31dfbe1528358 100644 (file)
@@ -53,6 +53,6 @@ class Unmute extends BaseApi
 
                Post\ThreadUser::setIgnored($this->parameters['id'], $uid, false);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index 61df4a2dbbb03230d02c7e97b716e540c66713f6..13c57158efcb7c9628d1478314b3e54a024c9ff7 100644 (file)
@@ -48,6 +48,6 @@ class Unpin extends BaseApi
 
                Post\Collection::remove($this->parameters['id'], Post\Collection::FEATURED, $uid);
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index d9c21be37357ba4a639c4cc986892e988582d7c5..060d46bd864afa44323bde4e221b6337fca4be59 100644 (file)
@@ -64,6 +64,6 @@ class Unreblog extends BaseApi
                        Item::performActivity($item['id'], 'unannounce', $uid);
                }
 
-               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid)->toArray());
+               System::jsonExit(DI::mstdnStatus()->createFromUriId($this->parameters['id'], $uid, true, true, self::appSupportsQuotes())->toArray());
        }
 }
index a9a01a813ccefa04cc340c383d0f442a684d610e..8894f0979aa8302e1e066541582969aa9f7949de 100644 (file)
@@ -21,6 +21,7 @@
 
 namespace Friendica\Module\Api\Mastodon\Timelines;
 
+use Friendica\Core\Logger;
 use Friendica\Core\System;
 use Friendica\Database\DBA;
 use Friendica\DI;
@@ -91,10 +92,12 @@ class Home extends BaseApi
 
                $items = Post::selectForUser($uid, ['uri-id'], $condition, $params);
 
+               $display_quotes = self::appSupportsQuotes();
+
                $statuses = [];
                while ($item = Post::fetch($items)) {
                        self::setBoundaries($item['uri-id']);
-                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, $display_quotes);
                }
                DBA::close($items);
 
index dbfa277f72d59a9d6287247824408626befd2d09..a538a49f03b936c3701c702c955df15f417972e7 100644 (file)
@@ -96,10 +96,12 @@ class ListTimeline extends BaseApi
 
                $items = Post::selectForUser($uid, ['uri-id'], $condition, $params);
 
+               $display_quotes = self::appSupportsQuotes();
+
                $statuses = [];
                while ($item = Post::fetch($items)) {
                        self::setBoundaries($item['uri-id']);
-                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, $display_quotes);
                }
                DBA::close($items);
 
index 9aeb54e0840665ade5b46483d99b4c0fb4e77b12..fe3fda82c6feeb7d6f908e442bc814b42f2ec8af 100644 (file)
@@ -97,11 +97,13 @@ class PublicTimeline extends BaseApi
 
                $items = Post::selectPostsForUser($uid, ['uri-id'], $condition, $params);
 
+               $display_quotes = self::appSupportsQuotes();
+
                $statuses = [];
                while ($item = Post::fetch($items)) {
                        self::setBoundaries($item['uri-id']);
                        try {
-                               $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+                               $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, $display_quotes);
                        } catch (\Throwable $th) {
                                Logger::info('Post not fetchable', ['uri-id' => $item['uri-id'], 'uid' => $uid, 'error' => $th]);
                        }
index dea8aee5af502a6961568de870c78faa22eeeafe..75df46259505197a512d8b3a4255ad713b1f3911 100644 (file)
@@ -105,10 +105,12 @@ class Tag extends BaseApi
 
                $items = DBA::select('tag-search-view', ['uri-id'], $condition, $params);
 
+               $display_quotes = self::appSupportsQuotes();
+
                $statuses = [];
                while ($item = Post::fetch($items)) {
                        self::setBoundaries($item['uri-id']);
-                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid);
+                       $statuses[] = DI::mstdnStatus()->createFromUriId($item['uri-id'], $uid, true, true, $display_quotes);
                }
                DBA::close($items);
 
index f9411465c64dc308aca4329fab84a68c469a7304..2b323b80626d8872acfa9598d61287bf55db583d 100644 (file)
@@ -48,10 +48,12 @@ class Statuses extends BaseApi
                $condition = ["NOT `private` AND `commented` > ? AND `created` > ?", DateTimeFormat::utc('now -1 day'), DateTimeFormat::utc('now -1 week')];
                $condition = DBA::mergeConditions($condition, ['network' => Protocol::FEDERATED]);
 
+               $display_quotes = self::appSupportsQuotes();
+
                $trending = [];
                $statuses = Post::selectPostThread(['uri-id'], $condition, ['limit' => $request['limit'], 'order' => ['total-actors' => true]]);
                while ($status = Post::fetch($statuses)) {
-                       $trending[] = DI::mstdnStatus()->createFromUriId($status['uri-id'], $uid);
+                       $trending[] = DI::mstdnStatus()->createFromUriId($status['uri-id'], $uid, true, true, $display_quotes);
                }
                DBA::close($statuses);
 
index 29ca755e05f949522189a5ee91111de259748dcd..6a41198473b2cb99225761dfb0997728383e249b 100644 (file)
@@ -180,6 +180,17 @@ class BaseApi extends BaseModule
                }
        }
 
+       /**
+        * Check if the app is known to support quoted posts
+        *
+        * @return bool
+        */
+       public static function appSupportsQuotes(): bool
+       {
+               $token = self::getCurrentApplication();
+               return (!empty($token['name']) && in_array($token['name'], ['Fedilab']));
+       }
+
        /**
         * Get current application token
         *