From: Mikael Nordfeldth Date: Sat, 16 Jan 2016 16:34:27 +0000 (+0100) Subject: bulkDistribute won't add empty lists to database X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=c559b8ce2ac10ee4192f784376c382be61d98bc5;p=quix0rs-gnu-social.git bulkDistribute won't add empty lists to database --- diff --git a/plugins/OStatus/classes/HubSub.php b/plugins/OStatus/classes/HubSub.php index 7eba8937fa..e2b5dc2a6d 100644 --- a/plugins/OStatus/classes/HubSub.php +++ b/plugins/OStatus/classes/HubSub.php @@ -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; } /**