]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/classes/FeedSub.php
Remove NOT NULL restriction on FeedSub last_update
[quix0rs-gnu-social.git] / plugins / OStatus / classes / FeedSub.php
index 25a826a5524bf0438b9f2a237ed63cb64f537782..adc1aa11be6506eb9041a85db5b1924c53180131 100644 (file)
@@ -86,7 +86,7 @@ class FeedSub extends Managed_DataObject
                 'sub_state' => array('type' => 'enum("subscribe","active","unsubscribe","inactive","nohub")', 'not null' => true, 'description' => 'subscription state'),
                 'sub_start' => array('type' => 'datetime', 'description' => 'subscription start'),
                 'sub_end' => array('type' => 'datetime', 'description' => 'subscription end'),
-                'last_update' => array('type' => 'datetime', 'not null' => true, 'description' => 'when this record was last updated'),
+                'last_update' => array('type' => 'datetime', 'description' => 'when this record was last updated'),
                 'created' => array('type' => 'datetime', 'not null' => true, 'description' => 'date this record was created'),
                 'modified' => array('type' => 'timestamp', 'not null' => true, 'description' => 'date this record was modified'),
             ),
@@ -168,7 +168,7 @@ class FeedSub extends Managed_DataObject
         $discover->discoverFromFeedURL($feeduri);
 
         $huburi = $discover->getHubLink();
-        if (!$huburi && !common_config('feedsub', 'fallback_hub')) {
+        if (!$huburi && !common_config('feedsub', 'fallback_hub') && !common_config('feedsub', 'nohub')) {
             throw new FeedSubNoHubException();
         }
 
@@ -211,8 +211,8 @@ class FeedSub extends Managed_DataObject
                 // No native hub on this feed?
                 // Use our fallback hub, which handles polling on our behalf.
             } else if (common_config('feedsub', 'nohub')) {
-                // Fake it! We're just testing remote feeds w/o hubs.
-                // We'll never actually get updates in this mode.
+                // For this to actually work, we'll need some polling mechanism.
+                // The FeedPoller plugin should take care of it.
                 return;
             } else {
                 // TRANS: Server exception.
@@ -247,8 +247,8 @@ class FeedSub extends Managed_DataObject
                 // No native hub on this feed?
                 // Use our fallback hub, which handles polling on our behalf.
             } else if (common_config('feedsub', 'nohub')) {
-                // Fake it! We're just testing remote feeds w/o hubs.
-                // We'll never actually get updates in this mode.
+                // We need a feedpolling plugin (like FeedPoller) active so it will
+                // set the 'nohub' state to 'inactive' for us.
                 return;
             } else {
                 // TRANS: Server exception.