use Friendica\Model\User;
use Friendica\Network\HTTPClient\Client\HttpClientAccept;
use Friendica\Network\HTTPException;
-use Friendica\Network\HTTPException\BadRequestException;
use Friendica\Network\Probe;
use Friendica\Protocol\Delivery;
use Friendica\Util\Crypto;
if ($no_exit) {
return false;
} else {
- throw new BadRequestException();
+ throw new HTTPException\BadRequestException();
}
}
} else {
if ($no_exit) {
return false;
} else {
- throw new BadRequestException();
+ throw new HTTPException\BadRequestException();
}
}
if ($no_exit) {
return false;
} else {
- throw new BadRequestException();
+ throw new HTTPException\BadRequestException();
}
}
if ($no_exit) {
return false;
} else {
- throw new BadRequestException();
+ throw new HTTPException\BadRequestException();
}
}
if ($no_exit) {
return false;
} else {
- throw new BadRequestException();
+ throw new HTTPException\BadRequestException();
}
}
if (!$base) {
Logger::notice('unable to locate salmon data in xml');
- throw new BadRequestException();
+ throw new HTTPException\BadRequestException();
}
$key = self::key($author);
if (!$key) {
Logger::notice('Could not retrieve author key.');
- throw new BadRequestException();
+ throw new HTTPException\BadRequestException();
}
$verify = Crypto::rsaVerify($signed_data, $signature, $key);
if (!$verify) {
Logger::notice('Message did not verify. Discarding.');
- throw new BadRequestException();
+ throw new HTTPException\BadRequestException();
}
Logger::info('Message verified.');
$datarray = [
'guid' => $guid,
- 'uri-id' => ItemURI::insert(['uri' => $guid, 'guid' => $guid]),
+ 'plink' => self::plink($author, $guid),
'uid' => $importer['uid'],
'contact-id' => $contact['id'],
'network' => Protocol::DIASPORA,
'post-type' => Item::PT_NOTE,
];
- $datarray['guid'] = $guid;
- $datarray['uri'] = $datarray['thr-parent'] = self::getUriFromGuid($guid, $author);
- $datarray['uri-id'] = ItemURI::insert(['uri' => $datarray['uri'], 'guid' => $datarray['guid']]);
+ $datarray['uri'] = $datarray['thr-parent'] = self::getUriFromGuid($guid, $author);
+ $datarray['uri-id'] = ItemURI::insert(['uri' => $datarray['uri'], 'guid' => $datarray['guid']]);
+ $datarray['owner-link'] = $datarray['author-link'];
+ $datarray['owner-id'] = $datarray['author-id'];
+
+ $datarray = self::setDirection($datarray, $direction);
// Attach embedded pictures to the body
if ($data->photo) {
$datarray['object-type'] = Activity\ObjectType::IMAGE;
$datarray['post-type'] = Item::PT_IMAGE;
} elseif ($data->poll) {
- $datarray['object-type'] = Activity\ObjectType::NOTE;
$datarray['post-type'] = Item::PT_POLL;
}
$datarray['app'] = $provider_display_name;
}
- $datarray['plink'] = self::plink($author, $guid);
$datarray['changed'] = $datarray['created'] = $datarray['edited'] = $created_at;
if (isset($address['address'])) {