forked from GNUsocial/gnu-social
f4d6710a0f
WebSub is probably finalised before we make a release anyway. Here is the official spec: https://www.w3.org/TR/websub/ Mostly just comments that have been changed. Some references to PuSH <0.4 are left because they actually refer to PuSH 0.3 and that's not WebSub... The only actual code change that might affect anything is FeedSub->isPuSH() but the only official plugin using that call was FeedPoller anyway...
38 lines
950 B
PHP
38 lines
950 B
PHP
<?php
|
|
|
|
if (!defined('GNUSOCIAL')) { exit(1); }
|
|
|
|
/**
|
|
* Poll a feed based on its urlhash, the full url is in the feedsub table
|
|
*
|
|
* @author Mikael Nordfeldth <mmn@hethane.se>
|
|
*/
|
|
class FeedPollQueueHandler extends QueueHandler
|
|
{
|
|
public function transport()
|
|
{
|
|
return FeedPoll::QUEUE_CHECK;
|
|
}
|
|
|
|
public function handle($item)
|
|
{
|
|
$feedsub = FeedSub::getKV('id', $item['id']);
|
|
if (!$feedsub instanceof FeedSub) {
|
|
// Removed from the feedsub table I guess
|
|
return true;
|
|
}
|
|
if (!$feedsub->sub_state == 'nohub') {
|
|
// We're not supposed to poll this (either it's WebSub or it's unsubscribed)
|
|
return true;
|
|
}
|
|
|
|
try {
|
|
FeedPoll::checkUpdates($feedsub);
|
|
} catch (Exception $e) {
|
|
common_log(LOG_ERR, "Failed to check feedsub id= ".$feedsub->id.' ("'.$e->getMessage().'")');
|
|
}
|
|
|
|
return true;
|
|
}
|
|
}
|