]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/atompubmembershipfeed.php
Improved type-hint for following methods:
[quix0rs-gnu-social.git] / actions / atompubmembershipfeed.php
index 37e4a386a20cfb27e4f4ec6f85f4ced8f55ed3f4..060e2526a30371af604188451e4173ef9f2a3b85 100644 (file)
@@ -34,8 +34,6 @@ if (!defined('STATUSNET')) {
     exit(1);
 }
 
-require_once INSTALLDIR . '/lib/apiauth.php';
-
 /**
  * Feed of group memberships for a user, in ActivityStreams format
  *
@@ -64,7 +62,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
 
         $profileId = $this->trimmed('profile');
 
-        $this->_profile = Profile::staticGet('id', $profileId);
+        $this->_profile = Profile::getKV('id', $profileId);
 
         if (empty($this->_profile)) {
             // TRANS: Client exception.
@@ -239,18 +237,16 @@ class AtompubmembershipfeedAction extends ApiAuthAction
             if ($activity->verb != ActivityVerb::JOIN) {
                 // TRANS: Client error displayed when not using the join verb.
                 throw new ClientException(_('Can only handle join activities.'));
-                return;
             }
 
             $groupObj = $activity->objects[0];
 
             if ($groupObj->type != ActivityObject::GROUP) {
-                // TRANS: Client exception thrown when trying favorite an object that is not a notice.
-                throw new ClientException(_('Can only fave notices.'));
-                return;
+                // TRANS: Client exception thrown when trying to join something which is not a group
+                throw new ClientException(_('Can only join groups.'));
             }
 
-            $group = User_group::staticGet('uri', $groupObj->id);
+            $group = User_group::getKV('uri', $groupObj->id);
 
             if (empty($group)) {
                 // XXX: import from listed URL or something
@@ -300,7 +296,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction
      *
      * @return boolean is read only action?
      */
-    function isReadOnly($args)
+    function isReadOnly(array $args=array())
     {
         if ($_SERVER['REQUEST_METHOD'] == 'GET' ||
             $_SERVER['REQUEST_METHOD'] == 'HEAD') {