/**
* Checks incoming message from the inbox
*
- * @param $body
- * @param $header
+ * @param string $body Body string
+ * @param array $header Header lines
* @param integer $uid User ID
+ * @return void
* @throws \Exception
- * @todo Find type for $body/$header
*/
- public static function processInbox($body, $header, int $uid)
+ public static function processInbox(string $body, array $header, int $uid)
{
$activity = json_decode($body, true);
if (empty($activity)) {
$ldactivity = JsonLD::compact($activity);
- $actor = JsonLD::fetchElement($ldactivity, 'as:actor', '@id');
-
+ $actor = JsonLD::fetchElement($ldactivity, 'as:actor', '@id') ?? '';
$apcontact = APContact::getByURL($actor);
+
if (empty($apcontact)) {
Logger::notice('Unable to retrieve AP contact for actor - message is discarded', ['actor' => $actor]);
return;
*/
private static function getReceivers(array $activity, string $actor, array $tags = [], bool $fetch_unlisted = false): array
{
- $reply = $receivers = [];
+ $reply = $receivers = $profile = [];
// When it is an answer, we inherite the receivers from the parent
$replyto = JsonLD::fetchElement($activity, 'as:inReplyTo', '@id');
* @param integer $cid Contact ID
* @param integer $uid User ID
* @param string $url Profile URL
+ * @return void
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/
*
* @param $receivers
* @param $actor
+ * @return void
* @throws \Friendica\Network\HTTPException\InternalServerErrorException
* @throws \ImagickException
*/