This commit is contained in:
Dan Poltawski 2016-03-21 09:31:07 +08:00
commit d3c65e8c60

View File

@ -1429,6 +1429,9 @@ function message_print_search_results($frm, $showicontext=false, $currentuser=nu
// Load user-to record.
if ($message->useridto !== $USER->id) {
$userto = core_user::get_user($message->useridto);
if ($userto === false) {
$userto = core_user::get_noreply_user();
}
$tocontact = (array_key_exists($message->useridto, $contacts) and
($contacts[$message->useridto]->blocked == 0) );
$toblocked = (array_key_exists($message->useridto, $contacts) and
@ -1442,6 +1445,9 @@ function message_print_search_results($frm, $showicontext=false, $currentuser=nu
// Load user-from record.
if ($message->useridfrom !== $USER->id) {
$userfrom = core_user::get_user($message->useridfrom);
if ($userfrom === false) {
$userfrom = core_user::get_noreply_user();
}
$fromcontact = (array_key_exists($message->useridfrom, $contacts) and
($contacts[$message->useridfrom]->blocked == 0) );
$fromblocked = (array_key_exists($message->useridfrom, $contacts) and
@ -1548,10 +1554,11 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false, $i
} else {
message_contact_link($user->id, 'block', $return, $script, $includeicontext);
}
} else { // If not real user, then don't show any links.
} else {
// If not real user, then don't show any links.
$userpictureparams['link'] = false;
echo $OUTPUT->user_picture($USER, $userpictureparams);
echo fullname($user);
// Stock profile picture should be displayed.
echo $OUTPUT->user_picture($user, $userpictureparams);
}
}