X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Fatompubmembershipfeed.php;h=37e4a386a20cfb27e4f4ec6f85f4ced8f55ed3f4;hb=0cbb7411a69f63a4c2947d5c66e62f28e0714532;hp=8e3db3f3de6de08cf927c40a1af605023c7dd9f2;hpb=6455461c196fcb8e7c0047870d480e4a97986709;p=quix0rs-gnu-social.git diff --git a/actions/atompubmembershipfeed.php b/actions/atompubmembershipfeed.php index 8e3db3f3de..37e4a386a2 100644 --- a/actions/atompubmembershipfeed.php +++ b/actions/atompubmembershipfeed.php @@ -141,12 +141,12 @@ class AtompubmembershipfeedAction extends ApiAuthAction // TRANS: Title for group membership feed. // TRANS: %s is a username. - $feed->setTitle(sprintf(_("%s group memberships"), + $feed->setTitle(sprintf(_('Group memberships of %s'), $this->_profile->getBestName())); // TRANS: Subtitle for group membership feed. // TRANS: %1$s is a username, %2$s is the StatusNet sitename. - $feed->setSubtitle(sprintf(_("Groups %1$s is a member of on %2$s"), + $feed->setSubtitle(sprintf(_('Groups %1$s is a member of on %2$s'), $this->_profile->getBestName(), common_config('site', 'name'))); @@ -217,7 +217,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction $this->auth_user->id != $this->_profile->id) { // TRANS: Client exception thrown when trying subscribe someone else to a group. throw new ClientException(_("Cannot add someone else's". - " membership"), 403); + " membership."), 403); } $xml = file_get_contents('php://input'); @@ -237,8 +237,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction if (Event::handle('StartAtomPubNewActivity', array(&$activity))) { if ($activity->verb != ActivityVerb::JOIN) { - // TRANS: Client error displayed when not using the POST verb. - // TRANS: Do not translate POST. + // TRANS: Client error displayed when not using the join verb. throw new ClientException(_('Can only handle join activities.')); return; } @@ -275,10 +274,7 @@ class AtompubmembershipfeedAction extends ApiAuthAction throw new ClientException(_('Blocked by admin.')); } - if (Event::handle('StartJoinGroup', array($group, $this->auth_user))) { - $membership = Group_member::join($group->id, $this->auth_user->id); - Event::handle('EndJoinGroup', array($group, $this->auth_user)); - } + $this->auth_user->joinGroup($group); Event::handle('EndAtomPubNewActivity', array($activity, $membership)); }