gnu-social/modules/Share/lib/repeatcommand.php

30 lines
851 B
PHP
Raw Permalink Normal View History

2015-03-12 18:22:05 +00:00
<?php
if (!defined('GNUSOCIAL')) { exit(1); }
class RepeatCommand extends Command
{
var $other = null;
function __construct($user, $other)
{
parent::__construct($user);
$this->other = $other;
}
function handle($channel)
{
$notice = $this->getNotice($this->other);
try {
$repeat = $notice->repeat($this->scoped->id, $channel->source());
$recipient = $notice->getProfile();
// TRANS: Message given having repeated a notice from another user.
// TRANS: %s is the name of the user for which the notice was repeated.
$channel->output($this->user, sprintf(_('Notice from %s repeated.'), $recipient->nickname));
} catch (Exception $e) {
$channel->error($this->user, $e->getMessage());
}
}
}