Fix notices because of unknown Hubzilla activity type

This commit is contained in:
Michael 2021-07-09 19:30:41 +00:00
parent d6c1e1fd1c
commit 90897f36ca
2 changed files with 8 additions and 11 deletions

View file

@ -192,10 +192,6 @@ class Processor
*/
public static function createItem($activity)
{
if (empty($activity['reply-to-id'])) {
$activity['reply-to-id'] = $activity['id'];
}
$item = [];
$item['verb'] = Activity::POST;
$item['thr-parent'] = $activity['reply-to-id'];

View file

@ -333,7 +333,8 @@ class Receiver
$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)) {
@ -1299,7 +1300,7 @@ class Receiver
* @return array
* @throws \Exception
*/
private static function processObject($object)
public static function processObject($object)
{
if (!JsonLD::fetchElement($object, '@id')) {
return false;