summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-16 19:51:41 +0100
committerEvan Prodromou <evan@status.net>2009-11-16 19:51:41 +0100
commit440af7ed7a2ae0a93d691c9a6a8081cbd065e53b (patch)
tree7bfce580268c04bc144902bc633624ff9c0fcaaa
parente9321a18063911f28bb55e355298ce65b36b5b71 (diff)
silenced users can't send direct messages
-rw-r--r--classes/Message.php6
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;