Skip to content
Snippets Groups Projects
Commit 3f19b5ca authored by Alan Harder's avatar Alan Harder
Browse files

#117981 don't show "write to author" links to yourself

parent fdd0570d
No related branches found
No related merge requests found
......@@ -30,7 +30,7 @@ function privatemsg_help($section) {
function privatemsg_link($type, $node = 0, $main = 0) {
global $user;
static $access = array();
if (user_access('access private messages') && ($type == 'node' || $type == 'comment') && variable_get("privatemsg_link_$type", 0) && (isset($user->privatemsg_allow) ? $user->privatemsg_allow : 1)) {
if (user_access('access private messages') && ($type == 'node' || $type == 'comment') && variable_get("privatemsg_link_$type", 0) && $node->uid != $user->uid && (isset($user->privatemsg_allow) ? $user->privatemsg_allow : 1)) {
if (!isset($access[$node->uid])) {
$author = user_load(array('uid' => $node->uid));
$access[$node->uid] = user_access('access private messages', $author) && $author->uid && (isset($author->privatemsg_allow) ? $author->privatemsg_allow : 1);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment