temp removed discord images

This commit is contained in:
AVMG20 2021-10-14 20:32:44 +02:00
parent 2249738446
commit deb4e89701

View file

@ -213,17 +213,18 @@ class User extends Authenticatable implements MustVerifyEmail
*/ */
public function getAvatar() public function getAvatar()
{ {
if ($this->discordUser()->exists()) { //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(@getimagesize($this->discordUser->getAvatar())) { // if ($this->discordUser()->exists()) {
$avatar = $this->discordUser->getAvatar(); // if(@getimagesize($this->discordUser->getAvatar())) {
} else { // $avatar = $this->discordUser->getAvatar();
$avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email))); // } else {
} // $avatar = "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
} 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; return "https://www.gravatar.com/avatar/" . md5(strtolower(trim($this->email)));
} }