function handle($channel)
 {
     $recipient = $this->getUser($this->other);
     if ($recipient->id == $this->user->id) {
         throw new CommandException(_('It does not make a lot of sense to nudge yourself!'));
     } else {
         if ($recipient->email && $recipient->emailnotifynudge) {
             mail_notify_nudge($this->user, $recipient);
         }
         // XXX: notify by IM
         // XXX: notify by SMS
         $channel->output($this->user, sprintf(_('Nudge sent to %s'), $recipient->nickname));
     }
 }
Exemple #2
0
 /**
  * Do the actual notification
  *
  * @param class $user  nudger
  * @param class $other nudgee
  *
  * @return nothing
  */
 function notify($user, $other)
 {
     if ($other->id != $user->id) {
         if ($other->email && $other->emailnotifynudge) {
             mail_notify_nudge($user, $other);
         }
         // XXX: notify by IM
         // XXX: notify by SMS
     }
 }
Exemple #3
0
 function handle($channel)
 {
     $recipient = $this->getUser($this->other);
     if ($recipient->id == $this->user->id) {
         // TRANS: Command exception text shown when a user tries to nudge themselves.
         throw new CommandException(_('It does not make a lot of sense to nudge yourself!'));
     } else {
         if ($recipient->email && $recipient->emailnotifynudge) {
             mail_notify_nudge($this->user, $recipient);
         }
         // XXX: notify by IM
         // XXX: notify by SMS
         // TRANS: Message given having nudged another user.
         // TRANS: %s is the nickname of the user that was nudged.
         $channel->output($this->user, sprintf(_('Nudge sent to %s.'), $recipient->nickname));
     }
 }