mirror of
https://github.com/fluxerapp/fluxer
synced 2026-10-18 21:45:31 +09:00
fix(guild): treat very high as high without phone verification (#3095)
This commit is contained in:
1 parent
d691047884
commit
2df82b2b5e
28 files changed
+289
-18
No files matched your search
@@ -20,11 +20,16 @@ export const GuildVerificationLevel = {
|
||||
|
||||
export type GuildVerificationLevelValue = ValueOf<typeof GuildVerificationLevel>;
|
||||
|
||||
export function getEffectiveGuildVerificationLevel(verificationLevel: number, isDiscoverable: boolean): number {
|
||||
export function getEffectiveGuildVerificationLevel(
|
||||
verificationLevel: number,
|
||||
isDiscoverable: boolean,
|
||||
phoneVerificationEnabled: boolean,
|
||||
): number {
|
||||
const level = phoneVerificationEnabled ? verificationLevel : Math.min(verificationLevel, GuildVerificationLevel.HIGH);
|
||||
if (!isDiscoverable) {
|
||||
return verificationLevel;
|
||||
return level;
|
||||
}
|
||||
return Math.max(verificationLevel, GuildVerificationLevel.LOW);
|
||||
return Math.max(level, GuildVerificationLevel.LOW);
|
||||
}
|
||||
|
||||
export const GuildMFALevel = {
|
||||
|
||||
Reference in new issue
Block a user