From: Evan Prodromou Date: Mon, 16 Nov 2009 18:51:41 +0000 (+0100) Subject: silenced users can't send direct messages X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=440af7ed7a2ae0a93d691c9a6a8081cbd065e53b;p=quix0rs-gnu-social.git silenced users can't send direct messages --- diff --git a/classes/Message.php b/classes/Message.php index 979e6e87cc..718a9d922a 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;