diff --git a/keyserver/src/responders/thread-responders.js b/keyserver/src/responders/thread-responders.js --- a/keyserver/src/responders/thread-responders.js +++ b/keyserver/src/responders/thread-responders.js @@ -3,6 +3,7 @@ import t from 'tcomb'; import type { TInterface, TUnion } from 'tcomb'; +import { rawThreadInfoValidator } from 'lib/permissions/minimally-encoded-thread-permissions-validators.js'; import { mediaValidator } from 'lib/types/media-types.js'; import { rawMessageInfoValidator, @@ -30,7 +31,6 @@ type RoleModificationResult, type RoleDeletionRequest, type RoleDeletionResult, - legacyRawThreadInfoValidator, } from 'lib/types/thread-types.js'; import { serverUpdateInfoValidator } from 'lib/types/update-types.js'; import { userInfosValidator } from 'lib/types/user-types.js'; @@ -289,7 +289,7 @@ export const roleModificationResultValidator: TInterface = tShape({ - threadInfo: t.maybe(legacyRawThreadInfoValidator), + threadInfo: t.maybe(rawThreadInfoValidator), updatesResult: tShape({ newUpdates: t.list(serverUpdateInfoValidator), }), @@ -310,7 +310,7 @@ export const roleDeletionResultValidator: TInterface = tShape({ - threadInfo: t.maybe(legacyRawThreadInfoValidator), + threadInfo: t.maybe(rawThreadInfoValidator), updatesResult: tShape({ newUpdates: t.list(serverUpdateInfoValidator), }), diff --git a/keyserver/src/responders/user-responders.js b/keyserver/src/responders/user-responders.js --- a/keyserver/src/responders/user-responders.js +++ b/keyserver/src/responders/user-responders.js @@ -62,7 +62,6 @@ type SubscriptionUpdateResponse, threadSubscriptionValidator, } from 'lib/types/subscription-types.js'; -import { legacyRawThreadInfoValidator } from 'lib/types/thread-types.js'; import { createUpdatesResultValidator } from 'lib/types/update-types.js'; import { type PasswordUpdate, @@ -254,7 +253,7 @@ rawMessageInfos: t.list(rawMessageInfoValidator), currentUserInfo: loggedInUserInfoValidator, cookieChange: tShape({ - threadInfos: t.dict(tID, legacyRawThreadInfoValidator), + threadInfos: t.dict(tID, rawThreadInfoValidator), userInfos: t.list(userInfoValidator), }), }); diff --git a/lib/shared/updates/join-thread-spec.js b/lib/shared/updates/join-thread-spec.js --- a/lib/shared/updates/join-thread-spec.js +++ b/lib/shared/updates/join-thread-spec.js @@ -5,6 +5,7 @@ import t from 'tcomb'; import type { UpdateInfoFromRawInfoParams, UpdateSpec } from './update-spec.js'; +import { rawThreadInfoValidator } from '../../permissions/minimally-encoded-thread-permissions-validators.js'; import { type RawEntryInfo, rawEntryInfoValidator, @@ -17,10 +18,7 @@ messageTruncationStatusValidator, rawMessageInfoValidator, } from '../../types/message-types.js'; -import { - legacyRawThreadInfoValidator, - type RawThreadInfos, -} from '../../types/thread-types.js'; +import { type RawThreadInfos } from '../../types/thread-types.js'; import { updateTypes } from '../../types/update-types-enum.js'; import type { ThreadJoinUpdateInfo, @@ -171,7 +169,7 @@ type: tNumber(updateTypes.JOIN_THREAD), id: t.String, time: t.Number, - threadInfo: legacyRawThreadInfoValidator, + threadInfo: rawThreadInfoValidator, rawMessageInfos: t.list(rawMessageInfoValidator), truncationStatus: messageTruncationStatusValidator, rawEntryInfos: t.list(rawEntryInfoValidator), diff --git a/lib/shared/updates/update-thread-spec.js b/lib/shared/updates/update-thread-spec.js --- a/lib/shared/updates/update-thread-spec.js +++ b/lib/shared/updates/update-thread-spec.js @@ -4,10 +4,8 @@ import t from 'tcomb'; import type { UpdateInfoFromRawInfoParams, UpdateSpec } from './update-spec.js'; -import { - legacyRawThreadInfoValidator, - type RawThreadInfos, -} from '../../types/thread-types.js'; +import { rawThreadInfoValidator } from '../../permissions/minimally-encoded-thread-permissions-validators.js'; +import { type RawThreadInfos } from '../../types/thread-types.js'; import { updateTypes } from '../../types/update-types-enum.js'; import type { ThreadUpdateInfo, @@ -114,6 +112,6 @@ type: tNumber(updateTypes.UPDATE_THREAD), id: t.String, time: t.Number, - threadInfo: legacyRawThreadInfoValidator, + threadInfo: rawThreadInfoValidator, }), }); diff --git a/lib/types/request-types.js b/lib/types/request-types.js --- a/lib/types/request-types.js +++ b/lib/types/request-types.js @@ -18,16 +18,14 @@ ClientThreadInconsistencyReportShape, ClientEntryInconsistencyReportShape, } from './report-types.js'; -import { - legacyRawThreadInfoValidator, - type RawThreadInfo, -} from './thread-types.js'; +import { type RawThreadInfo } from './thread-types.js'; import { type CurrentUserInfo, currentUserInfoValidator, type AccountUserInfo, accountUserInfoValidator, } from './user-types.js'; +import { rawThreadInfoValidator } from '../permissions/minimally-encoded-thread-permissions-validators.js'; import { tNumber, tShape, tID } from '../utils/validation-utils.js'; // "Server requests" are requests for information that the server delivers to @@ -133,7 +131,7 @@ ), stateChanges: t.maybe( tShape({ - rawThreadInfos: t.maybe(t.list(legacyRawThreadInfoValidator)), + rawThreadInfos: t.maybe(t.list(rawThreadInfoValidator)), rawEntryInfos: t.maybe(t.list(rawEntryInfoValidator)), currentUserInfo: t.maybe(currentUserInfoValidator), userInfos: t.maybe(t.list(accountUserInfoValidator)), diff --git a/lib/types/socket-types.js b/lib/types/socket-types.js --- a/lib/types/socket-types.js +++ b/lib/types/socket-types.js @@ -33,10 +33,7 @@ type ClientClientResponse, } from './request-types.js'; import type { SessionState, SessionIdentification } from './session-types.js'; -import { - type RawThreadInfos, - legacyRawThreadInfoValidator, -} from './thread-types.js'; +import { type RawThreadInfos } from './thread-types.js'; import { type ClientUpdatesResult, type ClientUpdatesResultWithUserInfos, @@ -53,6 +50,7 @@ type LoggedOutUserInfo, loggedOutUserInfoValidator, } from './user-types.js'; +import { rawThreadInfoValidator } from '../permissions/minimally-encoded-thread-permissions-validators.js'; import { tShape, tNumber, tID } from '../utils/validation-utils.js'; // The types of messages that the client sends across the socket @@ -193,7 +191,7 @@ }; const baseFullStateSyncValidator = tShape({ messagesResult: messagesResponseValidator, - threadInfos: t.dict(tID, legacyRawThreadInfoValidator), + threadInfos: t.dict(tID, rawThreadInfoValidator), rawEntryInfos: t.list(rawEntryInfoValidator), userInfos: t.list(userInfoValidator), updatesCurrentAsOf: t.Number,