X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=classes%2FCommand.php;h=0795f86afbc12d6f16f75abddd1c609a8b4d8885;hb=2cc3136dca5c46051934ca94684c514584184d71;hp=3a64e2fdaf6ab90569b5597a1154413603953f82;hpb=4d30c534d97a4bceddb8e426cb850196df7713b2;p=quix0rs-gnu-social.git diff --git a/classes/Command.php b/classes/Command.php index 3a64e2fdaf..0795f86afb 100644 --- a/classes/Command.php +++ b/classes/Command.php @@ -102,7 +102,7 @@ class StatsCommand extends Command { } } -class FaveCommand extends Command { +class FavCommand extends Command { var $other = NULL; @@ -133,7 +133,14 @@ class FaveCommand extends Command { return; } - mail_notify_fave($recipient, $this->user, $notice); + $other = User::staticGet('id', $recipient->id); + + if ($other && $other->id != $user->id) { + if ($other->email && $other->emailnotifyfav) { + mail_notify_fave($other, $this->user, $notice); + } + } + $this->user->blowFavesCache(); $channel->output($this->user, _('Notice marked as fave.')); @@ -180,7 +187,7 @@ class MessageCommand extends Command { function __construct($user, $other, $text) { parent::__construct($user); $this->other = $other; - $this->text = $other; + $this->text = $text; } function execute($channel) { @@ -221,8 +228,10 @@ class GetCommand extends Command { } function execute($channel) { - $target = - common_relative_profile($this->user, common_canonical_nickname($this->other)); + $target_nickname = common_canonical_nickname($this->other); + + $target = + common_relative_profile($this->user, $target_nickname); if (!$target) { $channel->error($this->user, _('No such user.')); @@ -234,6 +243,7 @@ class GetCommand extends Command { return; } $notice_content = $notice->content; + $channel->output($this->user, $target_nickname . ": " . $notice_content); } } @@ -300,9 +310,9 @@ class OffCommand extends Command { $channel->error($this->user, _("Command not yet implemented.")); } else { if ($channel->off($this->user)) { - $channel->output(_('Notification off.')); + $channel->output($this->user, _('Notification off.')); } else { - $channel->error(_('Can\'t turn off notification.')); + $channel->error($this->user, _('Can\'t turn off notification.')); } } } @@ -320,9 +330,9 @@ class OnCommand extends Command { $channel->error($this->user, _("Command not yet implemented.")); } else { if ($channel->on($this->user)) { - $channel->output(_('Notification on.')); + $channel->output($this->user, _('Notification on.')); } else { - $channel->error(_('Can\'t turn on notification.')); + $channel->error($this->user, _('Can\'t turn on notification.')); } } }