]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - plugins/OStatus/actions/pushhub.php
Minor function definitions so they match Action parent
[quix0rs-gnu-social.git] / plugins / OStatus / actions / pushhub.php
index b2a97dbc6c9366547159f3ecd8f952a22a5723f1..c883647e681ef8768b58694cf9458ca49b81e894 100644 (file)
@@ -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,11 +179,11 @@ 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; people tag does not exist.'),$feed));
+                    throw new ClientException(sprintf(_m('Invalid hub.topic %s; list does not exist.'),$feed));
                 } else {
                     return true;
                 }
@@ -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);
     }
 }