From 779ce40ac354afdb37495c9a9bc50343a3af1d1f Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sun, 9 Mar 2014 13:29:38 +0100 Subject: [PATCH] Add functions to avoid direct variable access --- plugins/OStatus/classes/FeedSub.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/plugins/OStatus/classes/FeedSub.php b/plugins/OStatus/classes/FeedSub.php index cf258444e8..55cf1bddbc 100644 --- a/plugins/OStatus/classes/FeedSub.php +++ b/plugins/OStatus/classes/FeedSub.php @@ -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 -- 2.39.5