From d0d091547c0a7faf1cebb5dcf2a2592f14c1fef7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20D=C3=BCsterhus?= Date: Sun, 6 Oct 2013 17:27:08 +0200 Subject: [PATCH] Disallow whispering of users that block one Closes #61 --- .../lib/system/command/commands/WhisperCommand.class.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/file/lib/system/command/commands/WhisperCommand.class.php b/file/lib/system/command/commands/WhisperCommand.class.php index 38faa18..4226211 100644 --- a/file/lib/system/command/commands/WhisperCommand.class.php +++ b/file/lib/system/command/commands/WhisperCommand.class.php @@ -1,6 +1,6 @@ user = User::getUserByUsername($username); + $this->user = UserProfile::getUserProfileByUsername($username); if (!$this->user->userID) throw new \chat\system\command\UserNotFoundException($username); + if (!\wcf\system\WCF::getSession()->getPermission('user.profile.cannotBeIgnored')) { + if ($this->user->isIgnoredUser(\wcf\system\WCF::getUser()->userID)) { + throw new \wcf\system\exception\UserInputException('text', \wcf\system\WCF::getLanguage()->getDynamicVariable('chat.error.whisper.ignoresYou', array('user' => $this->user))); + } + } $this->didInit(); }