X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=plugins%2FOStatus%2Factions%2Fpushhub.php;h=c883647e681ef8768b58694cf9458ca49b81e894;hb=2729c622ff7ae8b657e6058548f863d96985b534;hp=e9dca7ab9d8181d3cb232288015430abd0852826;hpb=7d64d8c78cfa102b91975598ef9e574d2ef14b8c;p=quix0rs-gnu-social.git diff --git a/plugins/OStatus/actions/pushhub.php b/plugins/OStatus/actions/pushhub.php index e9dca7ab9d..c883647e68 100644 --- a/plugins/OStatus/actions/pushhub.php +++ b/plugins/OStatus/actions/pushhub.php @@ -47,13 +47,13 @@ class PushHubAction extends Action return parent::arg($arg, $def); } - function prepare($args) + protected function prepare($args) { StatusNet::setApi(true); // reduce exception reports to aid in debugging return parent::prepare($args); } - function handle() + protected function handle() { $mode = $this->trimmed('hub.mode'); switch ($mode) { @@ -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::staticGet($topic, $callback); + $sub = HubSub::getByHashkey($topic, $callback); if (!$sub) { // Creating a new one! $sub = new HubSub(); @@ -155,7 +155,7 @@ class PushHubAction extends Action $groupFeed = common_local_url('ApiTimelineGroup', $params); if ($feed == $userFeed) { - $user = User::staticGet('id', $id); + $user = User::getKV('id', $id); if (!$user) { // TRANS: Client exception. %s is a feed URL. throw new ClientException(sprintt(_m('Invalid hub.topic "%s". User does not exist.'),$feed)); @@ -164,7 +164,7 @@ class PushHubAction extends Action } } if ($feed == $groupFeed) { - $user = User_group::staticGet('id', $id); + $user = User_group::getKV('id', $id); if (!$user) { // TRANS: Client exception. %s is a feed URL. throw new ClientException(sprintf(_m('Invalid hub.topic "%s". Group does not exist.'),$feed)); @@ -179,8 +179,8 @@ class PushHubAction extends Action $listFeed = common_local_url('ApiTimelineList', $params); if ($feed == $listFeed) { - $list = Profile_list::staticGet('id', $id); - $user = User::staticGet('id', $user); + $list = Profile_list::getKV('id', $id); + $user = User::getKV('id', $user); if (!$list || !$user || $list->tagger != $user->id) { // TRANS: Client exception. %s is a feed URL. throw new ClientException(sprintf(_m('Invalid hub.topic %s; list does not exist.'),$feed)); @@ -203,7 +203,8 @@ class PushHubAction extends Action $url = $this->arg($arg); $params = array('domain_check' => false, // otherwise breaks my local tests :P 'allowed_schemes' => array('http', 'https')); - if (Validate::uri($url, $params)) { + $validate = new Validate; + if ($validate->uri($url, $params)) { return $url; } else { // TRANS: Client exception. @@ -221,6 +222,6 @@ class PushHubAction extends Action */ protected function getSub($feed, $callback) { - return HubSub::staticGet($feed, $callback); + return HubSub::getByHashkey($feed, $callback); } }