]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
bulkDistribute won't add empty lists to database
authorMikael Nordfeldth <mmn@hethane.se>
Sat, 16 Jan 2016 16:34:27 +0000 (17:34 +0100)
committerMikael Nordfeldth <mmn@hethane.se>
Wed, 20 Jan 2016 14:32:24 +0000 (15:32 +0100)
plugins/OStatus/classes/HubSub.php

index c9d65c56a7a45b09a6beff359f1d2753207eeb23..6388f8e87335fe98139096cc0491383b162d1384 100644 (file)
@@ -228,6 +228,10 @@ class HubSub extends Managed_DataObject
      */
     function bulkDistribute($atom, $pushCallbacks)
     {
+        if (empty($pushCallbacks)) {
+            common_log(LOG_ERR, 'Callback list empty for bulkDistribute.');
+            return false;
+        }
         $data = array('atom' => $atom,
                       'topic' => $this->topic,
                       'pushCallbacks' => $pushCallbacks);
@@ -235,6 +239,7 @@ class HubSub extends Managed_DataObject
                              count($pushCallbacks) . " sites");
         $qm = QueueManager::get();
         $qm->enqueue($data, 'hubprep');
+        return true;
     }
 
     /**