aboutsummaryrefslogtreecommitdiff
path: root/app/Models/Feed.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-01-24 11:06:20 +0100
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2016-01-24 11:06:20 +0100
commit0915772fe6735f6051c6b56a3b3e59dd3c44833b (patch)
tree8a993cdfc7975a2e8cf7a56b077a29beb528fd29 /app/Models/Feed.php
parent9637e018bf0bdd17ecfabe825cb12ea9a67d7553 (diff)
PubSubHubbub unsubscribe request
https://github.com/FreshRSS/FreshRSS/issues/1058
Diffstat (limited to 'app/Models/Feed.php')
-rw-r--r--app/Models/Feed.php9
1 files changed, 4 insertions, 5 deletions
diff --git a/app/Models/Feed.php b/app/Models/Feed.php
index 23491ee8d..986cc5015 100644
--- a/app/Models/Feed.php
+++ b/app/Models/Feed.php
@@ -451,6 +451,10 @@ class FreshRSS_Feed extends Minz_Model {
Minz_Log::warning('Invalid callback for PubSubHubbub: ' . $this->url);
return false;
}
+ if (!$state) { //unsubscribe
+ $hubJson['lease_end'] = time() - 60;
+ file_put_contents($hubFilename, json_encode($hubJson));
+ }
$ch = curl_init();
curl_setopt_array($ch, array(
CURLOPT_URL => $this->hubUrl,
@@ -470,11 +474,6 @@ class FreshRSS_Feed extends Minz_Model {
'PubSubHubbub ' . ($state ? 'subscribe' : 'unsubscribe') . ' to ' . $this->selfUrl .
' with callback ' . $callbackUrl . ': ' . $info['http_code'] . ' ' . $response . "\n", FILE_APPEND);
- if (!$state) { //unsubscribe
- $hubJson['lease_end'] = time() - 60;
- file_put_contents($hubFilename, json_encode($hubJson));
- }
-
if (substr($info['http_code'], 0, 1) == '2') {
return true;
} else {