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
1 changed files with 6 additions and 0 deletions

View File

@ -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;