summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--actions/newmessage.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/actions/newmessage.php b/actions/newmessage.php
index 609577db5..38e70c90d 100644
--- a/actions/newmessage.php
+++ b/actions/newmessage.php
@@ -98,6 +98,11 @@ class NewmessageAction extends Action
$user = common_current_user();
+ if (!$user) {
+ $this->clientError(_('Only logged-in users can send direct messages.'), 403);
+ return false;
+ }
+
$this->content = $this->trimmed('content');
$this->to = $this->trimmed('to');