1
0
Fork 0

Several fixes

This commit is contained in:
Michael 2018-10-07 19:42:04 +00:00
commit 93866b477a
4 changed files with 6 additions and 8 deletions

View file

@ -39,8 +39,6 @@ class ActivityPub
'manuallyApprovesFollowers' => 'as:manuallyApprovesFollowers',
'sensitive' => 'as:sensitive', 'Hashtag' => 'as:Hashtag']];
const ACCOUNT_TYPES = ['Person', 'Organization', 'Service', 'Group', 'Application'];
const CONTENT_TYPES = ['Note', 'Article', 'Video', 'Image'];
const ACTIVITY_TYPES = ['Like', 'Dislike', 'Accept', 'Reject', 'TentativeAccept'];
/**
* Checks if the web request is done for the AP protocol
*

View file

@ -272,7 +272,7 @@ class Processor
*/
public static function followUser($activity)
{
$uid = User::getIdForURL($activity['object_actor']);
$uid = User::getIdForURL($activity['object_id']);
if (empty($uid)) {
return;
}
@ -326,12 +326,12 @@ class Processor
*/
public static function deletePerson($activity)
{
if (empty($activity['object_id']) || empty($activity['object_actor'])) {
if (empty($activity['object_id']) || empty($activity['actor'])) {
logger('Empty object id or actor.', LOGGER_DEBUG);
return;
}
if ($activity['object_id'] != $activity['object_actor']) {
if ($activity['object_id'] != $activity['actor']) {
logger('Object id does not match actor.', LOGGER_DEBUG);
return;
}

View file

@ -166,7 +166,7 @@ class Receiver
$object_data = self::processObject($activity);
$object_data['name'] = $type;
$object_data['author'] = JsonLD::fetchElement($activity, 'as:actor');
$object_data['object'] = $object_id;
$object_data['object_id'] = $object_id;
$object_data['object_type'] = ''; // Since we don't fetch the object, we don't know the type
} else {
$object_data = [];