diff options
| author | 2016-02-16 19:02:05 +0100 | |
|---|---|---|
| committer | 2016-02-16 19:02:05 +0100 | |
| commit | 765319190fd314979a7d1bb2956dc13f32541524 (patch) | |
| tree | b7fc46fc12b149f90664eb612597b2bc144a1927 /app/Models | |
| parent | e84773af1c3020b3cea1f6dd631e2a12a4736fe7 (diff) | |
| parent | 0915772fe6735f6051c6b56a3b3e59dd3c44833b (diff) | |
Merge pull request #1060 from Alkarex/pshb-unsubscribe
PubSubHubbub unsubscribe request
Diffstat (limited to 'app/Models')
| -rw-r--r-- | app/Models/Feed.php | 9 |
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 { |
