Fix notices because of unknown Hubzilla activity type
This commit is contained in:
parent
d6c1e1fd1c
commit
90897f36ca
|
@ -192,10 +192,6 @@ class Processor
|
||||||
*/
|
*/
|
||||||
public static function createItem($activity)
|
public static function createItem($activity)
|
||||||
{
|
{
|
||||||
if (empty($activity['reply-to-id'])) {
|
|
||||||
$activity['reply-to-id'] = $activity['id'];
|
|
||||||
}
|
|
||||||
|
|
||||||
$item = [];
|
$item = [];
|
||||||
$item['verb'] = Activity::POST;
|
$item['verb'] = Activity::POST;
|
||||||
$item['thr-parent'] = $activity['reply-to-id'];
|
$item['thr-parent'] = $activity['reply-to-id'];
|
||||||
|
|
|
@ -333,7 +333,8 @@ class Receiver
|
||||||
$object_type = self::fetchObjectType($activity, $object_id, $uid);
|
$object_type = self::fetchObjectType($activity, $object_id, $uid);
|
||||||
|
|
||||||
// Fetch the content only on activities where this matters
|
// 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"
|
// Always fetch on "Announce"
|
||||||
$object_data = self::fetchObject($object_id, $activity['as:object'], $trust_source && ($type != 'as:Announce'), $uid);
|
$object_data = self::fetchObject($object_id, $activity['as:object'], $trust_source && ($type != 'as:Announce'), $uid);
|
||||||
if (empty($object_data)) {
|
if (empty($object_data)) {
|
||||||
|
@ -1299,7 +1300,7 @@ class Receiver
|
||||||
* @return array
|
* @return array
|
||||||
* @throws \Exception
|
* @throws \Exception
|
||||||
*/
|
*/
|
||||||
private static function processObject($object)
|
public static function processObject($object)
|
||||||
{
|
{
|
||||||
if (!JsonLD::fetchElement($object, '@id')) {
|
if (!JsonLD::fetchElement($object, '@id')) {
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user