summaryrefslogtreecommitdiff
path: root/actions
diff options
context:
space:
mode:
authorEvan Prodromou <evan@controlyourself.ca>2008-09-17 15:21:21 -0400
committerEvan Prodromou <evan@controlyourself.ca>2008-09-17 15:21:21 -0400
commit671282fcd5dc7ed17ea8727c0f92107f6ec1dde9 (patch)
tree624c1764a6e066aa5cbef3eedfabf52a6ca6d08c /actions
parenta4cca014515f5515fcda3aa67924b4f1277fca0d (diff)
some minor fixes for new messages
darcs-hash:20080917192121-5ed1f-15603b7f7d5246caed3e1633cc3361e1288d8653.gz
Diffstat (limited to 'actions')
-rw-r--r--actions/newmessage.php9
1 files changed, 7 insertions, 2 deletions
diff --git a/actions/newmessage.php b/actions/newmessage.php
index b324b8bf8..e8df59509 100644
--- a/actions/newmessage.php
+++ b/actions/newmessage.php
@@ -59,6 +59,9 @@ class NewmessageAction extends Action {
} else if (!$user->mutuallySubscribed($other)) {
$this->client_error(_('You can\'t send a message to this user.'), 404);
return;
+ } else if ($user->id == $other->id) {
+ $this->client_error(_('Don\'t send a message to yourself; just say it to yourself quietly instead.'), 403);
+ return;
}
$message = Message::saveNew($user->id, $other->id, $content, 'web');
@@ -93,7 +96,9 @@ class NewmessageAction extends Action {
$mutual = array();
while ($mutual_users->fetch()) {
- $mutual[$mutual_users->id] = $mutual_users->nickname;
+ if ($mutual_users->id != $user->id) {
+ $mutual[$mutual_users->id] = $mutual_users->nickname;
+ }
}
$mutual_users->free();
@@ -138,7 +143,7 @@ class NewmessageAction extends Action {
}
common_show_header(_('New message'), NULL,
- array($content, $user, $to),
+ array($content, $user, $other),
array($this, 'show_top'));
if ($msg) {