X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FProtocol%2FFeed.php;h=a9e50d532ca9cdf749b668ef1dffc24bcf75440b;hb=24ee87224f5ca8bdce7adc4d571d5ece36b72471;hp=907479776c37f6745e1d57ed0ae188328cd53d4a;hpb=c714595b70de3afbcd0b1e856866ae8983bf6ed1;p=friendica.git diff --git a/src/Protocol/Feed.php b/src/Protocol/Feed.php index 907479776c..a9e50d532c 100644 --- a/src/Protocol/Feed.php +++ b/src/Protocol/Feed.php @@ -26,7 +26,7 @@ use DOMXPath; use Friendica\Content\PageInfo; use Friendica\Content\Text\BBCode; use Friendica\Content\Text\HTML; -use Friendica\Core\Cache\Duration; +use Friendica\Core\Cache\Enum\Duration; use Friendica\Core\Logger; use Friendica\Core\Protocol; use Friendica\Database\DBA; @@ -913,7 +913,7 @@ class Feed $root = self::addHeader($doc, $owner, $filter); foreach ($items as $item) { - $entry = self::entry($doc, $item, $owner); + $entry = self::noteEntry($doc, $item, $owner); $root->appendChild($entry); if ($last_update < $item['created']) { @@ -1003,69 +1003,6 @@ class Feed return $author; } - /** - * Adds an entry element to the XML document - * - * @param DOMDocument $doc XML document - * @param array $item Data of the item that is to be posted - * @param array $owner Contact data of the poster - * @param bool $toplevel optional default false - * - * @return \DOMElement Entry element - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - * @throws \ImagickException - */ - private static function entry(DOMDocument $doc, array $item, array $owner) - { - $xml = null; - - $repeated_guid = OStatus::getResharedGuid($item); - if ($repeated_guid != "") { - $xml = self::reshareEntry($doc, $item, $owner, $repeated_guid); - } - - if ($xml) { - return $xml; - } - - return self::noteEntry($doc, $item, $owner); - } - - /** - * Adds an entry element with reshared content - * - * @param DOMDocument $doc XML document - * @param array $item Data of the item that is to be posted - * @param array $owner Contact data of the poster - * @param string $repeated_guid guid - * @param bool $toplevel Is it for en entry element (false) or a feed entry (true)? - * - * @return bool Entry element - * @throws \Friendica\Network\HTTPException\InternalServerErrorException - * @throws \ImagickException - */ - private static function reshareEntry(DOMDocument $doc, array $item, array $owner, $repeated_guid) - { - if (($item['gravity'] != GRAVITY_PARENT) && (Strings::normaliseLink($item["author-link"]) != Strings::normaliseLink($owner["url"]))) { - Logger::info('Feed entry author does not match feed owner', ['owner' => $owner["url"], 'author' => $item["author-link"]]); - } - - $entry = OStatus::entryHeader($doc, $owner, $item, false); - - $condition = ['uid' => $owner["uid"], 'guid' => $repeated_guid, 'private' => [Item::PUBLIC, Item::UNLISTED], - 'network' => Protocol::FEDERATED]; - $repeated_item = Post::selectFirst(Item::DELIVER_FIELDLIST, $condition); - if (!DBA::isResult($repeated_item)) { - return false; - } - - self::entryContent($doc, $entry, $item, self::getTitle($repeated_item), Activity::SHARE, false); - - self::entryFooter($doc, $entry, $item, $owner); - - return $entry; - } - /** * Adds a regular entry element *