MDL-36941 core_message: deprecated 'api::mark_all_read_for_user'

This commit is contained in:
Mark Nelson 2018-02-26 18:44:02 +08:00
parent 0d657cc9b7
commit 74ad60bfbe
5 changed files with 96 additions and 38 deletions

View file

@ -127,7 +127,10 @@ if (!$user2realuser) {
if (!empty($user2->id)) {
if ($currentuser && isset($conversations[$user2->id])) {
// Mark the conversation we are loading as read.
\core_message\api::mark_all_read_for_user($user1->id, $user2->id);
if ($conversationid = \core_message\api::get_conversation_between_users([$user1->id, $user2->id])) {
\core_message\api::mark_all_messages_as_read($user1->id, $conversationid);
}
// Ensure the UI knows it's read as well.
$conversations[$user2->id]->isread = 1;
}