12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- <?php
- if (!defined('GNUSOCIAL')) { exit(1); }
- class FeedPollerPlugin extends Plugin {
- const PLUGIN_VERSION = '2.0.0';
- public $interval = 5;
- public function onEndInitializeQueueManager(QueueManager $qm)
- {
- $qm->connect(FeedPoll::QUEUE_CHECK, 'FeedPollQueueHandler');
- return true;
- }
- public function onCronMinutely()
- {
- $args = array('interval'=>$this->interval);
- FeedPoll::enqueueNewFeeds($args);
- return true;
- }
- public function onFeedSubscribe(FeedSub $feedsub)
- {
- if (!$feedsub->isWebSub()) {
- FeedPoll::setupFeedSub($feedsub, $this->interval*60);
- return false;
- }
- return true;
- }
- public function onFeedUnsubscribe(FeedSub $feedsub)
- {
- if (!$feedsub->isWebSub()) {
-
- $feedsub->confirmUnsubscribe();
- return false;
- }
- return true;
- }
- public function onPluginVersion(array &$versions)
- {
- $versions[] = array('name' => 'FeedPoller',
- 'version' => self::PLUGIN_VERSION,
- 'author' => 'Mikael Nordfeldth',
- 'homepage' => 'http://www.gnu.org/software/social/',
- 'description' =>
-
- _m('Feed polling plugin to avoid using external push hubs.'));
- return true;
- }
- }
|