X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=actions%2Frepeat.php;h=44c57456fa3cb6f5ead2b24d0016ee778aba9e4a;hb=9d0ccbff01c1d861d152e30feeb2094f5a2742b4;hp=38d6efa6c66bbc5f1c692beb91e30472986468de;hpb=27d0e8f0a411488cd2a09009759078501102c7a1;p=quix0rs-gnu-social.git diff --git a/actions/repeat.php b/actions/repeat.php index 38d6efa6c6..44c57456fa 100644 --- a/actions/repeat.php +++ b/actions/repeat.php @@ -1,5 +1,4 @@ user = common_current_user(); if (empty($this->user)) { - $this->clientError(_("Only logged-in users can repeat notices.")); + // TRANS: Client error displayed when trying to repeat a notice while not logged in. + $this->clientError(_('Only logged-in users can repeat notices.')); return false; } $id = $this->trimmed('notice'); if (empty($id)) { - $this->clientError(_("No notice specified.")); + // TRANS: Client error displayed when trying to repeat a notice while not providing a notice ID. + $this->clientError(_('No notice specified.')); return false; } $this->notice = Notice::staticGet('id', $id); if (empty($this->notice)) { - $this->clientError(_("No notice specified.")); - return false; - } - - if ($this->user->id == $this->notice->profile_id) { - $this->clientError(_("You can't repeat your own notice.")); + // TRANS: Client error displayed when trying to repeat a non-existing notice. + $this->clientError(_('No notice specified.')); return false; } $token = $this->trimmed('token-'.$id); if (empty($token) || $token != common_session_token()) { - $this->clientError(_("There was a problem with your session token. Try again, please.")); - return false; - } - - $profile = $this->user->getProfile(); - - if ($profile->hasRepeated($id)) { - $this->clientError(_("You already repeated that notice.")); + $this->clientError(_('There was a problem with your session token. Try again, please.')); return false; } @@ -101,7 +90,6 @@ class RepeatAction extends Action * * @return void */ - function handle($args) { $repeat = $this->notice->repeat($this->user->id, 'web'); @@ -109,16 +97,18 @@ class RepeatAction extends Action if ($this->boolean('ajax')) { $this->startHTML('text/xml;charset=utf-8'); $this->elementStart('head'); + // TRANS: Title after repeating a notice. $this->element('title', null, _('Repeated')); $this->elementEnd('head'); $this->elementStart('body'); $this->element('p', array('id' => 'repeat_response', 'class' => 'repeated'), + // TRANS: Confirmation text after repeating a notice. _('Repeated!')); $this->elementEnd('body'); $this->elementEnd('html'); } else { - // FIXME! + // @todo FIXME! } } }