Commit 91720d1e by pupi1985

Let user know why they can't send a private message to another user

parent e9de47fd
......@@ -77,6 +77,7 @@
'set_bonus_button' => 'Update bonus',
'title' => 'Title:',
'user_x' => 'User ^',
'user_x_disabled_private_messages' => 'User ^ has disabled private messages.',
'voted_on' => 'Voted on:',
'wall_for_x' => 'Wall for ^',
'wall_view_more' => 'View more wall posts...',
......
......@@ -68,9 +68,18 @@
// Check the user exists and work out what can and can't be set (if not using single sign-on)
if ( !qa_opt('allow_private_messages') || !is_array($toaccount) || ($toaccount['flags'] & QA_USER_FLAGS_NO_MESSAGES) )
if (!qa_opt('allow_private_messages') || !is_array($toaccount))
return include QA_INCLUDE_DIR.'qa-page-not-found.php';
// Check the target user has enabled private messages and inform the current user in case they haven't
if ($toaccount['flags'] & QA_USER_FLAGS_NO_MESSAGES) {
$qa_content['error'] = qa_lang_html_sub(
'profile/user_x_disabled_private_messages',
sprintf('<a href="%s">%s</a>', qa_path_html('user/' . $handle), qa_html($handle))
);
return $qa_content;
}
// Check that we have permission and haven't reached the limit, but don't quit just yet
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment