]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Share/lib/repeatcommand.php
Merge branch 'quitagram' into nightly
[quix0rs-gnu-social.git] / plugins / Share / lib / repeatcommand.php
1 <?php
2
3 if (!defined('GNUSOCIAL')) { exit(1); }
4
5 class RepeatCommand extends Command 
6
7     var $other = null; 
8     function __construct($user, $other) 
9     { 
10         parent::__construct($user); 
11         $this->other = $other; 
12     } 
13  
14     function handle($channel) 
15     { 
16         $notice = $this->getNotice($this->other); 
17  
18         try {
19             $repeat = $notice->repeat($this->scoped->id, $channel->source());
20             $recipient = $notice->getProfile();
21
22             // TRANS: Message given having repeated a notice from another user.
23             // TRANS: %s is the name of the user for which the notice was repeated.
24             $channel->output($this->user, sprintf(_('Notice from %s repeated.'), $recipient->nickname));
25         } catch (Exception $e) {
26             $channel->error($this->user, $e->getMessage());
27         }
28     } 
29 }