]> git.mxchange.org Git - quix0rs-gnu-social.git/blobdiff - actions/atompubshowmembership.php
Merge commit 'refs/merge-requests/164' of git://gitorious.org/statusnet/mainline...
[quix0rs-gnu-social.git] / actions / atompubshowmembership.php
index 4454c7fd7ad0f9ee80488fe823d04144e335b2ba..8bf62912f5268eb8fd3891d859d5fb7dd8c12f0b 100644 (file)
@@ -78,7 +78,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
 
         if (empty($this->_group)) {
             // TRANS: Client exception thrown when referencing a non-existing group.
-            throw new ClientException(_('No such group'), 404);
+            throw new ClientException(_('No such group.'), 404);
         }
 
         $kv = array('group_id' => $groupId,
@@ -88,7 +88,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
 
         if (empty($this->_membership)) {
             // TRANS: Client exception thrown when trying to show membership of a non-subscribed group
-            throw new ClientException(_('Not a member'), 404);
+            throw new ClientException(_('Not a member.'), 404);
         }
 
         return true;
@@ -113,7 +113,7 @@ class AtompubshowmembershipAction extends ApiAuthAction
             break;
         default:
             // TRANS: Client exception thrown when using an unsupported HTTP method.
-            throw new ClientException(_('HTTP method not supported'), 405);
+            throw new ClientException(_('HTTP method not supported.'), 405);
             break;
         }
         return;
@@ -142,20 +142,16 @@ class AtompubshowmembershipAction extends ApiAuthAction
      *
      * @return void
      */
-
     function deleteMembership()
     {
         if (empty($this->auth_user) ||
             $this->auth_user->id != $this->_profile->id) {
             // TRANS: Client exception thrown when deleting someone else's membership.
             throw new ClientException(_("Cannot delete someone else's".
-                                        " membership"), 403);
+                                        " membership."), 403);
         }
 
-        if (Event::handle('StartLeaveGroup', array($this->_group, $this->auth_user))) {
-            Group_member::leave($this->_group->id, $this->auth_user->id);
-            Event::handle('EndLeaveGroup', array($this->_group, $this->auth_user));
-        }
+        $this->auth_user->leaveGroup($this->_group);
 
         return;
     }