MDL-52892 message: users' pic overrides others
authordg711 <devang.only@gmail.com>
Sun, 14 Feb 2016 10:15:02 +0000 (15:45 +0530)
committerdg711 <devang.only@gmail.com>
Thu, 18 Feb 2016 19:28:44 +0000 (00:58 +0530)
While listing the messages , the logged in users' profile pic used to
override over other users' pics .

message/lib.php

index 9ded749..77a82dd 100644 (file)
@@ -1528,11 +1528,7 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false, $i
 
     if ($user === false) {
         echo $OUTPUT->user_picture($USER, $userpictureparams);
-    } else if (core_user::is_real_user($user->id)) { // If not real user, then don't show any links.
-        $userpictureparams['link'] = false;
-        echo $OUTPUT->user_picture($USER, $userpictureparams);
-        echo fullname($user);
-    } else {
+    } else if (core_user::is_real_user($user->id)) {
         echo $OUTPUT->user_picture($user, $userpictureparams);
 
         $link = new moodle_url("/message/index.php?id=$user->id");
@@ -1552,6 +1548,10 @@ function message_print_user ($user=false, $iscontact=false, $isblocked=false, $i
         } else {
             message_contact_link($user->id, 'block', $return, $script, $includeicontext);
         }
+    } else { // If not real user, then don't show any links.
+        $userpictureparams['link'] = false;
+        echo $OUTPUT->user_picture($USER, $userpictureparams);
+        echo fullname($user);
     }
 }