]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Favorite/lib/favcommand.php
Move AlreadyFulfilled check to Fave::addNew
[quix0rs-gnu-social.git] / plugins / Favorite / lib / favcommand.php
1 <?php
2
3 class FavCommand extends Command 
4
5     var $other = null; 
6  
7     function __construct($user, $other) 
8     { 
9         parent::__construct($user); 
10         $this->other = $other; 
11     } 
12  
13     function handle($channel) 
14     { 
15         $notice = $this->getNotice($this->other); 
16  
17         try {
18             $fave = Fave::addNew($this->user->getProfile(), $notice); 
19         } catch (Exception $e) {
20             $channel->error($this->user, $e->getMessage());
21             return;
22         }
23  
24         // TRANS: Text shown when a notice has been marked as favourite successfully. 
25         $channel->output($this->user, _('Notice marked as fave.')); 
26     } 
27 }