$object_type = self::fetchObjectType($activity, $object_id, $uid);
// Fetch the content only on activities where this matters
- if (in_array($type, ['as:Create', 'as:Update', 'as:Announce'])) {
+ // We can receive "#emojiReaction" when fetching content from Hubzilla systems
+ if (in_array($type, ['as:Create', 'as:Update', 'as:Announce']) || strpos($type, '#emojiReaction')) {
// Always fetch on "Announce"
$object_data = self::fetchObject($object_id, $activity['as:object'], $trust_source && ($type != 'as:Announce'), $uid);
if (empty($object_data)) {
if (!empty($activity['from-relay'])) {
$object_data['from-relay'] = $activity['from-relay'];
}
-
+
switch ($type) {
case 'as:Create':
if (in_array($object_data['object_type'], self::CONTENT_TYPES)) {
* @param array $activity
* @param string $actor
* @param array $tags
- * @param boolean $fetch_unlisted
+ * @param boolean $fetch_unlisted
*
* @return array with receivers (user id)
* @throws \Exception
$receivers[0] = ['uid' => 0, 'type' => self::TARGET_GLOBAL];
}
- // Add receiver "-1" for unlisted posts
+ // Add receiver "-1" for unlisted posts
if ($fetch_unlisted && ($receiver == self::PUBLIC_COLLECTION) && ($element == 'as:cc')) {
$receivers[-1] = ['uid' => -1, 'type' => self::TARGET_GLOBAL];
}
Logger::info('Empty id');
return false;
}
-
+
if ($id != $object_id) {
Logger::info('Fetched id differs from provided id', ['provided' => $object_id, 'fetched' => $id]);
return false;
if (empty($object['as:url'])) {
return $object_data;
}
-
+
$urls = $object['as:url'];
$keys = array_keys($urls);
if (!is_numeric(array_pop($keys))) {
* @return array
* @throws \Exception
*/
- private static function processObject($object)
+ public static function processObject($object)
{
if (!JsonLD::fetchElement($object, '@id')) {
return false;