* Fetches the object type for a given object id
*
* @param array $activity
- * @param string $object_id Object ID of the the provided object
+ * @param string $object_id Object ID of the provided object
* @param integer $uid User ID
*
* @return string with object type or NULL
$object_data['object_activity'] = $activity;
}
- if (($type == 'as:Create') && $trust_source) {
+ if (($type == 'as:Create') && $trust_source && !in_array($completion, [self::COMPLETION_MANUAL, self::COMPLETION_ANNOUNCE])) {
if (self::hasArrived($object_data['object_id'])) {
Logger::info('The activity already arrived.', ['id' => $object_data['object_id']]);
return true;
Logger::info('The activity is already added.', ['id' => $object_data['object_id']]);
return true;
}
+ } elseif (($type == 'as:Create') && $trust_source && !self::hasArrived($object_data['object_id'])) {
+ self::addArrivedId($object_data['object_id']);
}
$decouple = DI::config()->get('system', 'decoupled_receiver') && !in_array($completion, [self::COMPLETION_MANUAL, self::COMPLETION_ANNOUNCE]);
self::switchContacts($receivers, $actor);
// "birdsitelive" is a service that mirrors tweets into the fediverse
- // These posts can be fetched without authentification, but are not marked as public
+ // These posts can be fetched without authentication, but are not marked as public
// We treat them as unlisted posts to be able to handle them.
if (empty($receivers) && $fetch_unlisted && Contact::isPlatform($actor, 'birdsitelive')) {
$receivers[0] = ['uid' => 0, 'type' => self::TARGET_GLOBAL];
}
/**
- * Fetches the object data from external ressources if needed
+ * Fetches the object data from external resources if needed
*
- * @param string $object_id Object ID of the the provided object
+ * @param string $object_id Object ID of the provided object
* @param array $object The provided object array
* @param boolean $trust_source Do we trust the provided object?
* @param integer $uid User ID for the signature that we use to fetch data