mirror of
https://git.sekbaer.de/Friendica/friendica.git
synced 2025-06-11 17:44:27 +02:00
More functions moved to content class
This commit is contained in:
parent
c65fff6f93
commit
deccea0228
10 changed files with 113 additions and 59 deletions
|
@ -23,9 +23,9 @@ namespace Friendica\Factory\Api\Mastodon;
|
|||
|
||||
use Friendica\BaseFactory;
|
||||
use Friendica\Content\ContactSelector;
|
||||
use Friendica\Content\Item as ContentItem;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\Database\DBA;
|
||||
use Friendica\DI;
|
||||
use Friendica\Model\Item;
|
||||
use Friendica\Model\Post;
|
||||
use Friendica\Model\Tag as TagModel;
|
||||
|
@ -54,11 +54,14 @@ class Status extends BaseFactory
|
|||
private $mstdnErrorFactory;
|
||||
/** @var Poll */
|
||||
private $mstdnPollFactory;
|
||||
/** @var ContentItem */
|
||||
private $contentItem;
|
||||
|
||||
public function __construct(LoggerInterface $logger, Database $dba,
|
||||
Account $mstdnAccountFactory, Mention $mstdnMentionFactory,
|
||||
Tag $mstdnTagFactory, Card $mstdnCardFactory,
|
||||
Attachment $mstdnAttachementFactory, Error $mstdnErrorFactory, Poll $mstdnPollFactory)
|
||||
Attachment $mstdnAttachementFactory, Error $mstdnErrorFactory,
|
||||
Poll $mstdnPollFactory, ContentItem $contentItem)
|
||||
{
|
||||
parent::__construct($logger);
|
||||
$this->dba = $dba;
|
||||
|
@ -69,6 +72,7 @@ class Status extends BaseFactory
|
|||
$this->mstdnAttachementFactory = $mstdnAttachementFactory;
|
||||
$this->mstdnErrorFactory = $mstdnErrorFactory;
|
||||
$this->mstdnPollFactory = $mstdnPollFactory;
|
||||
$this->contentItem = $contentItem;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -155,7 +159,7 @@ class Status extends BaseFactory
|
|||
$poll = null;
|
||||
}
|
||||
|
||||
$shared = DI::contentItem()->getSharedPost($item, ['uri-id']);
|
||||
$shared = $this->contentItem->getSharedPost($item, ['uri-id']);
|
||||
if (!empty($shared)) {
|
||||
$shared_uri_id = $shared['post']['uri-id'];
|
||||
|
||||
|
|
|
@ -22,10 +22,10 @@
|
|||
namespace Friendica\Factory\Api\Twitter;
|
||||
|
||||
use Friendica\BaseFactory;
|
||||
use Friendica\Content\Item as ContentItem;
|
||||
use Friendica\Content\Text\BBCode;
|
||||
use Friendica\Content\Text\HTML;
|
||||
use Friendica\Database\Database;
|
||||
use Friendica\DI;
|
||||
use Friendica\Factory\Api\Friendica\Activities;
|
||||
use Friendica\Factory\Api\Twitter\User as TwitterUser;
|
||||
use Friendica\Model\Item;
|
||||
|
@ -54,8 +54,10 @@ class Status extends BaseFactory
|
|||
private $activities;
|
||||
/** @var Activities entity */
|
||||
private $attachment;
|
||||
/** @var ContentItem */
|
||||
private $contentItem;
|
||||
|
||||
public function __construct(LoggerInterface $logger, Database $dba, TwitterUser $twitteruser, Hashtag $hashtag, Media $media, Url $url, Mention $mention, Activities $activities, Attachment $attachment)
|
||||
public function __construct(LoggerInterface $logger, Database $dba, TwitterUser $twitteruser, Hashtag $hashtag, Media $media, Url $url, Mention $mention, Activities $activities, Attachment $attachment, ContentItem $contentItem)
|
||||
{
|
||||
parent::__construct($logger);
|
||||
$this->dba = $dba;
|
||||
|
@ -66,6 +68,7 @@ class Status extends BaseFactory
|
|||
$this->mention = $mention;
|
||||
$this->activities = $activities;
|
||||
$this->attachment = $attachment;
|
||||
$this->contentItem = $contentItem;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -179,7 +182,7 @@ class Status extends BaseFactory
|
|||
|
||||
$friendica_activities = $this->activities->createFromUriId($item['uri-id'], $uid);
|
||||
|
||||
$shared = DI::contentItem()->getSharedPost($item, ['uri-id']);
|
||||
$shared = $this->contentItem->getSharedPost($item, ['uri-id']);
|
||||
if (!empty($shared)) {
|
||||
$shared_uri_id = $shared['post']['uri-id'];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue