'uid', 'title', 'body', 'guid', 'contact-id', 'private', 'created', 'received', 'app', 'location', 'coord', 'network',
'event-id', 'resource-id', 'author-link', 'author-avatar', 'author-name', 'plink', 'owner-link', 'uri-id'
];
- $condition = ['wall' => true, 'private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
+ $condition = ['origin' => true, 'private' => [Item::PUBLIC, Item::UNLISTED], 'guid' => $guid,
+ 'gravity' => [GRAVITY_PARENT, GRAVITY_COMMENT], 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
$item = Post::selectFirst($fields, $condition);
if (empty($item)) {
$condition = ['guid' => $guid, 'network' => [Protocol::DFRN, Protocol::DIASPORA]];
throw new HTTPException\NotFoundException();
}
- $status = Diaspora::buildStatus($item, $user);
+ if ($item['gravity'] == GRAVITY_PARENT) {
+ $status = Diaspora::buildStatus($item, $user);
+ } else {
+ $status = Diaspora::constructComment($item, $user);
+ }
+
$xml = Diaspora::buildPostXml($status["type"], $status["message"]);
// Send the envelope
* @return array|false The data for a comment
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
*/
- private static function constructComment(array $item, array $owner)
+ public static function constructComment(array $item, array $owner)
{
$cachekey = "diaspora:constructComment:".$item['guid'];