]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
some debugging calls and make sure $hints['feedurl'] gets set with $feeduri in case...
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 22 Oct 2016 21:08:44 +0000 (23:08 +0200)
committerMikael Nordfeldth <mmn@hethane.se>
Sat, 22 Oct 2016 21:08:44 +0000 (23:08 +0200)
plugins/OStatus/classes/Ostatus_profile.php

index ad23542cfdc98a3835c6e1c93d7e528496eec981..cd3f4f6e6ce1117767896667c285138d9e020225 100644 (file)
@@ -1116,6 +1116,8 @@ class Ostatus_profile extends Managed_DataObject
      */
     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;
         $discover = false;
 
@@ -1145,12 +1147,12 @@ class Ostatus_profile extends Managed_DataObject
             }
         }
 
-        if (array_key_exists('feedurl', $hints)) {
-            $feeduri = $hints['feedurl'];
-        } else {
+        if (!array_key_exists('feedurl', $hints)) {
             $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)) {
             $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.');
         }
 
+        common_debug('Updating Ostatus_profile with URI '._ve($this->getUri()).' from ActivityObject');
+
         if ($this->isGroup()) {
             $group = $this->localGroup();
             self::updateGroup($group, $object, $hints);