summaryrefslogtreecommitdiff
path: root/classes/Message.php
diff options
context:
space:
mode:
authorEvan Prodromou <evan@status.net>2009-11-17 08:04:14 -0500
committerEvan Prodromou <evan@status.net>2009-11-17 08:04:14 -0500
commitbac2d80c919a78d5cafd57f712872a90cda04847 (patch)
treed2df10a582edc0bf9e043f1c764953a290927678 /classes/Message.php
parent9a1a83e8ebe5ad39838e6363f1537a1a5232b9cb (diff)
parent6a1afda259c5223449f679a64f932e36df5ebe39 (diff)
Merge branch '0.9.x' into adminpanel
Conflicts: classes/User.php
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;