+ $sender = Profile::staticGet('id', $from);
+
+ if (!$sender->hasRight(Right::NEWMESSAGE)) {
+ // TRANS: Client exception thrown when a user tries to send a direct message while being banned from sending them.
+ throw new ClientException(_('You are banned from sending direct messages.'));
+ }
+
+ $user = User::staticGet('id', $sender->id);