Skip to content

Commit

Permalink
MDL-50824 message/externallib.php: Fix get_string call
Browse files Browse the repository at this point in the history
This fixes the get_string call by adding the intended recipient's
fullname as the third argument when a user tries to message the
recipient, the recipient is blocking non-contacts from messaging
them, and the user is not in the recipient's contact list.
  • Loading branch information
cdsmith-umn committed Jun 2, 2016
1 parent 6a74e76 commit 126a4bc
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion message/externallib.php
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,8 @@ public static function send_instant_messages($messages = array()) {
if ($success && empty($contactlist[$message['touserid']]) && !empty($blocknoncontacts)) {
// The user isn't a contact and they have selected to block non contacts so this message won't be sent.
$success = false;
$errormessage = get_string('userisblockingyounoncontact', 'message');
$errormessage = get_string('userisblockingyounoncontact', 'message',
fullname(core_user::get_user($message['touserid'])));
}

//now we can send the message (at least try)
Expand Down

0 comments on commit 126a4bc

Please sign in to comment.