Merge pull request #227 from 1day2die/discord_avatar

If discord is connected, use discord avatar instead of gravatar
This commit is contained in:
AVMG 2021-10-13 18:49:19 +02:00 committed by GitHub
commit 6763f5e60c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

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