some debugging calls and make sure $hints['feedurl'] gets set with $feeduri in case that variable is used.

This commit is contained in:
Mikael Nordfeldth 2016-10-22 23:08:44 +02:00
parent 8614cd77eb
commit 6ebc5f0bff

View File

@ -1116,6 +1116,8 @@ class Ostatus_profile extends Managed_DataObject
*/ */
protected static function createActivityObjectProfile(ActivityObject $object, array $hints=array()) protected static function createActivityObjectProfile(ActivityObject $object, array $hints=array())
{ {
common_debug('Attempting to create an Ostatus_profile from an ActivityObject with ID: '._ve($object->id));
$homeuri = $object->id; $homeuri = $object->id;
$discover = false; $discover = false;
@ -1145,12 +1147,12 @@ class Ostatus_profile extends Managed_DataObject
} }
} }
if (array_key_exists('feedurl', $hints)) { if (!array_key_exists('feedurl', $hints)) {
$feeduri = $hints['feedurl'];
} else {
$discover = new FeedDiscovery(); $discover = new FeedDiscovery();
$feeduri = $discover->discoverFromURL($homeuri); $hints['feedurl'] = $discover->discoverFromURL($homeuri);
common_debug(__METHOD__.' did not have a "feedurl" hint, FeedDiscovery found '._ve($hints['feedurl']));
} }
$feeduri = $hints['feedurl'];
if (array_key_exists('salmon', $hints)) { if (array_key_exists('salmon', $hints)) {
$salmonuri = $hints['salmon']; $salmonuri = $hints['salmon'];
@ -1287,6 +1289,8 @@ class Ostatus_profile extends Managed_DataObject
throw new AuthorizationException('Trying to update profile from ActivityObject with different URI.'); throw new AuthorizationException('Trying to update profile from ActivityObject with different URI.');
} }
common_debug('Updating Ostatus_profile with URI '._ve($this->getUri()).' from ActivityObject');
if ($this->isGroup()) { if ($this->isGroup()) {
$group = $this->localGroup(); $group = $this->localGroup();
self::updateGroup($group, $object, $hints); self::updateGroup($group, $object, $hints);