diff --git a/keyserver/src/scripts/generate-converter-from-validator.js b/keyserver/src/scripts/generate-converter-from-validator.js --- a/keyserver/src/scripts/generate-converter-from-validator.js +++ b/keyserver/src/scripts/generate-converter-from-validator.js @@ -8,7 +8,7 @@ } from 'lib/types/media-types.js'; import { threadPermissionInfoValidator } from 'lib/types/thread-permission-types.js'; import { rawThreadInfoValidator } from 'lib/types/thread-types.js'; -import { keyserverPrefixID, tID } from 'lib/utils/validation-utils.js'; +import { ashoatKeyserverID, tID } from 'lib/utils/validation-utils.js'; import { main } from './utils.js'; @@ -217,7 +217,7 @@ const typeName = 'RawThreadInfo'; const validatorToBeConverted = tID; const conversionExpressionString = inputName => - `'${keyserverPrefixID}|' + ${inputName}`; + `'${ashoatKeyserverID}|' + ${inputName}`; main([ async () => { console.log( diff --git a/keyserver/src/utils/validation-utils.js b/keyserver/src/utils/validation-utils.js --- a/keyserver/src/utils/validation-utils.js +++ b/keyserver/src/utils/validation-utils.js @@ -15,7 +15,7 @@ tPlatform, tPlatformDetails, assertWithValidator, - keyserverPrefixID, + ashoatKeyserverID, convertClientIDsToServerIDs, convertObject, convertServerIDsToClientIDs, @@ -43,7 +43,7 @@ ) { try { return convertClientIDsToServerIDs( - keyserverPrefixID, + ashoatKeyserverID, inputValidator, convertedInput, ); @@ -77,7 +77,7 @@ alwaysConvertSchema ) { return convertServerIDsToClientIDs( - keyserverPrefixID, + ashoatKeyserverID, outputValidator, data, ); diff --git a/lib/selectors/socket-selectors.js b/lib/selectors/socket-selectors.js --- a/lib/selectors/socket-selectors.js +++ b/lib/selectors/socket-selectors.js @@ -41,7 +41,7 @@ import { tID, convertClientIDsToServerIDs, - keyserverPrefixID, + ashoatKeyserverID, } from '../utils/validation-utils.js'; const queuedReports: ( @@ -75,17 +75,17 @@ calendarQuery: (calendarActive: boolean) => CalendarQuery, ) => { threadInfos = convertClientIDsToServerIDs( - keyserverPrefixID, + ashoatKeyserverID, t.dict(tID, rawThreadInfoValidator), threadInfos, ); userInfos = convertClientIDsToServerIDs( - keyserverPrefixID, + ashoatKeyserverID, userInfosValidator, userInfos, ); currentUserInfo = convertClientIDsToServerIDs( - keyserverPrefixID, + ashoatKeyserverID, t.maybe(currentUserInfoValidator), currentUserInfo, ); @@ -122,7 +122,7 @@ ); filteredEntryInfos = convertClientIDsToServerIDs( - keyserverPrefixID, + ashoatKeyserverID, t.dict(tID, rawEntryInfoValidator), filteredEntryInfos, ); diff --git a/lib/shared/avatar-utils.js b/lib/shared/avatar-utils.js --- a/lib/shared/avatar-utils.js +++ b/lib/shared/avatar-utils.js @@ -20,7 +20,7 @@ import { type RawThreadInfo, type ThreadInfo } from '../types/thread-types.js'; import type { UserInfos } from '../types/user-types.js'; import { useSelector } from '../utils/redux-utils.js'; -import { keyserverPrefixID } from '../utils/validation-utils.js'; +import { ashoatKeyserverID } from '../utils/validation-utils.js'; const defaultAnonymousUserEmojiAvatar: ClientEmojiAvatar = { color: selectedThreadColors[4], @@ -245,8 +245,8 @@ function getDefaultAvatar(hashKey: string, color?: string): ClientEmojiAvatar { let key = hashKey; - if (key.startsWith(`${keyserverPrefixID}|`)) { - key = key.slice(`${keyserverPrefixID}|`.length); + if (key.startsWith(`${ashoatKeyserverID}|`)) { + key = key.slice(`${ashoatKeyserverID}|`.length); } const avatarIndex = stringHash(key) % defaultEmojiAvatars.length; diff --git a/lib/utils/migration-utils.js b/lib/utils/migration-utils.js --- a/lib/utils/migration-utils.js +++ b/lib/utils/migration-utils.js @@ -2,7 +2,7 @@ import type { TranslatedThreadMessageInfos } from './message-ops-utils.js'; import { entries } from './objects.js'; -import { keyserverPrefixID } from './validation-utils.js'; +import { ashoatKeyserverID } from './validation-utils.js'; import { convertRawMessageInfoToNewIDSchema, convertRawThreadInfoToNewIDSchema, @@ -26,7 +26,7 @@ const pendingIDContents = parsePendingThreadID(threadID); if (!pendingIDContents) { - return `${keyserverPrefixID}|${key}`; + return `${ashoatKeyserverID}|${key}`; } const { threadType, sourceMessageID, memberIDs } = pendingIDContents; @@ -38,7 +38,7 @@ const convertedThreadID = getPendingThreadID( threadType, memberIDs, - `${keyserverPrefixID}|${sourceMessageID}`, + `${ashoatKeyserverID}|${sourceMessageID}`, ); return `${convertedThreadID}${draftKeySuffix}`; @@ -73,7 +73,7 @@ ): TranslatedThreadMessageInfos { return Object.fromEntries( entries(messageStoreThreads).map(([id, translatedThreadMessageInfo]) => [ - `${keyserverPrefixID}|` + id, + `${ashoatKeyserverID}|` + id, translatedThreadMessageInfo, ]), ); @@ -84,7 +84,7 @@ ): ThreadStoreThreadInfos { return Object.fromEntries( entries(threadStoreThreadInfos).map(([id, threadInfo]) => [ - `${keyserverPrefixID}|` + id, + `${ashoatKeyserverID}|` + id, convertRawThreadInfoToNewIDSchema(threadInfo), ]), ); @@ -92,7 +92,7 @@ function convertNotificationThreadIDToNewIDSchema(threadID: string): string { if (threadID.indexOf('|') === -1) { - return `${keyserverPrefixID}|${threadID}`; + return `${ashoatKeyserverID}|${threadID}`; } return threadID; } diff --git a/lib/utils/validation-utils.js b/lib/utils/validation-utils.js --- a/lib/utils/validation-utils.js +++ b/lib/utils/validation-utils.js @@ -103,7 +103,7 @@ return (data: any); } -const keyserverPrefixID = '256'; +const ashoatKeyserverID = '256'; function convertServerIDsToClientIDs( serverPrefixID: string, @@ -241,7 +241,7 @@ tMediaMessageVideo, tMediaMessageMedia, assertWithValidator, - keyserverPrefixID, + ashoatKeyserverID, convertClientIDsToServerIDs, convertServerIDsToClientIDs, convertObject, diff --git a/native/redux/persist.js b/native/redux/persist.js --- a/native/redux/persist.js +++ b/native/redux/persist.js @@ -66,7 +66,7 @@ convertThreadStoreOperationsToClientDBOperations, } from 'lib/utils/thread-ops-utils.js'; import { getUUID } from 'lib/utils/uuid.js'; -import { keyserverPrefixID } from 'lib/utils/validation-utils.js'; +import { ashoatKeyserverID } from 'lib/utils/validation-utils.js'; import { updateClientDBThreadStoreThreadInfos, @@ -641,7 +641,7 @@ ), connection: convertConnectionInfoToNewIDSchema(state.connection), watchedThreadIDs: state.watchedThreadIDs.map( - id => `${keyserverPrefixID}|${id}`, + id => `${ashoatKeyserverID}|${id}`, ), inviteLinksStore: convertInviteLinksStoreToNewIDSchema( state.inviteLinksStore,