diff --git a/keyserver/src/creators/account-creator.js b/keyserver/src/creators/account-creator.js --- a/keyserver/src/creators/account-creator.js +++ b/keyserver/src/creators/account-creator.js @@ -7,11 +7,7 @@ import bots from 'lib/facts/bots.js'; import genesis from 'lib/facts/genesis.js'; import { policyTypes } from 'lib/facts/policies.js'; -import { - validUsernameRegex, - oldValidUsernameRegex, -} from 'lib/shared/account-utils.js'; -import { hasMinCodeVersion } from 'lib/shared/version-utils.js'; +import { validUsernameRegex } from 'lib/shared/account-utils.js'; import type { RegisterResponse, RegisterRequest, @@ -74,12 +70,7 @@ if (request.password.trim() === '') { throw new ServerError('empty_password'); } - const usernameRegex = hasMinCodeVersion(viewer.platformDetails, { - native: 69, - }) - ? validUsernameRegex - : oldValidUsernameRegex; - if (request.username.search(usernameRegex) === -1) { + if (request.username.search(validUsernameRegex) === -1) { throw new ServerError('invalid_username'); } @@ -103,11 +94,7 @@ reservedUsernamesSet.has(request.username.toLowerCase()) || isValidEthereumAddress(request.username.toLowerCase()) ) { - if (hasMinCodeVersion(viewer.platformDetails, { native: 120 })) { - throw new ServerError('username_reserved'); - } else { - throw new ServerError('username_taken'); - } + throw new ServerError('username_reserved'); } if (usernameResult[0].count !== 0) { throw new ServerError('username_taken'); diff --git a/keyserver/src/creators/thread-creator.js b/keyserver/src/creators/thread-creator.js --- a/keyserver/src/creators/thread-creator.js +++ b/keyserver/src/creators/thread-creator.js @@ -10,7 +10,6 @@ generateRandomColor, } from 'lib/shared/color-utils.js'; import { getThreadTypeParentRequirement } from 'lib/shared/thread-utils.js'; -import { hasMinCodeVersion } from 'lib/shared/version-utils.js'; import type { Shape } from 'lib/types/core.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; @@ -283,17 +282,14 @@ invariant(existingThreadResult.length > 0, 'thread should exist'); const existingThreadID = existingThreadResult[0].id.toString(); - let calendarQuery; - if (hasMinCodeVersion(viewer.platformDetails, { native: 87 })) { - invariant(request.calendarQuery, 'calendar query should exist'); - calendarQuery = { - ...request.calendarQuery, - filters: [ - ...request.calendarQuery.filters, - { type: 'threads', threadIDs: [existingThreadID] }, - ], - }; - } + invariant(request.calendarQuery, 'calendar query should exist'); + const calendarQuery = { + ...request.calendarQuery, + filters: [ + ...request.calendarQuery.filters, + { type: 'threads', threadIDs: [existingThreadID] }, + ], + }; let joinUpdateInfos = []; let userInfos: UserInfos = {}; diff --git a/keyserver/src/fetchers/user-fetchers.js b/keyserver/src/fetchers/user-fetchers.js --- a/keyserver/src/fetchers/user-fetchers.js +++ b/keyserver/src/fetchers/user-fetchers.js @@ -2,7 +2,10 @@ import invariant from 'invariant'; -import { hasMinCodeVersion } from 'lib/shared/version-utils.js'; +import { + hasMinCodeVersion, + FUTURE_CODE_VERSION, +} from 'lib/shared/version-utils.js'; import type { AvatarDBContent, ClientAvatar } from 'lib/types/avatar-types.js'; import { undirectedStatus, @@ -310,11 +313,6 @@ ]); const [userRow] = userResult; - - const stillExpectsEmailFields = !hasMinCodeVersion(viewer.platformDetails, { - native: 87, - }); - if (!userRow) { throw new ServerError('unknown_error'); } @@ -322,15 +320,6 @@ const id = userRow.id.toString(); const { username, upload_id, upload_secret } = userRow; - if (stillExpectsEmailFields) { - return { - id, - username, - email: 'removed from DB', - emailVerified: true, - }; - } - let loggedInUserInfo: LoggedInUserInfo = { id, username, @@ -360,7 +349,7 @@ } const featureGateSettings = !hasMinCodeVersion(viewer.platformDetails, { - native: 1000, + native: FUTURE_CODE_VERSION, }); if (featureGateSettings) {