MDL-63907 core_message: Pass user object to show_online_status.
[moodle.git] / message / classes / helper.php
index 67dcf87..2d17d9b 100644 (file)
@@ -314,7 +314,8 @@ class helper {
             }
         }
         $data->isonline = null;
-        if (self::show_online_status($userfields)) {
+        $user = \core_user::get_user($data->userid);
+        if (self::show_online_status($user)) {
             $data->isonline = self::is_online($userfields->lastaccess);
         }
         $data->isblocked = isset($contact->blocked) ? (bool) $contact->blocked : false;