MDL-65093 core_message: deprecate can_post_message()

This commit is contained in:
Mark Nelson 2019-07-25 14:22:20 +08:00
parent f622ee97e3
commit 06d046c1ff
7 changed files with 237 additions and 16 deletions

View file

@ -56,9 +56,7 @@ if ($userid) {
}
if ($userid) {
$recipient = new stdClass();
$recipient->id = $userid;
if (!\core_message\api::can_post_message($recipient)) {
if (!\core_message\api::can_send_message($userid, $USER->id)) {
throw new moodle_exception('Can not contact user');
}
}