From c559b8ce2ac10ee4192f784376c382be61d98bc5 Mon Sep 17 00:00:00 2001 From: Mikael Nordfeldth Date: Sat, 16 Jan 2016 17:34:27 +0100 Subject: [PATCH] bulkDistribute won't add empty lists to database --- plugins/OStatus/classes/HubSub.php | 5 +++++ 1 file changed, 5 insertions(+) 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; } /** -- 2.39.5