]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
Add functions to avoid direct variable access
authorMikael Nordfeldth <mmn@hethane.se>
Sun, 9 Mar 2014 12:29:38 +0000 (13:29 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Sun, 9 Mar 2014 12:31:05 +0000 (13:31 +0100)
plugins/OStatus/classes/FeedSub.php

index cf258444e88fa0fa7f21201f9d4d9039cef9b132..55cf1bddbca8e7020eb0c6707e6161f861eb6540 100644 (file)
@@ -97,6 +97,28 @@ class FeedSub extends Managed_DataObject
         );
     }
 
+    /**
+     * Get the feed uri (http/https)
+     */
+    public function getUri()
+    {
+        if (empty($this->uri)) {
+            throw new ServerException('No URI for FeedSub entry');
+        }
+        return $this->uri;
+    }
+
+    /**
+     * Do we have a hub? Then we are a PuSH feed.
+     * https://en.wikipedia.org/wiki/PubSubHubbub
+     *
+     * NOTE: does not respect if we have a fallback_hub configured
+     */
+    public function isPuSH()
+    {
+        return !empty($this->huburi);
+    }
+
     /**
      * Fetch the StatusNet-side profile for this feed
      * @return Profile