Logger::debug('Add post to featured collection', ['uri-id' => $uriid]);
Post\Collection::add($uriid, Post\Collection::FEATURED);
+ Receiver::removeFromQueue($activity);
}
/**
Logger::debug('Remove post from featured collection', ['uri-id' => $uriid]);
Post\Collection::remove($uriid, Post\Collection::FEATURED);
+ Receiver::removeFromQueue($activity);
}
/**
$condition = ['id' => $cid];
Contact::update($fields, $condition);
Logger::info('Accept contact request', ['contact' => $cid, 'user' => $uid]);
+ Receiver::removeFromQueue($activity);
}
/**
} else {
Logger::info('Rejected contact request', ['contact' => $cid, 'user' => $uid]);
}
+ Receiver::removeFromQueue($activity);
}
/**
}
Item::markForDeletion(['uri' => $activity['object_id'], 'author-id' => $author_id, 'gravity' => GRAVITY_ACTIVITY]);
+ Receiver::removeFromQueue($activity);
}
/**
Contact::removeFollower($contact);
Logger::info('Undo following request', ['contact' => $cid, 'user' => $uid]);
+ Receiver::removeFromQueue($activity);
}
/**
if (empty($apcontact)) {
Logger::notice('Unable to retrieve AP contact for actor - message is discarded', ['actor' => $actor]);
return;
- } elseif ($apcontact['type'] == 'Application' && $apcontact['nick'] == 'relay') {
+ } elseif (APContact::isRelay($apcontact)) {
self::processRelayPost($ldactivity, $actor);
return;
} else {
{
$type = JsonLD::fetchElement($activity, '@type');
if (!$type) {
- Logger::info('Empty type', ['activity' => $activity]);
+ Logger::info('Empty type', ['activity' => $activity, 'actor' => $actor]);
return;
}
if ($type != 'as:Announce') {
- Logger::info('Not an announcement', ['activity' => $activity]);
+ Logger::info('Not an announcement', ['activity' => $activity, 'actor' => $actor]);
return;
}
$object_id = JsonLD::fetchElement($activity, 'as:object', '@id');
if (empty($object_id)) {
- Logger::info('No object id found', ['activity' => $activity]);
+ Logger::info('No object id found', ['activity' => $activity, 'actor' => $actor]);
return;
}
return;
}
- Logger::info('Got relayed message id', ['id' => $object_id]);
+ Logger::info('Got relayed message id', ['id' => $object_id, 'actor' => $actor]);
$item_id = Item::searchByLink($object_id);
if ($item_id) {
- Logger::info('Relayed message already exists', ['id' => $object_id, 'item' => $item_id]);
+ Logger::info('Relayed message already exists', ['id' => $object_id, 'item' => $item_id, 'actor' => $actor]);
return;
}
$id = Processor::fetchMissingActivity($fetchQueue, $object_id, [], $actor, self::COMPLETION_RELAY);
if (empty($id)) {
- Logger::notice('Relayed message had not been fetched', ['id' => $object_id]);
+ Logger::notice('Relayed message had not been fetched', ['id' => $object_id, 'actor' => $actor]);
return;
}
$item_id = Item::searchByLink($object_id);
if ($item_id) {
- Logger::info('Relayed message had been fetched and stored', ['id' => $object_id, 'item' => $item_id]);
+ Logger::info('Relayed message had been fetched and stored', ['id' => $object_id, 'item' => $item_id, 'actor' => $actor]);
} else {
- Logger::notice('Relayed message had not been stored', ['id' => $object_id]);
+ Logger::notice('Relayed message had not been stored', ['id' => $object_id, 'actor' => $actor]);
}
}
ActivityPub\Processor::postItem($object_data, $item);
} elseif (in_array($object_data['object_type'], ['pt:CacheFile'])) {
// Unhandled Peertube activity
+ self::removeFromQueue($object_data);
} else {
self::storeUnhandledActivity(true, $type, $object_data, $activity, $body, $uid, $trust_source, $push, $signer);
}
ActivityPub\Processor::updatePerson($object_data);
} elseif (in_array($object_data['object_type'], ['pt:CacheFile'])) {
// Unhandled Peertube activity
+ self::removeFromQueue($object_data);
} else {
self::storeUnhandledActivity(true, $type, $object_data, $activity, $body, $uid, $trust_source, $push, $signer);
}
} elseif (in_array($object_data['object_type'], array_merge(self::ACTIVITY_TYPES, ['as:Announce', 'as:Create', ''])) &&
empty($object_data['object_object_type'])) {
// We cannot detect the target object. So we can ignore it.
+ self::removeFromQueue($object_data);
} elseif (in_array($object_data['object_type'], ['as:Create']) &&
in_array($object_data['object_object_type'], ['pt:CacheFile'])) {
// Unhandled Peertube activity
+ self::removeFromQueue($object_data);
} else {
self::storeUnhandledActivity(true, $type, $object_data, $activity, $body, $uid, $trust_source, $push, $signer);
}
ActivityPub\Processor::createActivity($fetchQueue, $object_data, Activity::VIEW);
} elseif ($object_data['object_type'] == '') {
// The object type couldn't be determined. Most likely we don't have it here. We ignore this activity.
+ self::removeFromQueue($object_data);
} else {
self::storeUnhandledActivity(true, $type, $object_data, $activity, $body, $uid, $trust_source, $push, $signer);
}
private static function storeUnhandledActivity(bool $unknown, string $type, array $object_data, array $activity, string $body = '', int $uid = null, bool $trust_source = false, bool $push = false, array $signer = [])
{
if (!DI::config()->get('debug', 'ap_log_unknown')) {
+ self::removeFromQueue($activity);
return;
}