diff options
author | Evan Prodromou <evan@status.net> | 2009-11-16 19:51:41 +0100 |
---|---|---|
committer | Evan Prodromou <evan@status.net> | 2009-11-16 19:51:41 +0100 |
commit | 440af7ed7a2ae0a93d691c9a6a8081cbd065e53b (patch) | |
tree | 7bfce580268c04bc144902bc633624ff9c0fcaaa /classes/Message.php | |
parent | e9321a18063911f28bb55e355298ce65b36b5b71 (diff) |
silenced users can't send direct messages
Diffstat (limited to 'classes/Message.php')
-rw-r--r-- | classes/Message.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/classes/Message.php b/classes/Message.php index 979e6e87c..718a9d922 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; |