diff --git a/plugins/OStatus/actions/pushhub.php b/plugins/OStatus/actions/pushhub.php index 1c19c7e52e..e44d06e199 100644 --- a/plugins/OStatus/actions/pushhub.php +++ b/plugins/OStatus/actions/pushhub.php @@ -109,7 +109,7 @@ class PushHubAction extends Action throw new ClientException(sprintf(_m('Invalid hub.secret "%s". It must be under 200 bytes.'),$secret)); } - $sub = HubSub::getKV($topic, $callback); + $sub = HubSub::getByHashkey($topic, $callback); if (!$sub) { // Creating a new one! $sub = new HubSub(); @@ -222,6 +222,6 @@ class PushHubAction extends Action */ protected function getSub($feed, $callback) { - return HubSub::getKV($feed, $callback); + return HubSub::getByHashkey($feed, $callback); } } diff --git a/plugins/OStatus/classes/HubSub.php b/plugins/OStatus/classes/HubSub.php index 7a32e8df1b..7996da3930 100644 --- a/plugins/OStatus/classes/HubSub.php +++ b/plugins/OStatus/classes/HubSub.php @@ -45,6 +45,11 @@ class HubSub extends Managed_DataObject return sha1($topic . '|' . $callback); } + public static function getByHashkey($topic, $callback) + { + return self::getKV('hashkey', self::hashkey($topic, $callback)); + } + public static function schemaDef() { return array( @@ -158,7 +163,7 @@ class HubSub extends Managed_DataObject throw new ClientException(sprintf(_m('Hub subscriber verification returned HTTP %s.'),$status)); } - $old = HubSub::getKV($this->topic, $this->callback); + $old = HubSub::getByHashkey($this->topic, $this->callback); if ($mode == 'subscribe') { if ($old) { $this->update($old); @@ -244,7 +249,7 @@ class HubSub extends Managed_DataObject // destroy the result data for the parent query. // @fixme use clone() again when it's safe to copy an // individual item from a multi-item query again. - $sub = HubSub::getKV($this->topic, $this->callback); + $sub = HubSub::getByHashkey($this->topic, $this->callback); $data = array('sub' => $sub, 'atom' => $atom, 'retries' => $retries); diff --git a/plugins/OStatus/lib/hubprepqueuehandler.php b/plugins/OStatus/lib/hubprepqueuehandler.php index 90ee6a8bd9..f6abfcf30d 100644 --- a/plugins/OStatus/lib/hubprepqueuehandler.php +++ b/plugins/OStatus/lib/hubprepqueuehandler.php @@ -65,7 +65,7 @@ class HubPrepQueueHandler extends QueueHandler while (count($pushCallbacks) && $n < self::ROLLING_BATCH) { $n++; $callback = array_shift($pushCallbacks); - $sub = HubSub::getKV($topic, $callback); + $sub = HubSub::getByHashkey($topic, $callback); if (!$sub) { common_log(LOG_ERR, "Skipping PuSH delivery for deleted(?) consumer $callback on $topic"); continue;