3 class SearchSubUntrackCommand extends Command
7 function __construct($user, $keyword)
9 parent::__construct($user);
10 $this->keyword = $keyword;
13 function handle($channel)
16 $searchsub = SearchSub::pkeyGet(array('search' => $this->keyword,
17 'profile_id' => $cur->id));
20 // TRANS: Error text shown a user tries to untrack a search query they're not subscribed to.
21 // TRANS: %s is the keyword for the search.
22 $channel->error($cur, sprintf(_m('You are not tracking the search "%s".'), $this->keyword));
27 SearchSub::cancel($cur->getProfile(), $this->keyword);
28 } catch (Exception $e) {
29 // TRANS: Message given having failed to cancel a search subscription by untrack command.
30 // TRANS: %s is the keyword for the query.
31 $channel->error($cur, sprintf(_m('Could not end a search subscription for query "%s".'),
36 // TRANS: Message given having removed a search subscription by untrack command.
37 // TRANS: %s is the keyword for the search.
38 $channel->output($cur, sprintf(_m('You are no longer subscribed to the search "%s".'),