]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/classes/Ostatus_profile.php
Fix footer in plugins' notices.
[quix0rs-gnu-social.git] / plugins / OStatus / classes / Ostatus_profile.php
index 264c91337697f1da41e25692251dcc8d39d52011..b94950138fd15d8acd8d615f1f4c38de4f66d0a2 100644 (file)
@@ -101,10 +101,10 @@ class Ostatus_profile extends Managed_DataObject
         }
 
         $profile = Profile::getKV('id', $this->profile_id);
-        if ($profile instanceof Profile) {
-            return $profile;
+        if (!$profile instanceof Profile) {
+            throw new NoProfileException($this->profile_id);
         }
-        throw new NoProfileException($this->profile_id);
+        return $profile;
     }
 
     /**
@@ -1141,8 +1141,9 @@ class Ostatus_profile extends Managed_DataObject
                         ?: $discover->getAtomLink(Salmon::NS_REPLIES);
         $hints['salmon'] = $salmonuri;
 
-        if (!$huburi && !common_config('feedsub', 'fallback_hub')) {
+        if (!$huburi && !common_config('feedsub', 'fallback_hub') && !common_config('feedsub', 'nohub')) {
             // We can only deal with folks with a PuSH hub
+            // unless we have something similar available locally.
             throw new FeedSubNoHubException();
         }
 
@@ -1534,7 +1535,7 @@ class Ostatus_profile extends Managed_DataObject
             $huburi = $discover->getHubLink();
         }
 
-        if (!$huburi && !common_config('feedsub', 'fallback_hub')) {
+        if (!$huburi && !common_config('feedsub', 'fallback_hub') && !common_config('feedsub', 'nohub')) {
             // We can only deal with folks with a PuSH hub
             throw new FeedSubNoHubException();
         }