X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;ds=inline;f=actions%2Fatompubshowmembership.php;h=ad6aa6c1d05db3bf00bf0ec3bff912a01a27235a;hb=cd6fa512ac0d382871384a9c7604abd8a7ed0566;hp=a845ea23dffda6d91e35cc1d5d573792463f8c33;hpb=621a7cb36df9e3962aac7b473478c634e97e70e1;p=quix0rs-gnu-social.git diff --git a/actions/atompubshowmembership.php b/actions/atompubshowmembership.php index a845ea23df..ad6aa6c1d0 100644 --- a/actions/atompubshowmembership.php +++ b/actions/atompubshowmembership.php @@ -34,8 +34,6 @@ if (!defined('STATUSNET')) { exit(1); } -require_once INSTALLDIR . '/lib/apiauth.php'; - /** * Show (or delete) a single membership event as an ActivityStreams entry * @@ -65,7 +63,7 @@ class AtompubshowmembershipAction 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. @@ -74,7 +72,7 @@ class AtompubshowmembershipAction extends ApiAuthAction $groupId = $this->trimmed('group'); - $this->_group = User_group::staticGet('id', $groupId); + $this->_group = User_group::getKV('id', $groupId); if (empty($this->_group)) { // TRANS: Client exception thrown when referencing a non-existing group. @@ -142,7 +140,6 @@ class AtompubshowmembershipAction extends ApiAuthAction * * @return void */ - function deleteMembership() { if (empty($this->auth_user) || @@ -152,10 +149,7 @@ class AtompubshowmembershipAction extends ApiAuthAction " 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; }