]> 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>
Sat, 16 Jan 2016 16:34:27 +0000 (17:34 +0100)
plugins/OStatus/classes/HubSub.php

index 7eba8937faf44395f4d0ba2418ad1872ea5976fe..e2b5dc2a6dd0ee28660bcd2a7b2438f991e94cce 100644 (file)
@@ -251,12 +251,17 @@ class HubSub extends Managed_DataObject
      */
     function bulkDistribute($atom, array $pushCallbacks)
     {
+        if (empty($pushCallbacks)) {
+            common_log(LOG_ERR, 'Callback list empty for bulkDistribute.');
+            return false;
+        }
         $data = array('atom' => $atom,
                       'topic' => $this->getTopic(),
                       'pushCallbacks' => $pushCallbacks);
         common_log(LOG_INFO, "Queuing PuSH batch: {$this->getTopic()} to ".count($pushCallbacks)." sites");
         $qm = QueueManager::get();
         $qm->enqueue($data, 'hubprep');
+        return true;
     }
 
     /**