]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/classes/FeedSub.php
Merged
[quix0rs-gnu-social.git] / plugins / OStatus / classes / FeedSub.php
index d0ac83b56d754d96946c3c6bdd18c86e553c76ed..b0875c298865b86f70fa1d8c57c272368d73d25a 100644 (file)
@@ -295,7 +295,7 @@ class FeedSub extends Managed_DataObject
     {
         $fs = new FeedSub();
         // the "" empty string check is because we historically haven't saved unsubscribed feeds as NULL
-        $fs->whereAdd('sub_end IS NOT NULL AND sub_end!="" AND sub_end < NOW() - INTERVAL 1 day');
+        $fs->whereAdd('sub_end IS NOT NULL AND sub_end!="" AND sub_end < NOW() + INTERVAL 1 day');
         if (!$fs->find()) { // find can be both false and 0, depending on why nothing was found
             throw new NoResultException($fs);
         }
@@ -355,7 +355,7 @@ class FeedSub extends Managed_DataObject
             $response = $client->post($hub, $headers, $post);
             $status = $response->getStatus();
             // PuSH specificed response status code
-            if ($status == 202) {
+            if ($status == 202  || $status == 204) {
                 common_log(LOG_INFO, __METHOD__ . ': sub req ok, awaiting verification callback');
                 return;
             } else if ($status >= 200 && $status < 300) {
@@ -487,7 +487,7 @@ class FeedSub extends Managed_DataObject
                     return true;
                 }
                 if (common_config('feedsub', 'debug')) {
-                    $tempfile = tempnam(sys_get_temp_dir(), 'feedsub-receive');
+                    $tempfile = tempnam(common_get_temp_dir(), 'feedsub-receive');
                     if ($tempfile) {
                         file_put_contents($tempfile, $post);
                     }