Browse Source

temp removed discord images

AVMG20 3 years ago
parent
commit
deb4e89701
1 changed files with 12 additions and 11 deletions
  1. 12 11
      app/Models/User.php

+ 12 - 11
app/Models/User.php

@@ -213,17 +213,18 @@ class User extends Authenticatable implements MustVerifyEmail
      */
     public function getAvatar()
     {
-        if ($this->discordUser()->exists()) {
-            if(@getimagesize($this->discordUser->getAvatar())) {
-                $avatar = $this->discordUser->getAvatar();
-            } else {
-                $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
-            }
-        } else {
-            $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
-        }
-
-        return $avatar;
+        //TODO loading the images to confirm they exist is causing to much load time. alternative has to be found :) maybe onerror tag on the <img tags>
+//        if ($this->discordUser()->exists()) {
+//            if(@getimagesize($this->discordUser->getAvatar())) {
+//                $avatar = $this->discordUser->getAvatar();
+//            } else {
+//                $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
+//            }
+//        } else {
+//            $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
+//        }
+
+        return "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
 
     }