Skip to content

Commit

Permalink
Do not try to sync Discord users who did not link their account
Browse files Browse the repository at this point in the history
  • Loading branch information
SeinopSys committed Jan 12, 2019
1 parent dcb9ff5 commit 030423b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/Models/DiscordMember.php
Expand Up @@ -136,7 +136,7 @@ public function updateAccessToken(?AccessToken $token = null, bool $save = true)
public const SYNC_COOLDOWN = 5 * Time::IN_SECONDS['minute'];

public function canBeSynced(){
return $this->last_synced === null || $this->last_synced->getTimestamp() + self::SYNC_COOLDOWN <= time();
return ($this->last_synced === null || $this->last_synced->getTimestamp() + self::SYNC_COOLDOWN <= time()) && $this->isLinked();
}

public function sync(Discord $provider = null, bool $force = false, bool $auto_unlink = true):bool {
Expand Down

0 comments on commit 030423b

Please sign in to comment.