diff options
author | Zach Copley <zach@status.net> | 2010-01-27 14:27:22 -0800 |
---|---|---|
committer | Zach Copley <zach@status.net> | 2010-01-27 14:27:22 -0800 |
commit | 78079f34e273357d03ceee13269f9a388e66c4e3 (patch) | |
tree | 8f29f6fb7de5b6b6627a7eba3e16b86fa9b2ae1f /plugins/PubSubHubBub/PubSubHubBubPlugin.php | |
parent | 656d95418c6d7f8b884c4c8af14ad6952032ace6 (diff) | |
parent | 2494d3fa25a44b3cacf85c594683675ae9e6d0cb (diff) |
Merge branch 'testing' into -1.9.x
* testing: (130 commits)
HTTP auth provided is evaluated even if it's not required
Rename rc3to09.sql to rc3torc4.sql to avoid confusion if we add a last-minute change after this!
Add new oauth tables and modifications to 'consumer' table for rc4
Centred leaderboard ad
camelcase the uap param names
move leaderboard to after the header
Moved rectangle ad into aside and leaderboard to the right in header.
Aligning wide skyscraper to the right instead of left
CSS ids and classes fixed in UAPPlugin
wrong height for rectangle in BlankAd
Add the moved BlankAdPlugin
make BlankAd dir and change to use a 1x1 image
move BlankAdPlugin to its own dir
Add BlankAdPlugin to test ad layout in different themes
make uapplugin an abstract class
move UAP plugin to core
Lowercased switch cases in UAP Plugin
Plugin for Universal Ad Package. Outputs four most widely used ad types.
Add persistent:true property to Stomp messages so ActiveMQ doesn't decide to discard them even though persistence is enabled on the broker. :) (Thanks Aric!)
quick fix: use common_path() on realtime update JS so it works with the new JS path code (will pull from main server for now)
...
Conflicts:
actions/apioauthaccesstoken.php
actions/apioauthauthorize.php
actions/apioauthrequesttoken.php
actions/editapplication.php
actions/newapplication.php
lib/apiauth.php
lib/queuemanager.php
lib/router.php
Diffstat (limited to 'plugins/PubSubHubBub/PubSubHubBubPlugin.php')
-rw-r--r-- | plugins/PubSubHubBub/PubSubHubBubPlugin.php | 44 |
1 files changed, 35 insertions, 9 deletions
diff --git a/plugins/PubSubHubBub/PubSubHubBubPlugin.php b/plugins/PubSubHubBub/PubSubHubBubPlugin.php index ce6086df9..a880dc866 100644 --- a/plugins/PubSubHubBub/PubSubHubBubPlugin.php +++ b/plugins/PubSubHubBub/PubSubHubBubPlugin.php @@ -80,6 +80,21 @@ class PubSubHubBubPlugin extends Plugin } /** + * Check if plugin should be active; may be mass-enabled. + * @return boolean + */ + + function enabled() + { + if (common_config('site', 'private')) { + // PuSH relies on public feeds + return false; + } + // @fixme check for being on a private network? + return true; + } + + /** * Hooks the StartApiAtom event * * Adds the necessary bits to advertise PubSubHubBub @@ -92,8 +107,9 @@ class PubSubHubBubPlugin extends Plugin function onStartApiAtom($action) { - $action->element('link', array('rel' => 'hub', 'href' => $this->hub), null); - + if ($this->enabled()) { + $action->element('link', array('rel' => 'hub', 'href' => $this->hub), null); + } return true; } @@ -110,9 +126,11 @@ class PubSubHubBubPlugin extends Plugin function onStartApiRss($action) { - $action->element('atom:link', array('rel' => 'hub', - 'href' => $this->hub), - null); + if ($this->enabled()) { + $action->element('atom:link', array('rel' => 'hub', + 'href' => $this->hub), + null); + } return true; } @@ -130,6 +148,9 @@ class PubSubHubBubPlugin extends Plugin function onHandleQueuedNotice($notice) { + if (!$this->enabled()) { + return false; + } $publisher = new Publisher($this->hub); $feeds = array(); @@ -243,16 +264,21 @@ class PubSubHubBubPlugin extends Plugin function onPluginVersion(&$versions) { + $about = _m('The PubSubHubBub plugin pushes RSS/Atom updates '. + 'to a <a href = "'. + 'http://pubsubhubbub.googlecode.com/'. + '">PubSubHubBub</a> hub.'); + if (!$this->enabled()) { + $about = '<span class="disabled" style="color:gray">' . $about . '</span> ' . + _m('(inactive on private site)'); + } $versions[] = array('name' => 'PubSubHubBub', 'version' => STATUSNET_VERSION, 'author' => 'Craig Andrews', 'homepage' => 'http://status.net/wiki/Plugin:PubSubHubBub', 'rawdescription' => - _m('The PubSubHubBub plugin pushes RSS/Atom updates '. - 'to a <a href = "'. - 'http://pubsubhubbub.googlecode.com/'. - '">PubSubHubBub</a> hub.')); + $about); return true; } |