"uri-id" instead of "uri" or "id"

This commit is contained in:
Michael 2021-01-27 10:01:42 +00:00
parent a7b07b6e2e
commit ef0400fc19
11 changed files with 130 additions and 147 deletions

View file

@ -310,23 +310,26 @@ class DFRN
}
/**
* Generate an atom entry for a given item id
* Generate an atom entry for a given uri id and user
*
* @param int $item_id The item id
* @param int $uri_id The uri id
* @param int $uid The user id
* @param boolean $conversation Show the conversation. If false show the single post.
*
* @return string DFRN feed entry
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
public static function itemFeed($item_id, $conversation = false)
public static function itemFeed(int $uri_id, int $uid, bool $conversation = false)
{
if ($conversation) {
$condition = ['parent' => $item_id];
$condition = ['parent-uri-id' => $uri_id];
} else {
$condition = ['id' => $item_id];
$condition = ['uri-id' => $uri_id];
}
$condition['uid'] = $uid;
$items = Post::selectToArray(Item::DELIVER_FIELDLIST, $condition);
if (!DBA::isResult($items)) {
return '';