silenced users can't send direct messages

This commit is contained in:
Evan Prodromou 2009-11-16 19:51:41 +01:00
parent e9321a1806
commit 440af7ed7a

View File

@ -39,6 +39,12 @@ class Message extends Memcached_DataObject
static function saveNew($from, $to, $content, $source) { 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 = new Message();
$msg->from_profile = $from; $msg->from_profile = $from;