$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'));
}
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);
}
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]
} 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);
}