MDL-50824 message/externallib.php: Fix get_string call

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.
This commit is contained in:
Clement Smith
2016-06-02 07:11:16 -05:00
parent 6a74e76fb8
commit 126a4bc47b
+2 -1
View File
@@ -137,7 +137,8 @@ class core_message_external extends external_api {
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)