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();
*/
protected function getSub($feed, $callback)
{
- return HubSub::getKV($feed, $callback);
+ return HubSub::getByHashkey($feed, $callback);
}
}
return sha1($topic . '|' . $callback);
}
+ public static function getByHashkey($topic, $callback)
+ {
+ return self::getKV('hashkey', self::hashkey($topic, $callback));
+ }
+
public static function schemaDef()
{
return array(
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);
// 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);
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;