Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Discord group sync to use v5 Nameless-Link API #3222

Merged
merged 12 commits into from
Jan 28, 2023
Prev Previous commit
Next Next commit
Fix nickname sync
  • Loading branch information
tadhgboyle committed Jan 28, 2023
commit 5a931bb157575d881b59d54953d2eaf9e9f9a94d
16 changes: 7 additions & 9 deletions modules/Core/includes/endpoints/ServerInfoEndpoint.php
Original file line number Diff line number Diff line change
Expand Up @@ -97,17 +97,15 @@ private function updateUsername(IntegrationUser $integrationUser, array $player)
return;
}

// Update username
// Update username, and nickname if displaynames is enabled
$fields = [
'username' => $player['name'],
];
if (Util::getSetting('displaynames') === '1') {
$user->update([
'username' => $player['name']
]);
} else {
$user->update([
'username' => $player['name'],
'nickname' => $player['name']
]);
$fields['nickname'] = $player['name'];
}

$user->update($fields);
}
}

Expand Down