feat: synchronize account icons across game profiles

This commit is contained in:
2026-07-31 11:21:08 +00:00
parent c8adeeb47b
commit 5f20413552
87 changed files with 5755 additions and 280 deletions
+6 -2
View File
@@ -14,6 +14,7 @@ import { adminRouter } from './adminRouter.js';
import { accountRouter } from './account/router.js';
import { resolveLocalAccountProfilePolicy } from './auth/localAccountPolicy.js';
import { openPassword, zDisplayName, zPasswordEnvelope, zRegistrationUsername } from './auth/registrationInput.js';
import { resolveEffectiveAccountIcon } from './auth/accountIconProjection.js';
const zUsername = z
.string()
@@ -655,6 +656,7 @@ export const appRouter = router({
});
}
const now = new Date();
const accountIcon = resolveEffectiveAccountIcon(user);
const payload = {
version: 1,
profile: gameSession.profile,
@@ -665,8 +667,10 @@ export const appRouter = router({
id: user.id,
username: user.username,
displayName: user.displayName,
picture: user.picture,
imageServer: user.imageServer,
picture: accountIcon.picture,
imageServer: accountIcon.imageServer,
iconUpdatedAt: accountIcon.revision,
...(user.profileIconResetAt ? { profileIconResetAt: user.profileIconResetAt } : {}),
canUseGeneralPicture: user.legacyGrade === undefined || user.legacyGrade >= 1,
roles: user.roles,
createdAt: user.createdAt,