mirror of
https://github.com/friendica/friendica
synced 2025-05-22 06:24:12 +02:00
The legacy reshare functionality is removed
This commit is contained in:
parent
ac9e5df614
commit
d20aa5f557
2 changed files with 1 additions and 180 deletions
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue