diff --git a/actions/showstream.php b/actions/showstream.php index af0bcb8097..9d871e41bf 100644 --- a/actions/showstream.php +++ b/actions/showstream.php @@ -150,7 +150,7 @@ class ShowstreamAction extends StreamAction { $user = User::staticGet('id', $profile->id); if ($cur->id != $user->id && $cur->mutuallySubscribed($user)) { - common_element('a', array('href' => common_local_url('newmessage', array('nickname' => $user->nickname))), + common_element('a', array('href' => common_local_url('newmessage', array('to' => $user->id))), _('Send a message')); } diff --git a/classes/User.php b/classes/User.php index 4305c15411..1168406ef8 100644 --- a/classes/User.php +++ b/classes/User.php @@ -117,7 +117,7 @@ class User extends DB_DataObject static $blacklist = array('rss', 'xrds', 'doc', 'main', 'settings', 'notice', 'user', 'search', 'avatar', 'tag', 'tags', - 'api'); + 'api', 'message'); $merged = array_merge($blacklist, common_config('nickname', 'blacklist')); return !in_array($nickname, $merged); } diff --git a/htaccess.sample b/htaccess.sample index ce380666ec..de920de982 100644 --- a/htaccess.sample +++ b/htaccess.sample @@ -54,6 +54,9 @@ RewriteRule ^notice/(\d+)$ index.php?action=shownotice¬ice=$1 [L,QSA] RewriteRule ^notice/delete/((\d+))?$ index.php?action=deletenotice¬ice=$2 [L,QSA] RewriteRule ^notice/delete$ index.php?action=deletenotice [L,QSA] +RewriteRule ^message/new$ index.php?action=newmessage [L,QSA] +RewriteRule ^message/(\d+)$ index.php?action=showmessage&id=$1 [L,QSA] + RewriteRule ^user/(\d+)$ index.php?action=userbyid&id=$1 [L,QSA] RewriteRule ^tags/?$ index.php?action=tag [L,QSA] diff --git a/lib/util.php b/lib/util.php index ac2f9af360..2fdcb37e39 100644 --- a/lib/util.php +++ b/lib/util.php @@ -934,6 +934,10 @@ function common_fancy_url($action, $args=NULL) { } else { return common_path($args['nickname'].'/favorites'); } + case 'showmessage': + return common_path('message/' . $args['id']); + case 'newmessage': + return common_path('message/new' . (($args) ? ('?' . http_build_query($args)) : '')); default: return common_simple_url($action, $args); }