repeatcommand.php 851 B

123456789101112131415161718192021222324252627282930
  1. <?php
  2. if (!defined('GNUSOCIAL')) { exit(1); }
  3. class RepeatCommand extends Command
  4. {
  5. var $other = null;
  6. function __construct($user, $other)
  7. {
  8. parent::__construct($user);
  9. $this->other = $other;
  10. }
  11. function handle($channel)
  12. {
  13. $notice = $this->getNotice($this->other);
  14. try {
  15. $repeat = $notice->repeat($this->scoped->id, $channel->source());
  16. $recipient = $notice->getProfile();
  17. // TRANS: Message given having repeated a notice from another user.
  18. // TRANS: %s is the name of the user for which the notice was repeated.
  19. $channel->output($this->user, sprintf(_('Notice from %s repeated.'), $recipient->nickname));
  20. } catch (Exception $e) {
  21. $channel->error($this->user, $e->getMessage());
  22. }
  23. }
  24. }