aboutsummaryrefslogtreecommitdiff
path: root/p/api/pshb.php
diff options
context:
space:
mode:
Diffstat (limited to 'p/api/pshb.php')
-rw-r--r--p/api/pshb.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/p/api/pshb.php b/p/api/pshb.php
index 2f7f48cd8..4bb4694b3 100644
--- a/p/api/pshb.php
+++ b/p/api/pshb.php
@@ -60,6 +60,10 @@ if (!empty($_REQUEST['hub_mode']) && $_REQUEST['hub_mode'] === 'subscribe') {
} else {
unset($hubJson['lease_end']);
}
+ $hubJson['lease_start'] = time();
+ if (!isset($hubJson['error'])) {
+ $hubJson['error'] = true; //Do not assume that PubSubHubbub works until the first successul push
+ }
file_put_contents('./!hub.json', json_encode($hubJson));
exit(isset($_REQUEST['hub_challenge']) ? $_REQUEST['hub_challenge'] : '');
}
@@ -120,6 +124,9 @@ if ($nb === 0) {
header('HTTP/1.1 410 Gone');
logMe('Error: Nobody is subscribed to this feed anymore after all!: ' . $self);
die('Nobody is subscribed to this feed anymore after all!');
+} elseif (!empty($hubJson['error'])) {
+ $hubJson['error'] = false;
+ file_put_contents('./!hub.json', json_encode($hubJson));
}
logMe('PubSubHubbub ' . $self . ' done: ' . $nb);