From 440af7ed7a2ae0a93d691c9a6a8081cbd065e53b Mon Sep 17 00:00:00 2001 From: Evan Prodromou Date: Mon, 16 Nov 2009 19:51:41 +0100 Subject: [PATCH] silenced users can't send direct messages --- classes/Message.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/classes/Message.php b/classes/Message.php index 979e6e87cc..718a9d922a 100644 --- a/classes/Message.php +++ b/classes/Message.php @@ -39,6 +39,12 @@ class Message extends Memcached_DataObject static function saveNew($from, $to, $content, $source) { + $sender = Profile::staticGet('id', $from); + + if (!$sender->hasRight(Right::NEWMESSAGE)) { + throw new ClientException(_('You are banned from sending direct messages.')); + } + $msg = new Message(); $msg->from_profile = $from; -- 2.39.5