MDL-63907 core_message: Pass user object to show_online_status.
authorcescobedo <carlos.escobedo@gmail.com>
Wed, 7 Nov 2018 16:05:12 +0000 (17:05 +0100)
committercescobedo <carlos.escobedo@gmail.com>
Wed, 7 Nov 2018 16:05:12 +0000 (17:05 +0100)
Fix create_contact() to pass user object as parameter in show_online_status.

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;