From 912d65c767cff33f3903068d57f7165a4d2ba6f0 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 c9d65c56a7..6388f8e873 100644 --- a/plugins/OStatus/classes/HubSub.php +++ b/plugins/OStatus/classes/HubSub.php @@ -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; } /** -- 2.39.5