Merge pull request #227 from 1day2die/discord_avatar
If discord is connected, use discord avatar instead of gravatar
This commit is contained in:
commit
6763f5e60c
1 changed files with 7 additions and 1 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue