summaryrefslogtreecommitdiff
path: root/classes/Message.php
diff options
context:
space:
mode:
Diffstat (limited to 'classes/Message.php')
-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;