]> git.mxchange.org Git - quix0rs-gnu-social.git/commitdiff
silenced users can't send direct messages
authorEvan Prodromou <evan@status.net>
Mon, 16 Nov 2009 18:51:41 +0000 (19:51 +0100)
committerEvan Prodromou <evan@status.net>
Mon, 16 Nov 2009 18:51:41 +0000 (19:51 +0100)
classes/Message.php

index 979e6e87ccbdcb4d79de3c0fec07a19a239a6812..718a9d922a525eccbb5218d9b412c11e4c24a76a 100644 (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;