Skip to content

Commit

Permalink
hotfix e1986b2
Browse files Browse the repository at this point in the history
  • Loading branch information
noridev committed Feb 6, 2025
1 parent 59985f8 commit 0212834
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 23 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ export class setFederationAvatarShape1738776889000 {
name = 'setFederationAvatarShape1738776889000'

async up(queryRunner) {
await queryRunner.query(`ALTER TABLE "user" ADD "setFederationAvatarShape" boolean NOT NULL DEFAULT false`);
await queryRunner.query(`ALTER TABLE "user" ADD "isSquareAvatars" boolean NOT NULL DEFAULT false`);
await queryRunner.query(`ALTER TABLE "user" ADD "setFederationAvatarShape" boolean DEFAULT null`, undefined);
await queryRunner.query(`ALTER TABLE "user" ADD "isSquareAvatars" boolean DEFAULT null`, undefined);
}

async down(queryRunner) {
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/core/activitypub/ApRendererService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -543,8 +543,8 @@ export class ApRendererService {
publicKey: this.renderKey(user, keypair, '#main-key'),
isCat: user.isCat,
attachment: attachment.length ? attachment : undefined,
setFederationAvatarShape: user.setFederationAvatarShape,
isSquareAvatars: user.isSquareAvatars,
setFederationAvatarShape: user.setFederationAvatarShape ? user.setFederationAvatarShape : undefined,
isSquareAvatars: user.isSquareAvatars ? user.isSquareAvatars : undefined,
};

if (user.movedToUri) {
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/core/entities/UserEntityService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -553,8 +553,8 @@ export class UserEntityService implements OnModuleInit {
displayOrder: r.displayOrder,
})),
) : undefined,
setFederationAvatarShape: user.setFederationAvatarShape,
isSquareAvatars: user.isSquareAvatars,
setFederationAvatarShape: user.setFederationAvatarShape || undefined,
isSquareAvatars: user.isSquareAvatars || undefined,

...(isDetailed ? {
url: profile!.url,
Expand Down
8 changes: 4 additions & 4 deletions packages/backend/src/models/User.ts
Original file line number Diff line number Diff line change
Expand Up @@ -279,14 +279,14 @@ export class MiUser {
public token: string | null;

@Column('boolean', {
default: false,
nullable: true,
})
public setFederationAvatarShape: boolean;
public setFederationAvatarShape: boolean | null;

@Column('boolean', {
default: false,
nullable: true,
})
public isSquareAvatars: boolean;
public isSquareAvatars: boolean | null;

constructor(data: Partial<MiUser>) {
if (data == null) return;
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/models/json-schema/user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,11 +201,11 @@ export const packedUserLiteSchema = {
},
setFederationAvatarShape: {
type: 'boolean',
nullable: false, optional: false,
nullable: false, optional: true,
},
isSquareAvatars: {
type: 'boolean',
nullable: false, optional: false,
nullable: false, optional: true,
},
},
} as const;
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/server/api/endpoints/admin/show-user.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,11 +179,11 @@ export const meta = {
},
setFederationAvatarShape: {
type: 'boolean',
optional: false, nullable: false,
optional: true, nullable: true,
},
isSquareAvatars: {
type: 'boolean',
optional: false, nullable: false,
optional: true, nullable: true,
},
},
},
Expand Down
4 changes: 2 additions & 2 deletions packages/backend/src/server/api/endpoints/i/update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,8 +228,8 @@ export const paramDef = {
uniqueItems: true,
items: { type: 'string' },
},
setFederationAvatarShape: { type: 'boolean' },
isSquareAvatars: { type: 'boolean' },
setFederationAvatarShape: { type: 'boolean', nullable: true },
isSquareAvatars: { type: 'boolean', nullable: true },
},
} as const;

Expand Down
12 changes: 6 additions & 6 deletions packages/cherrypick-js/src/autogen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4134,8 +4134,8 @@ export type components = {
iconUrl: string | null;
displayOrder: number;
})[];
setFederationAvatarShape: boolean;
isSquareAvatars: boolean;
setFederationAvatarShape?: boolean;
isSquareAvatars?: boolean;
};
UserDetailedNotMeOnly: {
/** Format: url */
Expand Down Expand Up @@ -10724,8 +10724,8 @@ export type operations = {
expiresAt: string | null;
roleId: string;
})[];
setFederationAvatarShape: boolean;
isSquareAvatars: boolean;
setFederationAvatarShape?: boolean | null;
isSquareAvatars?: boolean | null;
};
};
};
Expand Down Expand Up @@ -22245,8 +22245,8 @@ export type operations = {
};
emailNotificationTypes?: string[];
alsoKnownAs?: string[];
setFederationAvatarShape?: boolean;
isSquareAvatars?: boolean;
setFederationAvatarShape?: boolean | null;
isSquareAvatars?: boolean | null;
};
};
};
Expand Down
2 changes: 1 addition & 1 deletion packages/frontend/src/boot/main-boot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,7 @@ export async function mainBoot() {
signout();
});

// ν”„λ‘œν•„ μ•„μ΄μ½˜ λͺ¨μ–‘ μ„€μ • μ—°ν•©
// ν”„λ‘œν•„ μ•„μ΄μ½˜ λͺ¨μ–‘ μ„€μ • μ—°ν•© μ΄ˆκΈ°ν™”
if ($i.policies.canSetFederationAvatarShape && defaultStore.state.setFederationAvatarShape) {
await misskeyApi('i/update', {
setFederationAvatarShape: true,
Expand Down

0 comments on commit 0212834

Please sign in to comment.