diff --git a/keyserver/src/push/send.js b/keyserver/src/push/send.js --- a/keyserver/src/push/send.js +++ b/keyserver/src/push/send.js @@ -33,7 +33,7 @@ type RawMessageInfo, rawMessageInfoValidator, } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ResolvedNotifTexts } from 'lib/types/notif-types.js'; import { resolvedNotifTextsValidator } from 'lib/types/notif-types.js'; import type { @@ -194,7 +194,7 @@ pushUserInfo: PushUserInfo, unreadCount: number, threadInfos: { - +[threadID: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[threadID: string]: LegacyThreadInfo | ThreadInfo, }, userInfos: { +[userID: string]: GlobalUserInfo }, dbIDs: string[], // mutable diff --git a/lib/components/chat-mention-provider.react.js b/lib/components/chat-mention-provider.react.js --- a/lib/components/chat-mention-provider.react.js +++ b/lib/components/chat-mention-provider.react.js @@ -5,7 +5,7 @@ import genesis from '../facts/genesis.js'; import { threadInfoSelector } from '../selectors/thread-selectors.js'; import SentencePrefixSearchIndex from '../shared/sentence-prefix-search-index.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from '../types/thread-types-enum.js'; import type { ChatMentionCandidate, @@ -22,7 +22,7 @@ }; export type ChatMentionContextType = { +getChatMentionSearchIndex: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) => SentencePrefixSearchIndex, +communityThreadIDForGenesisThreads: { +[id: string]: string }, +chatMentionCandidatesObj: ChatMentionCandidatesObj, @@ -44,7 +44,7 @@ const searchIndices = useChatMentionSearchIndex(chatMentionCandidatesObj); const getChatMentionSearchIndex = React.useCallback( - (threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo) => { + (threadInfo: LegacyThreadInfo | ThreadInfo) => { if (threadInfo.community === genesis.id) { return searchIndices[communityThreadIDForGenesisThreads[threadInfo.id]]; } @@ -74,7 +74,7 @@ } function getChatMentionCandidates( - threadInfos: { +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo }, + threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }, resolvedThreadInfos: { +[id: string]: ResolvedThreadInfo }, ): { chatMentionCandidatesObj: ChatMentionCandidatesObj, diff --git a/lib/hooks/chat-mention-hooks.js b/lib/hooks/chat-mention-hooks.js --- a/lib/hooks/chat-mention-hooks.js +++ b/lib/hooks/chat-mention-hooks.js @@ -8,7 +8,7 @@ type ChatMentionContextType, } from '../components/chat-mention-provider.react.js'; import genesis from '../facts/genesis.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { ChatMentionCandidates, LegacyThreadInfo, @@ -22,7 +22,7 @@ } function useThreadChatMentionCandidates( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): ChatMentionCandidates { const { communityThreadIDForGenesisThreads, chatMentionCandidatesObj } = useChatMentionContext(); diff --git a/lib/hooks/child-threads.js b/lib/hooks/child-threads.js --- a/lib/hooks/child-threads.js +++ b/lib/hooks/child-threads.js @@ -15,7 +15,7 @@ import { threadInChatList } from '../shared/thread-utils.js'; import threadWatcher from '../shared/thread-watcher.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from '../types/thread-types.js'; @@ -23,9 +23,7 @@ import { useSelector } from '../utils/redux-utils.js'; type ThreadFilter = { - +predicate?: ( - thread: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => boolean, + +predicate?: (thread: LegacyThreadInfo | ThreadInfo) => boolean, +searchText?: string, }; @@ -46,9 +44,7 @@ }, [childThreads, predicate]); const filterSubchannels = React.useCallback( - ( - thread: ?(RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo), - ) => { + (thread: ?(RawThreadInfo | LegacyThreadInfo | ThreadInfo)) => { const candidateThreadID = thread?.id; if (!candidateThreadID) { return false; diff --git a/lib/hooks/promote-sidebar.react.js b/lib/hooks/promote-sidebar.react.js --- a/lib/hooks/promote-sidebar.react.js +++ b/lib/hooks/promote-sidebar.react.js @@ -13,7 +13,7 @@ threadIsSidebar, } from '../shared/thread-utils.js'; import type { LoadingStatus } from '../types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from '../types/thread-permission-types.js'; import { threadTypes } from '../types/thread-types-enum.js'; import type { LegacyThreadInfo } from '../types/thread-types.js'; @@ -21,8 +21,8 @@ import { useSelector } from '../utils/redux-utils.js'; function canPromoteSidebar( - sidebarThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + sidebarThreadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): boolean { if (!threadIsSidebar(sidebarThreadInfo)) { return false; @@ -46,7 +46,7 @@ }; function usePromoteSidebar( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, onError?: () => mixed, ): PromoteSidebarType { const dispatchActionPromise = useDispatchActionPromise(); @@ -57,10 +57,10 @@ const loadingStatus = useSelector(loadingStatusSelector); const { parentThreadID } = threadInfo; - const parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo = - useSelector(state => + const parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo = useSelector( + state => parentThreadID ? threadInfoSelector(state)[parentThreadID] : null, - ); + ); const canPromote = canPromoteSidebar(threadInfo, parentThreadInfo); diff --git a/lib/hooks/relationship-prompt.js b/lib/hooks/relationship-prompt.js --- a/lib/hooks/relationship-prompt.js +++ b/lib/hooks/relationship-prompt.js @@ -8,7 +8,7 @@ updateRelationshipsActionTypes, } from '../actions/relationship-actions.js'; import { getSingleOtherUser } from '../shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { type RelationshipAction, relationshipActions, @@ -32,7 +32,7 @@ }; function useRelationshipPrompt( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, onErrorCallback?: () => void, pendingPersonalThreadUserInfo?: ?UserInfo, ): RelationshipPromptData { diff --git a/lib/hooks/search-threads.js b/lib/hooks/search-threads.js --- a/lib/hooks/search-threads.js +++ b/lib/hooks/search-threads.js @@ -11,7 +11,7 @@ import { threadIsChannel } from '../shared/thread-utils.js'; import type { SetState } from '../types/hook-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, SidebarInfo } from '../types/thread-types.js'; @@ -31,7 +31,7 @@ }; function useSearchThreads( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, childThreadInfos: $ReadOnlyArray, ): SearchThreadsResult { const [searchState, setSearchState] = React.useState({ @@ -91,7 +91,7 @@ } function useSearchSidebars( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): SearchThreadsResult { const childThreadInfos = useSelector( state => sidebarInfoSelector(state)[threadInfo.id] ?? [], @@ -100,12 +100,11 @@ } function useSearchSubchannels( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): SearchThreadsResult { const filterFunc = React.useCallback( - ( - thread: ?(LegacyThreadInfo | MinimallyEncodedThreadInfo | RawThreadInfo), - ) => threadIsChannel(thread) && thread?.parentThreadID === threadInfo.id, + (thread: ?(LegacyThreadInfo | ThreadInfo | RawThreadInfo)) => + threadIsChannel(thread) && thread?.parentThreadID === threadInfo.id, [threadInfo.id], ); const childThreadInfos = useFilteredChatListData(filterFunc); diff --git a/lib/hooks/toggle-unread-status.js b/lib/hooks/toggle-unread-status.js --- a/lib/hooks/toggle-unread-status.js +++ b/lib/hooks/toggle-unread-status.js @@ -10,12 +10,12 @@ SetThreadUnreadStatusPayload, SetThreadUnreadStatusRequest, } from '../types/activity-types.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from '../types/thread-types.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; function useToggleUnreadStatus( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, mostRecentNonLocalMessage: ?string, afterAction: () => void, ): () => void { diff --git a/lib/permissions/minimally-encoded-thread-permissions-validators.js b/lib/permissions/minimally-encoded-thread-permissions-validators.js --- a/lib/permissions/minimally-encoded-thread-permissions-validators.js +++ b/lib/permissions/minimally-encoded-thread-permissions-validators.js @@ -13,7 +13,7 @@ MinimallyEncodedResolvedThreadInfo, MinimallyEncodedRoleInfo, MinimallyEncodedThreadCurrentUserInfo, - MinimallyEncodedThreadInfo, + ThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { legacyMemberInfoValidator, @@ -53,8 +53,8 @@ isViewer: t.Boolean, }); -const minimallyEncodedThreadInfoValidator: TInterface = - tShape({ +const minimallyEncodedThreadInfoValidator: TInterface = + tShape({ ...legacyThreadInfoValidator.meta.props, minimallyEncoded: tBool(true), members: t.list(minimallyEncodedRelativeMemberInfoValidator), diff --git a/lib/selectors/chat-selectors.js b/lib/selectors/chat-selectors.js --- a/lib/selectors/chat-selectors.js +++ b/lib/selectors/chat-selectors.js @@ -36,7 +36,7 @@ type RobotextMessageInfo, } from '../types/message-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import type { BaseAppState } from '../types/redux-types.js'; @@ -70,7 +70,7 @@ export type ChatThreadItem = { +type: 'chatThreadItem', - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +mostRecentMessageInfo: ?MessageInfo, +mostRecentNonLocalMessage: ?string, +lastUpdatedTime: number, @@ -98,7 +98,7 @@ } function getMostRecentMessageInfo( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, messageStore: MessageStore, messages: { +[id: string]: ?MessageInfo }, ): ?MessageInfo { @@ -117,7 +117,7 @@ } function getLastUpdatedTime( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, mostRecentMessageInfo: ?MessageInfo, ): number { return mostRecentMessageInfo @@ -126,7 +126,7 @@ } function createChatThreadItem( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, messageStore: MessageStore, messages: { +[id: string]: ?MessageInfo }, sidebarInfos: ?$ReadOnlyArray, @@ -212,7 +212,7 @@ sidebarInfoSelector, ( threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, messageStore: MessageStore, messageInfos: { +[id: string]: ?MessageInfo }, @@ -233,11 +233,7 @@ function useFilteredChatListData( filterFunction: ( - threadInfo: ?( - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - | RawThreadInfo - ), + threadInfo: ?(LegacyThreadInfo | ThreadInfo | RawThreadInfo), ) => boolean, ): $ReadOnlyArray { const threadInfos = useSelector(threadInfoSelector); @@ -259,30 +255,23 @@ } function getChatThreadItems( - threadInfos: { +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo }, + threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }, messageStore: MessageStore, messageInfos: { +[id: string]: ?MessageInfo }, sidebarInfos: { +[id: string]: $ReadOnlyArray }, filterFunction: ( - threadInfo: ?( - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - | RawThreadInfo - ), + threadInfo: ?(LegacyThreadInfo | ThreadInfo | RawThreadInfo), ) => boolean, ): $ReadOnlyArray { return _flow( _filter(filterFunction), - _map( - ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ): ChatThreadItem => - createChatThreadItem( - threadInfo, - messageStore, - messageInfos, - sidebarInfos[threadInfo.id], - ), + _map((threadInfo: LegacyThreadInfo | ThreadInfo): ChatThreadItem => + createChatThreadItem( + threadInfo, + messageStore, + messageInfos, + sidebarInfos[threadInfo.id], + ), ), _orderBy('lastUpdatedTimeIncludingSidebars')('desc'), )(threadInfos); @@ -296,7 +285,7 @@ +startsCluster: boolean, endsCluster: boolean, +robotext: EntityText, - +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadCreatedFromMessage: ?LegacyThreadInfo | ?ThreadInfo, +reactions: ReactionInfo, }; export type ChatMessageInfoItem = @@ -309,9 +298,7 @@ +startsConversation: boolean, +startsCluster: boolean, endsCluster: boolean, - +threadCreatedFromMessage: - | ?LegacyThreadInfo - | ?MinimallyEncodedThreadInfo, + +threadCreatedFromMessage: ?LegacyThreadInfo | ?ThreadInfo, +reactions: ReactionInfo, +hasBeenEdited: boolean, +isPinned: boolean, @@ -330,9 +317,9 @@ threadID: string, messageStore: MessageStore, messageInfos: { +[id: string]: ?MessageInfo }, - threadInfos: { +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo }, + threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }, threadInfoFromSourceMessageID: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, additionalMessages: $ReadOnlyArray, viewerID: string, @@ -605,10 +592,10 @@ messageStore: MessageStore, messageInfos: { +[id: string]: ?MessageInfo }, threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, threadInfoFromSourceMessageID: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, viewerID: ?string, ): ?(ChatMessageItem[]) => { @@ -635,7 +622,7 @@ export type UseMessageListDataArgs = { +searching: boolean, +userInfoInputArray: $ReadOnlyArray, - +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: ?LegacyThreadInfo | ?ThreadInfo, }; function useMessageListData({ diff --git a/lib/selectors/nav-selectors.js b/lib/selectors/nav-selectors.js --- a/lib/selectors/nav-selectors.js +++ b/lib/selectors/nav-selectors.js @@ -13,7 +13,7 @@ } from '../types/entry-types.js'; import type { CalendarFilter } from '../types/filter-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import type { BaseNavInfo } from '../types/nav-types.js'; @@ -123,9 +123,7 @@ } function useThreadSearchIndex( - threadInfos: $ReadOnlyArray< - RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, - >, + threadInfos: $ReadOnlyArray, ): SearchIndex { const userInfos = useSelector(state => state.userStore.userInfos); const viewerID = useSelector( diff --git a/lib/selectors/thread-selectors.js b/lib/selectors/thread-selectors.js --- a/lib/selectors/thread-selectors.js +++ b/lib/selectors/thread-selectors.js @@ -40,7 +40,7 @@ import type { EntryInfo } from '../types/entry-types.js'; import type { MessageStore, RawMessageInfo } from '../types/message-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import type { BaseAppState } from '../types/redux-types.js'; @@ -63,7 +63,7 @@ const _mapValuesWithKeys = _mapValues.convert({ cap: false }); type ThreadInfoSelectorType = (state: BaseAppState<>) => { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }; const threadInfoSelector: ThreadInfoSelectorType = createObjectSelector( (state: BaseAppState<>) => state.threadStore.threadInfos, @@ -74,78 +74,66 @@ const communityThreadSelector: ( state: BaseAppState<>, -) => $ReadOnlyArray = - createSelector( - threadInfoSelector, - (threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, - }) => { - const result = []; - for (const threadID in threadInfos) { - const threadInfo = threadInfos[threadID]; - if (!threadTypeIsCommunityRoot(threadInfo.type)) { - continue; - } - result.push(threadInfo); +) => $ReadOnlyArray = createSelector( + threadInfoSelector, + (threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }) => { + const result = []; + for (const threadID in threadInfos) { + const threadInfo = threadInfos[threadID]; + if (!threadTypeIsCommunityRoot(threadInfo.type)) { + continue; } - return result; - }, - ); + result.push(threadInfo); + } + return result; + }, +); const canBeOnScreenThreadInfos: ( state: BaseAppState<>, -) => $ReadOnlyArray = - createSelector( - threadInfoSelector, - (threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, - }) => { - const result = []; - for (const threadID in threadInfos) { - const threadInfo = threadInfos[threadID]; - if (!threadInFilterList(threadInfo)) { - continue; - } - result.push(threadInfo); +) => $ReadOnlyArray = createSelector( + threadInfoSelector, + (threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }) => { + const result = []; + for (const threadID in threadInfos) { + const threadInfo = threadInfos[threadID]; + if (!threadInFilterList(threadInfo)) { + continue; } - return result; - }, - ); + result.push(threadInfo); + } + return result; + }, +); const onScreenThreadInfos: ( state: BaseAppState<>, -) => $ReadOnlyArray = - createSelector( - filteredThreadIDsSelector, - canBeOnScreenThreadInfos, - ( - inputThreadIDs: ?$ReadOnlySet, - threadInfos: $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - >, - ): $ReadOnlyArray => { - const threadIDs = inputThreadIDs; - if (!threadIDs) { - return threadInfos; - } - return threadInfos.filter(threadInfo => threadIDs.has(threadInfo.id)); - }, - ); +) => $ReadOnlyArray = createSelector( + filteredThreadIDsSelector, + canBeOnScreenThreadInfos, + ( + inputThreadIDs: ?$ReadOnlySet, + threadInfos: $ReadOnlyArray, + ): $ReadOnlyArray => { + const threadIDs = inputThreadIDs; + if (!threadIDs) { + return threadInfos; + } + return threadInfos.filter(threadInfo => threadIDs.has(threadInfo.id)); + }, +); const onScreenEntryEditableThreadInfos: ( state: BaseAppState<>, -) => $ReadOnlyArray = - createSelector( - onScreenThreadInfos, - ( - threadInfos: $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - >, - ): $ReadOnlyArray => - threadInfos.filter(threadInfo => - threadHasPermission(threadInfo, threadPermissions.EDIT_ENTRIES), - ), - ); +) => $ReadOnlyArray = createSelector( + onScreenThreadInfos, + ( + threadInfos: $ReadOnlyArray, + ): $ReadOnlyArray => + threadInfos.filter(threadInfo => + threadHasPermission(threadInfo, threadPermissions.EDIT_ENTRIES), + ), +); const entryInfoSelector: (state: BaseAppState<>) => { +[id: string]: EntryInfo, @@ -172,7 +160,7 @@ daysToEntries: { +[day: string]: string[] }, startDateString: string, endDateString: string, - onScreen: $ReadOnlyArray, + onScreen: $ReadOnlyArray, includeDeleted: boolean, ) => { const allDaysWithinRange: { [string]: string[] } = {}, @@ -201,14 +189,12 @@ ); const childThreadInfos: (state: BaseAppState<>) => { - +[id: string]: $ReadOnlyArray, + +[id: string]: $ReadOnlyArray, } = createSelector( threadInfoSelector, - (threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, - }) => { + (threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }) => { const result: { - [string]: (LegacyThreadInfo | MinimallyEncodedThreadInfo)[], + [string]: (LegacyThreadInfo | ThreadInfo)[], } = {}; for (const id in threadInfos) { const threadInfo = threadInfos[id]; @@ -217,10 +203,7 @@ continue; } if (result[parentThreadID] === undefined) { - result[parentThreadID] = ([]: ( - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - )[]); + result[parentThreadID] = ([]: (LegacyThreadInfo | ThreadInfo)[]); } result[parentThreadID].push(threadInfo); } @@ -229,14 +212,12 @@ ); const containedThreadInfos: (state: BaseAppState<>) => { - +[id: string]: $ReadOnlyArray, + +[id: string]: $ReadOnlyArray, } = createSelector( threadInfoSelector, - (threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, - }) => { + (threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }) => { const result: { - [string]: (LegacyThreadInfo | MinimallyEncodedThreadInfo)[], + [string]: (LegacyThreadInfo | ThreadInfo)[], } = {}; for (const id in threadInfos) { const threadInfo = threadInfos[id]; @@ -245,10 +226,7 @@ continue; } if (result[containingThreadID] === undefined) { - result[containingThreadID] = ([]: ( - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - )[]); + result[containingThreadID] = ([]: (LegacyThreadInfo | ThreadInfo)[]); } result[containingThreadID].push(threadInfo); } @@ -257,7 +235,7 @@ ); function getMostRecentRawMessageInfo( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, messageStore: MessageStore, ): ?RawMessageInfo { const thread = messageStore.threads[threadInfo.id]; @@ -276,7 +254,7 @@ childThreadInfos, (state: BaseAppState<>) => state.messageStore, ( - childThreads: $ReadOnlyArray, + childThreads: $ReadOnlyArray, messageStore: MessageStore, ) => { const sidebarInfos = []; @@ -348,20 +326,16 @@ const baseAncestorThreadInfos: ( threadID: string, -) => ( - BaseAppState<>, -) => $ReadOnlyArray = ( +) => (BaseAppState<>) => $ReadOnlyArray = ( threadID: string, ) => createSelector( (state: BaseAppState<>) => threadInfoSelector(state), (threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, - }): $ReadOnlyArray => { - const pathComponents: (LegacyThreadInfo | MinimallyEncodedThreadInfo)[] = - []; - let node: ?(LegacyThreadInfo | MinimallyEncodedThreadInfo) = - threadInfos[threadID]; + +[id: string]: LegacyThreadInfo | ThreadInfo, + }): $ReadOnlyArray => { + const pathComponents: (LegacyThreadInfo | ThreadInfo)[] = []; + let node: ?(LegacyThreadInfo | ThreadInfo) = threadInfos[threadID]; while (node) { pathComponents.push(node); node = node.parentThreadID ? threadInfos[node.parentThreadID] : null; @@ -373,11 +347,8 @@ const ancestorThreadInfos: ( threadID: string, -) => ( - state: BaseAppState<>, -) => $ReadOnlyArray = _memoize( - baseAncestorThreadInfos, -); +) => (state: BaseAppState<>) => $ReadOnlyArray = + _memoize(baseAncestorThreadInfos); const baseOtherUsersButNoOtherAdmins: ( threadID: string, @@ -457,20 +428,19 @@ ); const threadInfoFromSourceMessageIDSelector: (state: BaseAppState<>) => { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, } = createSelector( (state: BaseAppState<>) => state.threadStore.threadInfos, threadInfoSelector, ( rawThreadInfos: RawThreadInfos, threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, ) => { const pendingToRealizedThreadIDs = pendingToRealizedThreadIDsSelector(rawThreadInfos); - const result: { [string]: LegacyThreadInfo | MinimallyEncodedThreadInfo } = - {}; + const result: { [string]: LegacyThreadInfo | ThreadInfo } = {}; for (const realizedID of pendingToRealizedThreadIDs.values()) { const threadInfo = threadInfos[realizedID]; if (threadInfo && threadInfo.sourceMessageID) { @@ -527,8 +497,8 @@ (state: BaseAppState<>) => containingThreadID ? threadInfoSelector(state)[containingThreadID] : null, ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - containingThreadInfo: ?(LegacyThreadInfo | MinimallyEncodedThreadInfo), + threadInfo: LegacyThreadInfo | ThreadInfo, + containingThreadInfo: ?(LegacyThreadInfo | ThreadInfo), ) => { return () => { let threadAvatar = getAvatarForThread(threadInfo, containingThreadInfo); @@ -549,16 +519,14 @@ const baseThreadInfosSelectorForThreadType: ( threadType: ThreadType, -) => ( - BaseAppState<>, -) => $ReadOnlyArray = ( +) => (BaseAppState<>) => $ReadOnlyArray = ( threadType: ThreadType, ) => createSelector( (state: BaseAppState<>) => threadInfoSelector(state), (threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, - }): $ReadOnlyArray => { + +[id: string]: LegacyThreadInfo | ThreadInfo, + }): $ReadOnlyArray => { const result = []; for (const threadID in threadInfos) { @@ -574,11 +542,8 @@ const threadInfosSelectorForThreadType: ( threadType: ThreadType, -) => ( - state: BaseAppState<>, -) => $ReadOnlyArray = _memoize( - baseThreadInfosSelectorForThreadType, -); +) => (state: BaseAppState<>) => $ReadOnlyArray = + _memoize(baseThreadInfosSelectorForThreadType); export { ancestorThreadInfos, diff --git a/lib/shared/ancestor-threads.js b/lib/shared/ancestor-threads.js --- a/lib/shared/ancestor-threads.js +++ b/lib/shared/ancestor-threads.js @@ -8,13 +8,13 @@ threadInfoSelector, } from '../selectors/thread-selectors.js'; import { threadIsPending } from '../shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from '../types/thread-types.js'; import { useSelector } from '../utils/redux-utils.js'; function useAncestorThreads( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, -): $ReadOnlyArray { + threadInfo: LegacyThreadInfo | ThreadInfo, +): $ReadOnlyArray { const ancestorThreads = useSelector(ancestorThreadInfos(threadInfo.id)); const genesisThreadInfo = useSelector( 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 @@ -17,7 +17,7 @@ ResolvedClientAvatar, } from '../types/avatar-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from '../types/thread-types-enum.js'; @@ -281,7 +281,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, viewerID: ?string, userInfos: UserInfos, ): ClientAvatar { @@ -307,8 +307,8 @@ } function getAvatarForThread( - thread: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, - containingThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + thread: RawThreadInfo | LegacyThreadInfo | ThreadInfo, + containingThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): ClientAvatar { if (thread.avatar) { return thread.avatar; @@ -324,7 +324,7 @@ } function useAvatarForThread( - thread: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + thread: RawThreadInfo | LegacyThreadInfo | ThreadInfo, ): ClientAvatar { const containingThreadID = thread.containingThreadID; const containingThreadInfo = useSelector(state => diff --git a/lib/shared/edit-messages-utils.js b/lib/shared/edit-messages-utils.js --- a/lib/shared/edit-messages-utils.js +++ b/lib/shared/edit-messages-utils.js @@ -14,7 +14,7 @@ SendEditMessageResult, } from '../types/message-types'; import { messageTypes } from '../types/message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from '../types/thread-permission-types.js'; import type { LegacyThreadInfo } from '../types/thread-types.js'; import { useDispatchActionPromise } from '../utils/redux-promise-utils.js'; @@ -52,7 +52,7 @@ } function useCanEditMessage( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, targetMessageInfo: ComposableMessageInfo | RobotextMessageInfo, ): boolean { const currentUserInfo = useSelector(state => state.currentUserInfo); diff --git a/lib/shared/inline-engagement-utils.js b/lib/shared/inline-engagement-utils.js --- a/lib/shared/inline-engagement-utils.js +++ b/lib/shared/inline-engagement-utils.js @@ -1,11 +1,11 @@ // @flow import type { ReactionInfo } from '../selectors/chat-selectors.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from '../types/thread-types.js'; function getInlineEngagementSidebarText( - threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): string { if (!threadInfo) { return ''; diff --git a/lib/shared/mention-utils.js b/lib/shared/mention-utils.js --- a/lib/shared/mention-utils.js +++ b/lib/shared/mention-utils.js @@ -7,7 +7,7 @@ import { stringForUserExplicit } from './user-utils.js'; import { useENSNames } from '../hooks/ens-cache.js'; import { useUserSearchIndex } from '../selectors/nav-selectors.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from '../types/thread-types-enum.js'; import type { ChatMentionCandidates, @@ -183,8 +183,8 @@ } function useUserMentionsCandidates( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): $ReadOnlyArray { return React.useMemo(() => { if (threadInfo.type !== threadTypes.SIDEBAR) { diff --git a/lib/shared/message-utils.js b/lib/shared/message-utils.js --- a/lib/shared/message-utils.js +++ b/lib/shared/message-utils.js @@ -43,7 +43,7 @@ ReactionMessageInfo, } from '../types/messages/reaction.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import type { @@ -82,8 +82,8 @@ function robotextForMessageInfo( messageInfo: RobotextMessageInfo, - threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: ?LegacyThreadInfo | ?ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): EntityText { const messageSpec = messageSpecs[messageInfo.type]; invariant( @@ -97,7 +97,7 @@ rawMessageInfo: RawMessageInfo, viewerID: ?string, userInfos: UserInfos, - threadInfos: { +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo }, + threadInfos: { +[id: string]: LegacyThreadInfo | ThreadInfo }, ): ?MessageInfo { const creatorInfo = userInfos[rawMessageInfo.creatorID]; const creator = { @@ -418,8 +418,8 @@ | RobotextMessageInfo | ReactionMessageInfo | EditMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, markdownRules: ParserRules, ): EntityText { const { messageTitle } = messageSpecs[messageInfo.type]; @@ -505,7 +505,7 @@ }; function useMessagePreview( originalMessageInfo: ?MessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, markdownRules: ParserRules, ): ?MessagePreviewResult { let messageInfo; @@ -691,7 +691,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, ): boolean { const isValidPinSource = !isInvalidPinSource(messageInfo); const isFirstMessageInSidebar = threadInfo.sourceMessageID === messageInfo.id; diff --git a/lib/shared/messages/add-members-message-spec.js b/lib/shared/messages/add-members-message-spec.js --- a/lib/shared/messages/add-members-message-spec.js +++ b/lib/shared/messages/add-members-message-spec.js @@ -19,7 +19,7 @@ type RawAddMembersMessageInfo, rawAddMembersMessageInfoValidator, } from '../../types/messages/add-members.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -125,7 +125,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, params: NotificationTextsParams, ): Promise { const addedMembersObject: { [string]: RelativeUserInfo } = {}; diff --git a/lib/shared/messages/change-role-message-spec.js b/lib/shared/messages/change-role-message-spec.js --- a/lib/shared/messages/change-role-message-spec.js +++ b/lib/shared/messages/change-role-message-spec.js @@ -23,7 +23,7 @@ rawChangeRoleMessageInfoValidator, } from '../../types/messages/change-role.js'; import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -159,7 +159,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, params: NotificationTextsParams, ): Promise { const membersObject: { [string]: RelativeUserInfo } = {}; diff --git a/lib/shared/messages/change-settings-message-spec.js b/lib/shared/messages/change-settings-message-spec.js --- a/lib/shared/messages/change-settings-message-spec.js +++ b/lib/shared/messages/change-settings-message-spec.js @@ -20,7 +20,7 @@ type RawChangeSettingsMessageInfo, rawChangeSettingsMessageInfoValidator, } from '../../types/messages/change-settings.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import { assertThreadType } from '../../types/thread-types-enum.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; @@ -159,7 +159,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, params: NotificationTextsParams, ): Promise { const mostRecentMessageInfo = messageInfos[0]; diff --git a/lib/shared/messages/create-entry-message-spec.js b/lib/shared/messages/create-entry-message-spec.js --- a/lib/shared/messages/create-entry-message-spec.js +++ b/lib/shared/messages/create-entry-message-spec.js @@ -15,7 +15,7 @@ type RawCreateEntryMessageInfo, rawCreateEntryMessageInfoValidator, } from '../../types/messages/create-entry.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -120,7 +120,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { return notifTextsForEntryCreationOrEdit(messageInfos, threadInfo); }, diff --git a/lib/shared/messages/create-sidebar-message-spec.js b/lib/shared/messages/create-sidebar-message-spec.js --- a/lib/shared/messages/create-sidebar-message-spec.js +++ b/lib/shared/messages/create-sidebar-message-spec.js @@ -21,7 +21,7 @@ type RawCreateSidebarMessageInfo, rawCreateSidebarMessageInfoValidator, } from '../../types/messages/create-sidebar.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -174,7 +174,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, params: NotificationTextsParams, ): Promise { const createSidebarMessageInfo = messageInfos[0]; diff --git a/lib/shared/messages/create-sub-thread-message-spec.js b/lib/shared/messages/create-sub-thread-message-spec.js --- a/lib/shared/messages/create-sub-thread-message-spec.js +++ b/lib/shared/messages/create-sub-thread-message-spec.js @@ -21,7 +21,7 @@ type RawCreateSubthreadMessageInfo, rawCreateSubthreadMessageInfoValidator, } from '../../types/messages/create-subthread.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import { threadPermissions } from '../../types/thread-permission-types.js'; import { threadTypes } from '../../types/thread-types-enum.js'; @@ -141,7 +141,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/create-thread-message-spec.js b/lib/shared/messages/create-thread-message-spec.js --- a/lib/shared/messages/create-thread-message-spec.js +++ b/lib/shared/messages/create-thread-message-spec.js @@ -20,7 +20,7 @@ type RawCreateThreadMessageInfo, rawCreateThreadMessageInfoValidator, } from '../../types/messages/create-thread.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -158,7 +158,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/delete-entry-message-spec.js b/lib/shared/messages/delete-entry-message-spec.js --- a/lib/shared/messages/delete-entry-message-spec.js +++ b/lib/shared/messages/delete-entry-message-spec.js @@ -15,7 +15,7 @@ type RawDeleteEntryMessageInfo, rawDeleteEntryMessageInfoValidator, } from '../../types/messages/delete-entry.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -119,7 +119,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/edit-entry-message-spec.js b/lib/shared/messages/edit-entry-message-spec.js --- a/lib/shared/messages/edit-entry-message-spec.js +++ b/lib/shared/messages/edit-entry-message-spec.js @@ -15,7 +15,7 @@ type RawEditEntryMessageInfo, rawEditEntryMessageInfoValidator, } from '../../types/messages/edit-entry.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -120,7 +120,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { return notifTextsForEntryCreationOrEdit(messageInfos, threadInfo); }, diff --git a/lib/shared/messages/join-thread-message-spec.js b/lib/shared/messages/join-thread-message-spec.js --- a/lib/shared/messages/join-thread-message-spec.js +++ b/lib/shared/messages/join-thread-message-spec.js @@ -15,7 +15,7 @@ type RawJoinThreadMessageInfo, rawJoinThreadMessageInfoValidator, } from '../../types/messages/join-thread.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -90,7 +90,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const joinerArray: { [string]: RelativeUserInfo } = {}; for (const messageInfo of messageInfos) { diff --git a/lib/shared/messages/leave-thread-message-spec.js b/lib/shared/messages/leave-thread-message-spec.js --- a/lib/shared/messages/leave-thread-message-spec.js +++ b/lib/shared/messages/leave-thread-message-spec.js @@ -15,7 +15,7 @@ type RawLeaveThreadMessageInfo, rawLeaveThreadMessageInfoValidator, } from '../../types/messages/leave-thread.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -90,7 +90,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const leaverBeavers: { [string]: RelativeUserInfo } = {}; for (const messageInfo of messageInfos) { diff --git a/lib/shared/messages/message-spec.js b/lib/shared/messages/message-spec.js --- a/lib/shared/messages/message-spec.js +++ b/lib/shared/messages/message-spec.js @@ -12,7 +12,7 @@ RawRobotextMessageInfo, } from '../../types/message-types.js'; import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo, UserInfo } from '../../types/user-types.js'; @@ -21,7 +21,7 @@ export type MessageTitleParam = { +messageInfo: Info, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +markdownRules: ParserRules, }; @@ -36,7 +36,7 @@ export type CreateMessageInfoParams = { +threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, +createMessageInfoFromRaw: (rawInfo: RawMessageInfo) => ?MessageInfo, +createRelativeUserInfos: ( @@ -45,13 +45,13 @@ }; export type RobotextParams = { - +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, - +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: ?LegacyThreadInfo | ?ThreadInfo, + +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, }; export type NotificationTextsParams = { +notifTargetUserInfo: UserInfo, - +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, }; export type GeneratesNotifsParams = { @@ -68,8 +68,8 @@ export type CreationSideEffectsFunc = ( messageInfo: RawInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => Promise; export type MessageSpec = { @@ -100,7 +100,7 @@ ) => ?RawMessageInfo, +notificationTexts?: ( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, params: NotificationTextsParams, ) => Promise, +notificationCollapseKey?: ( diff --git a/lib/shared/messages/multimedia-message-spec.js b/lib/shared/messages/multimedia-message-spec.js --- a/lib/shared/messages/multimedia-message-spec.js +++ b/lib/shared/messages/multimedia-message-spec.js @@ -41,7 +41,7 @@ } from '../../types/messages/media.js'; import { getMediaMessageServerDBContentsFromMedia } from '../../types/messages/media.js'; import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -312,7 +312,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const media = []; for (const messageInfo of messageInfos) { diff --git a/lib/shared/messages/reaction-message-spec.js b/lib/shared/messages/reaction-message-spec.js --- a/lib/shared/messages/reaction-message-spec.js +++ b/lib/shared/messages/reaction-message-spec.js @@ -25,7 +25,7 @@ type ReactionMessageInfo, } from '../../types/messages/reaction.js'; import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -164,7 +164,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/remove-members-message-spec.js b/lib/shared/messages/remove-members-message-spec.js --- a/lib/shared/messages/remove-members-message-spec.js +++ b/lib/shared/messages/remove-members-message-spec.js @@ -19,7 +19,7 @@ type RemoveMembersMessageData, type RemoveMembersMessageInfo, } from '../../types/messages/remove-members.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -126,7 +126,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, params: NotificationTextsParams, ): Promise { const removedMembersObject: { [string]: RelativeUserInfo } = {}; diff --git a/lib/shared/messages/restore-entry-message-spec.js b/lib/shared/messages/restore-entry-message-spec.js --- a/lib/shared/messages/restore-entry-message-spec.js +++ b/lib/shared/messages/restore-entry-message-spec.js @@ -15,7 +15,7 @@ type RestoreEntryMessageData, type RestoreEntryMessageInfo, } from '../../types/messages/restore-entry.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -119,7 +119,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); invariant( diff --git a/lib/shared/messages/text-message-spec.js b/lib/shared/messages/text-message-spec.js --- a/lib/shared/messages/text-message-spec.js +++ b/lib/shared/messages/text-message-spec.js @@ -25,7 +25,7 @@ type TextMessageData, type TextMessageInfo, } from '../../types/messages/text.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import { threadTypes } from '../../types/thread-types-enum.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; @@ -199,7 +199,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, params: NotificationTextsParams, ): Promise { // We special-case sidebarCreations. Usually we don't send any notifs in @@ -295,8 +295,8 @@ const callChangeThreadSettings = useChangeThreadSettings(); return async ( messageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => { if (threadInfo.type !== threadTypes.SIDEBAR) { return; diff --git a/lib/shared/messages/update-relationship-message-spec.js b/lib/shared/messages/update-relationship-message-spec.js --- a/lib/shared/messages/update-relationship-message-spec.js +++ b/lib/shared/messages/update-relationship-message-spec.js @@ -19,7 +19,7 @@ type UpdateRelationshipMessageData, type UpdateRelationshipMessageInfo, } from '../../types/messages/update-relationship.js'; -import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts } from '../../types/notif-types.js'; import type { LegacyThreadInfo } from '../../types/thread-types.js'; import type { RelativeUserInfo } from '../../types/user-types.js'; @@ -149,7 +149,7 @@ async notificationTexts( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const messageInfo = assertSingleMessageInfo(messageInfos); const creator = ET.user({ userInfo: messageInfo.creator }); diff --git a/lib/shared/notif-utils.js b/lib/shared/notif-utils.js --- a/lib/shared/notif-utils.js +++ b/lib/shared/notif-utils.js @@ -17,7 +17,7 @@ } from '../types/message-types.js'; import type { CreateSidebarMessageInfo } from '../types/messages/create-sidebar.js'; import type { TextMessageInfo } from '../types/messages/text.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { NotifTexts, ResolvedNotifTexts } from '../types/notif-types.js'; import { type ThreadType, threadTypes } from '../types/thread-types-enum.js'; import type { LegacyThreadInfo } from '../types/thread-types.js'; @@ -35,8 +35,8 @@ async function notifTextsForMessageInfo( messageInfos: MessageInfo[], - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, notifTargetUserInfo: UserInfo, getENSNames: ?GetENSNames, ): Promise { @@ -62,7 +62,7 @@ function notifTextsForEntryCreationOrEdit( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): NotifTexts { const hasCreateEntry = messageInfos.some( messageInfo => messageInfo.type === messageTypes.CREATE_ENTRY, @@ -109,7 +109,7 @@ type NotifTextsForSubthreadCreationInput = { +creator: RelativeUserInfo, +threadType: ThreadType, - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, +childThreadName: ?string, +childThreadUIName: string | ThreadEntity, }; @@ -151,7 +151,7 @@ +createSidebarMessageInfo: CreateSidebarMessageInfo, +sidebarSourceMessageInfo?: ?SidebarSourceMessageInfo, +firstSidebarMessageInfo?: ?TextMessageInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +params: NotificationTextsParams, }; function notifTextsForSidebarCreation( @@ -215,8 +215,8 @@ async function fullNotifTextsForMessageInfo( messageInfos: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, notifTargetUserInfo: UserInfo, getENSNames: ?GetENSNames, ): Promise { @@ -266,8 +266,8 @@ function notifRobotextForMessageInfo( messageInfo: RobotextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): EntityText { const robotext = robotextForMessageInfo( messageInfo, diff --git a/lib/shared/reaction-utils.js b/lib/shared/reaction-utils.js --- a/lib/shared/reaction-utils.js +++ b/lib/shared/reaction-utils.js @@ -12,7 +12,7 @@ ComposableMessageInfo, RobotextMessageInfo, } from '../types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from '../types/thread-permission-types.js'; import type { LegacyThreadInfo } from '../types/thread-types.js'; import { useSelector } from '../utils/redux-utils.js'; @@ -75,7 +75,7 @@ } function useCanCreateReactionFromMessage( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, targetMessageInfo: ComposableMessageInfo | RobotextMessageInfo, ): boolean { const targetMessageCreatorRelationship = useSelector( diff --git a/lib/shared/search-utils.js b/lib/shared/search-utils.js --- a/lib/shared/search-utils.js +++ b/lib/shared/search-utils.js @@ -26,7 +26,7 @@ import { useUserSearchIndex } from '../selectors/nav-selectors.js'; import { relationshipBlockedInEitherDirection } from '../shared/relationship-utils.js'; import type { MessageInfo, RawMessageInfo } from '../types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from '../types/relationship-types.js'; import { threadPermissions } from '../types/thread-permission-types.js'; import { type ThreadType, threadTypes } from '../types/thread-types-enum.js'; @@ -61,9 +61,9 @@ }, +excludeUserIDs: $ReadOnlyArray, +userInfo: AccountUserInfo | GlobalAccountUserInfo, - +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, - +communityThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, - +containingThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + +communityThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, + +containingThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, }) { const { id } = userInfo; if (excludeUserIDs.includes(id) || id in results) { @@ -99,8 +99,8 @@ +userInfos: { +[id: string]: AccountUserInfo }, +excludeUserIDs: $ReadOnlyArray, +includeServerSearchUsers?: $ReadOnlyArray, - +inputParentThreadInfo?: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, - +inputCommunityThreadInfo?: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +inputParentThreadInfo?: ?LegacyThreadInfo | ?ThreadInfo, + +inputCommunityThreadInfo?: ?LegacyThreadInfo | ?ThreadInfo, +threadType?: ?ThreadType, }): UserListItem[] { const memoizedUserInfos = React.useMemo(() => values(userInfos), [userInfos]); diff --git a/lib/shared/thread-utils.js b/lib/shared/thread-utils.js --- a/lib/shared/thread-utils.js +++ b/lib/shared/thread-utils.js @@ -60,7 +60,7 @@ import type { RawThreadInfo, MinimallyEncodedThreadCurrentUserInfo, - MinimallyEncodedThreadInfo, + ThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { decodeMinimallyEncodedRoleInfo, @@ -128,7 +128,7 @@ function threadHasPermission( threadInfo: ?( | LegacyThreadInfo - | MinimallyEncodedThreadInfo + | ThreadInfo | LegacyRawThreadInfo | RawThreadInfo ), @@ -151,7 +151,7 @@ function viewerIsMember( threadInfo: ?( | LegacyThreadInfo - | MinimallyEncodedThreadInfo + | ThreadInfo | LegacyRawThreadInfo | RawThreadInfo ), @@ -164,7 +164,7 @@ } function threadIsInHome( - threadInfo: ?(RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo), + threadInfo: ?(RawThreadInfo | LegacyThreadInfo | ThreadInfo), ): boolean { return !!(threadInfo && threadInfo.currentUser.subscription.home); } @@ -175,7 +175,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo + | ThreadInfo ), ): boolean { return ( @@ -185,31 +185,31 @@ } function threadIsTopLevel( - threadInfo: ?(RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo), + threadInfo: ?(RawThreadInfo | LegacyThreadInfo | ThreadInfo), ): boolean { return threadInChatList(threadInfo) && threadIsChannel(threadInfo); } function threadIsChannel( - threadInfo: ?(RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo), + threadInfo: ?(RawThreadInfo | LegacyThreadInfo | ThreadInfo), ): boolean { return !!(threadInfo && threadInfo.type !== threadTypes.SIDEBAR); } function threadIsSidebar( - threadInfo: ?(RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo), + threadInfo: ?(RawThreadInfo | LegacyThreadInfo | ThreadInfo), ): boolean { return threadInfo?.type === threadTypes.SIDEBAR; } function threadInBackgroundChatList( - threadInfo: ?(RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo), + threadInfo: ?(RawThreadInfo | LegacyThreadInfo | ThreadInfo), ): boolean { return threadInChatList(threadInfo) && !threadIsInHome(threadInfo); } function threadInHomeChatList( - threadInfo: ?(RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo), + threadInfo: ?(RawThreadInfo | LegacyThreadInfo | ThreadInfo), ): boolean { return threadInChatList(threadInfo) && threadIsInHome(threadInfo); } @@ -221,7 +221,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo + | ThreadInfo ), ): boolean { return ( @@ -236,7 +236,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo + | ThreadInfo ), userID: string, ): boolean { @@ -267,11 +267,7 @@ } function threadMembersWithoutAddedAshoat< - T: - | LegacyRawThreadInfo - | RawThreadInfo - | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + T: LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo | ThreadInfo, >(threadInfo: T): $PropertyType { if (threadInfo.community !== genesis.id) { return threadInfo.members; @@ -281,9 +277,7 @@ ); } -function threadIsGroupChat( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, -): boolean { +function threadIsGroupChat(threadInfo: LegacyThreadInfo | ThreadInfo): boolean { return threadInfo.members.length > 2; } @@ -292,7 +286,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, ) { return threadMembersWithoutAddedAshoat(threadInfo).length > 2; } @@ -310,7 +304,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, viewerID: ?string, ): ?string { if (!viewerID) { @@ -372,7 +366,7 @@ +viewerID: string, +threadType: ThreadType, +members: $ReadOnlyArray, - +parentThreadInfo?: ?(LegacyThreadInfo | MinimallyEncodedThreadInfo), + +parentThreadInfo?: ?(LegacyThreadInfo | ThreadInfo), +threadColor?: ?string, +name?: ?string, +sourceMessageID?: string, @@ -386,7 +380,7 @@ threadColor, name, sourceMessageID, -}: CreatePendingThreadArgs): MinimallyEncodedThreadInfo { +}: CreatePendingThreadArgs): ThreadInfo { const now = Date.now(); if (!members.some(member => member.id === viewerID)) { throw new Error( @@ -457,7 +451,7 @@ } type PendingPersonalThread = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +pendingPersonalThreadUserInfo: UserInfo, }; @@ -517,7 +511,7 @@ // Returns map from user ID to AccountUserInfo function extractMentionedMembers( text: string, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Map { const memberMap = memberLowercaseUsernameMap(threadInfo.members); const mentions = extractUserMentionsFromText(text); @@ -536,8 +530,8 @@ // they will be automatically added to that sidebar function extractNewMentionedParentMembers( messageText: string, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: LegacyThreadInfo | ThreadInfo, ): AccountUserInfo[] { const mentionedMembersOfParent = extractMentionedMembers( messageText, @@ -553,7 +547,7 @@ type SharedCreatePendingSidebarInput = { +sourceMessageInfo: ComposableMessageInfo | RobotextMessageInfo, - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, +loggedInUserInfo: LoggedInUserInfo, }; @@ -563,7 +557,7 @@ }; function baseCreatePendingSidebar( input: BaseCreatePendingSidebarInput, -): MinimallyEncodedThreadInfo { +): ThreadInfo { const { sourceMessageInfo, parentThreadInfo, @@ -639,7 +633,7 @@ }; function createUnresolvedPendingSidebar( input: CreateUnresolvedPendingSidebarInput, -): MinimallyEncodedThreadInfo { +): ThreadInfo { const { sourceMessageInfo, parentThreadInfo, @@ -672,7 +666,7 @@ }; async function createPendingSidebar( input: CreatePendingSidebarInput, -): Promise { +): Promise { const { sourceMessageInfo, parentThreadInfo, @@ -725,7 +719,7 @@ } type CreateRealThreadParameters = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +dispatchActionPromise: DispatchActionPromise, +createNewThread: ClientNewThreadRequest => Promise, +sourceMessageID: ?string, @@ -915,7 +909,7 @@ } function threadUIName( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): string | ThreadEntity { if (threadInfo.name) { return firstLine(threadInfo.name); @@ -949,8 +943,8 @@ rawThreadInfo: LegacyRawThreadInfo | RawThreadInfo, viewerID: ?string, userInfos: UserInfos, -): MinimallyEncodedThreadInfo { - let threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo; +): ThreadInfo { + let threadInfo: LegacyThreadInfo | ThreadInfo; if (rawThreadInfo.minimallyEncoded) { threadInfo = { minimallyEncoded: true, @@ -1039,7 +1033,7 @@ } function getMinimallyEncodedCurrentUser( - threadInfo: RawThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: RawThreadInfo | ThreadInfo, viewerID: ?string, userInfos: UserInfos, ): MinimallyEncodedThreadCurrentUserInfo { @@ -1065,7 +1059,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, viewerID: ?string, userInfos: UserInfos, checkOnlyViewerBlock?: boolean, @@ -1101,7 +1095,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, viewerID: ?string, userInfos: UserInfos, ): boolean { @@ -1109,7 +1103,7 @@ } function threadFrozenDueToViewerBlock( - threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, viewerID: ?string, userInfos: UserInfos, ): boolean { @@ -1125,7 +1119,7 @@ function memberIsAdmin( memberInfo: RelativeMemberInfo | MemberInfo, - threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, ): boolean { return !!( memberInfo.role && roleIsAdminRole(threadInfo.roles[memberInfo.role]) @@ -1152,7 +1146,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo + | ThreadInfo | ServerThreadInfo ), ): boolean { @@ -1167,7 +1161,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, ) { return ( threadMembersWithoutAddedAshoat(threadInfo).filter(member => @@ -1268,9 +1262,7 @@ } } -function useWatchThread( - threadInfo: ?(LegacyThreadInfo | MinimallyEncodedThreadInfo), -) { +function useWatchThread(threadInfo: ?(LegacyThreadInfo | ThreadInfo)) { const dispatchActionPromise = useDispatchActionPromise(); const callFetchMostRecentMessages = useFetchMostRecentMessages(); @@ -1303,10 +1295,10 @@ }; type ExistingThreadInfoFinder = ( params: ExistingThreadInfoFinderParams, -) => ?(LegacyThreadInfo | MinimallyEncodedThreadInfo); +) => ?(LegacyThreadInfo | ThreadInfo); // TODO (atul): Parameterize function once `createPendingThread` is updated. function useExistingThreadInfoFinder( - baseThreadInfo: ?(LegacyThreadInfo | MinimallyEncodedThreadInfo), + baseThreadInfo: ?(LegacyThreadInfo | ThreadInfo), ): ExistingThreadInfoFinder { const threadInfos = useSelector(threadInfoSelector); const loggedInUserInfo = useLoggedInUserInfo(); @@ -1318,7 +1310,7 @@ return React.useCallback( ( params: ExistingThreadInfoFinderParams, - ): ?(LegacyThreadInfo | MinimallyEncodedThreadInfo) => { + ): ?(LegacyThreadInfo | ThreadInfo) => { if (!baseThreadInfo) { return null; } @@ -1424,7 +1416,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, memberID: string, permission: ThreadPermission, ): boolean { @@ -1441,7 +1433,7 @@ } function useCanCreateSidebarFromMessage( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, messageInfo: ComposableMessageInfo | RobotextMessageInfo, ): boolean { const messageCreatorUserInfo = useSelector( @@ -1470,7 +1462,7 @@ } function useSidebarExistsOrCanBeCreated( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, messageItem: ChatMessageInfoItem, ): boolean { const canCreateSidebarFromMessage = useCanCreateSidebarFromMessage( @@ -1481,7 +1473,7 @@ } function checkIfDefaultMembersAreVoiced( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): boolean { const defaultRoleID = Object.keys(threadInfo.roles).find( roleID => threadInfo.roles[roleID].isDefault, @@ -1510,7 +1502,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, threadType: ThreadType, ): ?string { if (!parentThreadInfo) { @@ -1531,7 +1523,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, ): ?string { if (!parentThreadInfo) { return null; @@ -1549,7 +1541,7 @@ function getThreadListSearchResults( chatListData: $ReadOnlyArray, searchText: string, - threadFilter: (LegacyThreadInfo | MinimallyEncodedThreadInfo) => boolean, + threadFilter: (LegacyThreadInfo | ThreadInfo) => boolean, threadSearchResults: $ReadOnlySet, usersSearchResults: $ReadOnlyArray, loggedInUserInfo: ?LoggedInUserInfo, @@ -1637,7 +1629,7 @@ } function removeMemberFromThread( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, memberInfo: RelativeMemberInfo, dispatchActionPromise: DispatchActionPromise, removeUserFromThreadServerCall: ( @@ -1657,7 +1649,7 @@ function getAvailableThreadMemberActions( memberInfo: RelativeMemberInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, canEdit: ?boolean = true, ): $ReadOnlyArray<'change_role' | 'remove_user'> { const role = memberInfo.role; @@ -1692,11 +1684,11 @@ } function patchThreadInfoToIncludeMentionedMembersOfParent( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: LegacyThreadInfo | ThreadInfo, messageText: string, viewerID: string, -): LegacyThreadInfo | MinimallyEncodedThreadInfo { +): LegacyThreadInfo | ThreadInfo { const members: UserIDAndUsername[] = threadInfo.members .map(({ id, username }) => username ? ({ id, username }: UserIDAndUsername) : null, @@ -1723,7 +1715,7 @@ } function threadInfoInsideCommunity( - threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, communityID: string, ): boolean { return threadInfo.community === communityID || threadInfo.id === communityID; @@ -1734,7 +1726,7 @@ }; function useRoleMemberCountsForCommunity( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): RoleAndMemberCount { return React.useMemo(() => { const roleIDsToNames: { [string]: string } = {}; @@ -1771,7 +1763,7 @@ // the set of permission literals for each role to user-facing permission enums // to help pre-populate the permission checkboxes when editing roles. function useRoleUserSurfacedPermissions( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): RoleUserSurfacedPermissions { return React.useMemo(() => { const roleNamesToPermissions: { [string]: Set } = @@ -1806,7 +1798,7 @@ } function communityOrThreadNoun( - threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, ): string { return threadTypeIsCommunityRoot(threadInfo.type) ? 'community' @@ -1814,7 +1806,7 @@ } function getThreadsToDeleteText( - threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, ): string { return `${ threadTypeIsCommunityRoot(threadInfo.type) @@ -1849,22 +1841,18 @@ } if (isViewerProfile) { - const privateThreadInfo: ?( - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - ) = privateThreadInfos[0]; + const privateThreadInfo: ?(LegacyThreadInfo | ThreadInfo) = + privateThreadInfos[0]; return privateThreadInfo ? { threadInfo: privateThreadInfo } : null; } if (usersWithPersonalThread.has(userID)) { - const personalThreadInfo: ?( - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - ) = personalThreadInfos.find( - threadInfo => - userID === getSingleOtherUser(threadInfo, loggedInUserInfo.id), - ); + const personalThreadInfo: ?(LegacyThreadInfo | ThreadInfo) = + personalThreadInfos.find( + threadInfo => + userID === getSingleOtherUser(threadInfo, loggedInUserInfo.id), + ); return personalThreadInfo ? { threadInfo: personalThreadInfo } : null; } diff --git a/lib/shared/user-utils.js b/lib/shared/user-utils.js --- a/lib/shared/user-utils.js +++ b/lib/shared/user-utils.js @@ -3,7 +3,7 @@ import { memberHasAdminPowers } from './thread-utils.js'; import { useENSNames } from '../hooks/ens-cache.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import type { @@ -36,11 +36,7 @@ } function useKeyserverAdmin( - community: - | LegacyThreadInfo - | MinimallyEncodedThreadInfo - | RawThreadInfo - | ServerThreadInfo, + community: LegacyThreadInfo | ThreadInfo | RawThreadInfo | ServerThreadInfo, ): ?UserInfo { const userInfos = useSelector(state => state.userStore.userInfos); // This hack only works as long as there is only one admin diff --git a/lib/types/messages/create-sidebar.js b/lib/types/messages/create-sidebar.js --- a/lib/types/messages/create-sidebar.js +++ b/lib/types/messages/create-sidebar.js @@ -4,7 +4,7 @@ import { tID, tNumber, tShape } from '../../utils/validation-utils.js'; import { messageTypes } from '../message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from '../thread-types.js'; import type { RelativeUserInfo } from '../user-types.js'; @@ -52,7 +52,7 @@ +sourceMessageAuthor: RelativeUserInfo, +initialThreadState: { +name: ?string, - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, +color: string, +otherMembers: RelativeUserInfo[], }, diff --git a/lib/types/messages/create-subthread.js b/lib/types/messages/create-subthread.js --- a/lib/types/messages/create-subthread.js +++ b/lib/types/messages/create-subthread.js @@ -4,7 +4,7 @@ import { tID, tNumber, tShape } from '../../utils/validation-utils.js'; import { messageTypes } from '../message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from '../thread-types.js'; import type { RelativeUserInfo } from '../user-types.js'; @@ -37,5 +37,5 @@ threadID: string, creator: RelativeUserInfo, time: number, - childThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + childThreadInfo: LegacyThreadInfo | ThreadInfo, }; diff --git a/lib/types/messages/create-thread.js b/lib/types/messages/create-thread.js --- a/lib/types/messages/create-thread.js +++ b/lib/types/messages/create-thread.js @@ -10,7 +10,7 @@ tShape, } from '../../utils/validation-utils.js'; import { messageTypes } from '../message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../minimally-encoded-thread-permissions-types.js'; import { type ThreadType, threadTypes } from '../thread-types-enum.js'; import type { LegacyThreadInfo } from '../thread-types.js'; import type { RelativeUserInfo } from '../user-types.js'; @@ -59,7 +59,7 @@ initialThreadState: { type: ThreadType, name: ?string, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, color: string, otherMembers: RelativeUserInfo[], }, diff --git a/lib/types/minimally-encoded-thread-permissions-types.js b/lib/types/minimally-encoded-thread-permissions-types.js --- a/lib/types/minimally-encoded-thread-permissions-types.js +++ b/lib/types/minimally-encoded-thread-permissions-types.js @@ -184,7 +184,7 @@ }; }; -export type MinimallyEncodedThreadInfo = $ReadOnly<{ +export type ThreadInfo = $ReadOnly<{ ...LegacyThreadInfo, +minimallyEncoded: true, +members: $ReadOnlyArray, @@ -194,7 +194,7 @@ const minimallyEncodeThreadInfo = ( threadInfo: LegacyThreadInfo, -): MinimallyEncodedThreadInfo => { +): ThreadInfo => { invariant( !('minimallyEncoded' in threadInfo), 'threadInfo is already minimally encoded.', @@ -210,7 +210,7 @@ }; const decodeMinimallyEncodedThreadInfo = ( - minimallyEncodedThreadInfo: MinimallyEncodedThreadInfo, + minimallyEncodedThreadInfo: ThreadInfo, ): LegacyThreadInfo => { const { minimallyEncoded, members, roles, currentUser, ...rest } = minimallyEncodedThreadInfo; @@ -223,7 +223,7 @@ }; export type MinimallyEncodedResolvedThreadInfo = $ReadOnly<{ - ...MinimallyEncodedThreadInfo, + ...ThreadInfo, +uiName: string, }>; diff --git a/lib/types/thread-types.js b/lib/types/thread-types.js --- a/lib/types/thread-types.js +++ b/lib/types/thread-types.js @@ -20,7 +20,7 @@ MinimallyEncodedRelativeMemberInfo, MinimallyEncodedResolvedThreadInfo, MinimallyEncodedRoleInfo, - MinimallyEncodedThreadInfo, + ThreadInfo, } from './minimally-encoded-thread-permissions-types.js'; import { type ThreadSubscription, @@ -415,7 +415,7 @@ }; export type SidebarInfo = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +lastUpdatedTime: number, +mostRecentNonLocalMessage: ?string, }; @@ -502,6 +502,6 @@ }; export type UserProfileThreadInfo = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +pendingPersonalThreadUserInfo?: UserInfo, }; diff --git a/lib/utils/drawer-utils.react.js b/lib/utils/drawer-utils.react.js --- a/lib/utils/drawer-utils.react.js +++ b/lib/utils/drawer-utils.react.js @@ -5,7 +5,7 @@ import { values } from './objects.js'; import { threadInFilterList, threadIsChannel } from '../shared/thread-utils.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { communitySubthreads } from '../types/thread-types-enum.js'; @@ -15,7 +15,7 @@ } from '../types/thread-types.js'; type WritableCommunityDrawerItemData = { - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, itemChildren: $ReadOnlyArray>, hasSubchannelsButton: boolean, labelStyle: T, @@ -26,9 +26,7 @@ function createRecursiveDrawerItemsData( childThreadInfosMap: { - +[id: string]: $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - >, + +[id: string]: $ReadOnlyArray, }, communities: $ReadOnlyArray, labelStyles: $ReadOnlyArray, @@ -68,11 +66,9 @@ } function threadHasSubchannels( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, childThreadInfosMap: { - +[id: string]: $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - >, + +[id: string]: $ReadOnlyArray, }, ): boolean { if (!childThreadInfosMap[threadInfo.id]?.length) { @@ -111,10 +107,7 @@ function filterThreadIDsBelongingToCommunity( communityID: string, threadInfosObj: { - +[id: string]: - | RawThreadInfo - | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + +[id: string]: RawThreadInfo | LegacyThreadInfo | ThreadInfo, }, ): $ReadOnlySet { const threadInfos = values(threadInfosObj); diff --git a/lib/utils/entity-helpers.js b/lib/utils/entity-helpers.js --- a/lib/utils/entity-helpers.js +++ b/lib/utils/entity-helpers.js @@ -9,7 +9,7 @@ useENSNamesForEntityText, } from './entity-text.js'; import type { UseENSNamesOptions } from '../hooks/ens-cache.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, ResolvedThreadInfo, @@ -17,7 +17,7 @@ import { values } from '../utils/objects.js'; function useResolvedThreadInfos( - threadInfos: $ReadOnlyArray, + threadInfos: $ReadOnlyArray, options?: ?UseENSNamesOptions, ): $ReadOnlyArray { const entityText = React.useMemo( @@ -56,7 +56,7 @@ } function useResolvedOptionalThreadInfos( - threadInfos: ?$ReadOnlyArray, + threadInfos: ?$ReadOnlyArray, ): ?$ReadOnlyArray { const entityText = React.useMemo(() => { if (!threadInfos) { @@ -92,7 +92,7 @@ function useResolvedThreadInfosObj( threadInfosObj: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, options?: ?UseENSNamesOptions, ): { @@ -118,7 +118,7 @@ } function useResolvedThreadInfo( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): ResolvedThreadInfo { const resolutionInput = React.useMemo(() => [threadInfo], [threadInfo]); const [resolvedThreadInfo] = useResolvedThreadInfos(resolutionInput); @@ -126,7 +126,7 @@ } function useResolvedOptionalThreadInfo( - threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): ?ResolvedThreadInfo { const resolutionInput = React.useMemo( () => (threadInfo ? [threadInfo] : []), diff --git a/lib/utils/entity-text.js b/lib/utils/entity-text.js --- a/lib/utils/entity-text.js +++ b/lib/utils/entity-text.js @@ -10,7 +10,7 @@ import { threadNoun } from '../shared/thread-utils.js'; import { stringForUser } from '../shared/user-utils.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { @@ -141,7 +141,7 @@ type EntityTextThreadInput = | { +display: 'uiName', - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, } | { +display?: 'shortName', @@ -149,7 +149,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, +subchannel?: ?boolean, +possessive?: ?boolean, } @@ -159,7 +159,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, +possessive?: ?boolean, } | { diff --git a/lib/utils/message-pinning-utils.js b/lib/utils/message-pinning-utils.js --- a/lib/utils/message-pinning-utils.js +++ b/lib/utils/message-pinning-utils.js @@ -4,7 +4,7 @@ import { threadHasPermission } from '../shared/thread-utils.js'; import type { MessageInfo, RawMessageInfo } from '../types/message-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from '../types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from '../types/thread-permission-types.js'; @@ -19,7 +19,7 @@ | LegacyRawThreadInfo | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo, + | ThreadInfo, ): boolean { const isValidMessage = !isInvalidPinSourceForThread(messageInfo, threadInfo); const hasManagePinsPermission = threadHasPermission( diff --git a/lib/utils/role-utils.js b/lib/utils/role-utils.js --- a/lib/utils/role-utils.js +++ b/lib/utils/role-utils.js @@ -4,7 +4,7 @@ import { useSelector } from './redux-utils.js'; import { threadInfoSelector } from '../selectors/thread-selectors.js'; -import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js'; import { configurableCommunityPermissions, type ThreadRolePermissionsBlob, @@ -57,7 +57,7 @@ } function useRolesFromCommunityThreadInfo( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, memberInfos: $ReadOnlyArray, ): $ReadOnlyMap { // Our in-code system has chat-specific roles, while the diff --git a/native/avatars/edit-thread-avatar.react.js b/native/avatars/edit-thread-avatar.react.js --- a/native/avatars/edit-thread-avatar.react.js +++ b/native/avatars/edit-thread-avatar.react.js @@ -7,7 +7,7 @@ import { EditThreadAvatarContext } from 'lib/components/base-edit-thread-avatar-provider.react.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -26,7 +26,7 @@ import { useStyles } from '../themes/colors.js'; type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, +disabled?: boolean, }; function EditThreadAvatar(props: Props): React.Node { diff --git a/native/avatars/thread-avatar.react.js b/native/avatars/thread-avatar.react.js --- a/native/avatars/thread-avatar.react.js +++ b/native/avatars/thread-avatar.react.js @@ -9,7 +9,7 @@ import { getSingleOtherUser } from 'lib/shared/thread-utils.js'; import type { AvatarSize } from 'lib/types/avatar-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; @@ -25,7 +25,7 @@ +threadInfo: | RawThreadInfo | LegacyThreadInfo - | MinimallyEncodedThreadInfo + | ThreadInfo | ResolvedThreadInfo, +size: AvatarSize, }; diff --git a/native/calendar/calendar.react.js b/native/calendar/calendar.react.js --- a/native/calendar/calendar.react.js +++ b/native/calendar/calendar.react.js @@ -35,7 +35,7 @@ } from 'lib/types/entry-types.js'; import type { CalendarFilter } from 'lib/types/filter-types.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ConnectionStatus } from 'lib/types/socket-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { @@ -115,7 +115,7 @@ | { itemType: 'entryInfo', entryInfo: EntryInfoWithHeight, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, }; type ExtraData = { +activeEntries: { +[key: string]: boolean }, diff --git a/native/calendar/entry.react.js b/native/calendar/entry.react.js --- a/native/calendar/entry.react.js +++ b/native/calendar/entry.react.js @@ -42,7 +42,7 @@ SaveEntryResult, } from 'lib/types/entry-types.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import type { @@ -191,7 +191,7 @@ }; type BaseProps = { ...SharedProps, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { ...SharedProps, diff --git a/native/chat/chat-context-provider.react.js b/native/chat/chat-context-provider.react.js --- a/native/chat/chat-context-provider.react.js +++ b/native/chat/chat-context-provider.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { SidebarAnimationType } from './chat-context.js'; @@ -17,7 +17,7 @@ export type MeasurementTask = { +messages: $ReadOnlyArray, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +onMessagesMeasured: ( messagesWithHeight: $ReadOnlyArray, measuredHeights: $ReadOnlyMap, @@ -38,7 +38,7 @@ const measureMessages = React.useCallback( ( messages: ?$ReadOnlyArray, - threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: ?LegacyThreadInfo | ?ThreadInfo, onMessagesMeasured: ($ReadOnlyArray) => mixed, measurerID: number, ) => { @@ -94,7 +94,7 @@ return { measure: ( messages: ?$ReadOnlyArray, - threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: ?LegacyThreadInfo | ?ThreadInfo, onMessagesMeasured: ( $ReadOnlyArray, ) => mixed, diff --git a/native/chat/chat-context.js b/native/chat/chat-context.js --- a/native/chat/chat-context.js +++ b/native/chat/chat-context.js @@ -4,7 +4,7 @@ import * as React from 'react'; import type { SetState } from 'lib/types/hook-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { NativeChatMessageItem } from './message-data.react.js'; @@ -12,7 +12,7 @@ export type MessagesMeasurer = ( ?$ReadOnlyArray, - ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + ?LegacyThreadInfo | ?ThreadInfo, ($ReadOnlyArray) => mixed, ) => void; diff --git a/native/chat/chat-input-bar.react.js b/native/chat/chat-input-bar.react.js --- a/native/chat/chat-input-bar.react.js +++ b/native/chat/chat-input-bar.react.js @@ -73,7 +73,7 @@ MessageInfo, SendEditMessageResponse, } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import type { @@ -274,7 +274,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { ...BaseProps, @@ -298,7 +298,7 @@ +userMentionsCandidates: $ReadOnlyArray, +chatMentionSearchIndex: SentencePrefixSearchIndex, +chatMentionCandidates: ChatMentionCandidates, - +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, +editedMessagePreview: ?MessagePreviewResult, +editedMessageInfo: ?MessageInfo, +editMessage: ( diff --git a/native/chat/chat-router.js b/native/chat/chat-router.js --- a/native/chat/chat-router.js +++ b/native/chat/chat-router.js @@ -11,7 +11,7 @@ } from '@react-navigation/core'; import { CommonActions, StackRouter } from '@react-navigation/native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { createNavigateToThreadAction } from './message-list-types.js'; @@ -40,7 +40,7 @@ type ReplaceWithThreadAction = { +type: 'REPLACE_WITH_THREAD', +payload: { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }, }; type ClearThreadsAction = { @@ -52,7 +52,7 @@ type PushNewThreadAction = { +type: 'PUSH_NEW_THREAD', +payload: { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }, }; export type ChatRouterNavigationAction = @@ -64,13 +64,9 @@ export type ChatRouterNavigationHelpers = { +clearScreens: (routeNames: $ReadOnlyArray) => void, - +replaceWithThread: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + +replaceWithThread: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, +clearThreads: (threadIDs: $ReadOnlyArray) => void, - +pushNewThread: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + +pushNewThread: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, }; function ChatRouter( @@ -164,9 +160,7 @@ routeNames, }, }), - replaceWithThread: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => + replaceWithThread: (threadInfo: LegacyThreadInfo | ThreadInfo) => ({ type: replaceWithThreadActionType, payload: { threadInfo }, @@ -175,9 +169,7 @@ type: clearThreadsActionType, payload: { threadIDs }, }), - pushNewThread: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => + pushNewThread: (threadInfo: LegacyThreadInfo | ThreadInfo) => ({ type: pushNewThreadActionType, payload: { threadInfo }, diff --git a/native/chat/chat-thread-list-item.react.js b/native/chat/chat-thread-list-item.react.js --- a/native/chat/chat-thread-list-item.react.js +++ b/native/chat/chat-thread-list-item.react.js @@ -4,7 +4,7 @@ import { Text, View } from 'react-native'; import type { ChatThreadItem } from 'lib/selectors/chat-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { UserInfo } from 'lib/types/user-types.js'; import { shortAbsoluteDate } from 'lib/utils/date-utils.js'; @@ -24,15 +24,11 @@ type Props = { +data: ChatThreadItem, +onPressItem: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, pendingPersonalThreadUserInfo?: UserInfo, ) => void, - +onPressSeeMoreSidebars: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, - +onSwipeableWillOpen: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + +onPressSeeMoreSidebars: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, + +onSwipeableWillOpen: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, +currentlyOpenedSwipeableId: string, }; function ChatThreadListItem({ diff --git a/native/chat/chat-thread-list-see-more-sidebars.react.js b/native/chat/chat-thread-list-see-more-sidebars.react.js --- a/native/chat/chat-thread-list-see-more-sidebars.react.js +++ b/native/chat/chat-thread-list-see-more-sidebars.react.js @@ -4,7 +4,7 @@ import * as React from 'react'; import { Text } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { sidebarHeight } from './sidebar-item.react.js'; @@ -12,9 +12,9 @@ import { useColors, useStyles } from '../themes/colors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +unread: boolean, - +onPress: (threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo) => void, + +onPress: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, }; function ChatThreadListSeeMoreSidebars(props: Props): React.Node { const { onPress, threadInfo, unread } = props; diff --git a/native/chat/chat-thread-list-sidebar.react.js b/native/chat/chat-thread-list-sidebar.react.js --- a/native/chat/chat-thread-list-sidebar.react.js +++ b/native/chat/chat-thread-list-sidebar.react.js @@ -3,7 +3,7 @@ import * as React from 'react'; import { View } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, SidebarInfo } from 'lib/types/thread-types.js'; import { sidebarHeight, SidebarItem } from './sidebar-item.react.js'; @@ -16,12 +16,8 @@ type Props = { +sidebarInfo: SidebarInfo, - +onPressItem: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, - +onSwipeableWillOpen: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + +onPressItem: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, + +onSwipeableWillOpen: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, +currentlyOpenedSwipeableId: string, +extendArrow: boolean, }; diff --git a/native/chat/chat-thread-list.react.js b/native/chat/chat-thread-list.react.js --- a/native/chat/chat-thread-list.react.js +++ b/native/chat/chat-thread-list.react.js @@ -31,7 +31,7 @@ getThreadListSearchResults, useThreadListSearch, } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { UserInfo } from 'lib/types/user-types.js'; @@ -77,9 +77,7 @@ +route: | NavigationRoute<'HomeChatThreadList'> | NavigationRoute<'BackgroundChatThreadList'>, - +filterThreads: ( - threadItem: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => boolean, + +filterThreads: (threadItem: LegacyThreadInfo | ThreadInfo) => boolean, +emptyItem?: React.ComponentType<{}>, }; export type SearchStatus = 'inactive' | 'activating' | 'active'; @@ -129,7 +127,7 @@ ); const onSwipeableWillOpen = React.useCallback( - (threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo) => + (threadInfo: LegacyThreadInfo | ThreadInfo) => setOpenedSwipeableID(threadInfo.id), [], ); @@ -180,7 +178,7 @@ const onPressItem = React.useCallback( ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, pendingPersonalThreadUserInfo?: UserInfo, ) => { onChangeSearchText(''); @@ -193,7 +191,7 @@ ); const onPressSeeMoreSidebars = React.useCallback( - (threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo) => { + (threadInfo: LegacyThreadInfo | ThreadInfo) => { onChangeSearchText(''); if (searchInputRef.current) { searchInputRef.current.blur(); diff --git a/native/chat/compose-subchannel.react.js b/native/chat/compose-subchannel.react.js --- a/native/chat/compose-subchannel.react.js +++ b/native/chat/compose-subchannel.react.js @@ -16,7 +16,7 @@ import { userInfoSelectorForPotentialMembers } from 'lib/selectors/user-selectors.js'; import { usePotentialMemberItems } from 'lib/shared/search-utils.js'; import { threadInFilterList, userIsMember } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type ThreadType, threadTypes } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { type AccountUserInfo } from 'lib/types/user-types.js'; @@ -50,7 +50,7 @@ export type ComposeSubchannelParams = { +threadType: ThreadType, - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { @@ -205,33 +205,29 @@ threadType, }); - const existingThreads: $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - > = React.useMemo(() => { - if (userInfoInputIDs.length === 0) { - return []; - } - return _flow( - _filter( - (threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo) => - threadInFilterList(threadInfo) && - threadInfo.parentThreadID === parentThreadInfo.id && - userInfoInputIDs.every(userID => userIsMember(threadInfo, userID)), - ), - _sortBy( - ([ - 'members.length', - (threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo) => - threadInfo.name ? 1 : 0, - ]: $ReadOnlyArray< - | string - | (( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => mixed), - >), - ), - )(threadInfos); - }, [userInfoInputIDs, threadInfos, parentThreadInfo]); + const existingThreads: $ReadOnlyArray = + React.useMemo(() => { + if (userInfoInputIDs.length === 0) { + return []; + } + return _flow( + _filter( + (threadInfo: LegacyThreadInfo | ThreadInfo) => + threadInFilterList(threadInfo) && + threadInfo.parentThreadID === parentThreadInfo.id && + userInfoInputIDs.every(userID => userIsMember(threadInfo, userID)), + ), + _sortBy( + ([ + 'members.length', + (threadInfo: LegacyThreadInfo | ThreadInfo) => + threadInfo.name ? 1 : 0, + ]: $ReadOnlyArray< + string | ((threadInfo: LegacyThreadInfo | ThreadInfo) => mixed), + >), + ), + )(threadInfos); + }, [userInfoInputIDs, threadInfos, parentThreadInfo]); const navigateToThread = useNavigateToThread(); const onSelectExistingThread = React.useCallback( diff --git a/native/chat/failed-send.react.js b/native/chat/failed-send.react.js --- a/native/chat/failed-send.react.js +++ b/native/chat/failed-send.react.js @@ -9,7 +9,7 @@ import { messageTypes } from 'lib/types/message-types-enum.js'; import type { RawComposableMessageInfo } from 'lib/types/message-types.js'; import { assertComposableRawMessage } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { multimediaMessageSendFailed } from './multimedia-message-utils.js'; @@ -47,7 +47,7 @@ +rawMessageInfo: ?RawComposableMessageInfo, +styles: $ReadOnly, +inputState: ?InputState, - +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, }; class FailedSend extends React.PureComponent { retryingText = false; diff --git a/native/chat/fullscreen-thread-media-gallery.react.js b/native/chat/fullscreen-thread-media-gallery.react.js --- a/native/chat/fullscreen-thread-media-gallery.react.js +++ b/native/chat/fullscreen-thread-media-gallery.react.js @@ -3,7 +3,7 @@ import * as React from 'react'; import { Text, TouchableOpacity, View } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { ChatNavigationProp } from './chat.react.js'; @@ -13,7 +13,7 @@ import type { VerticalBounds } from '../types/layout-types.js'; export type FullScreenThreadMediaGalleryParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; const Tabs = { diff --git a/native/chat/image-paste-modal.react.js b/native/chat/image-paste-modal.react.js --- a/native/chat/image-paste-modal.react.js +++ b/native/chat/image-paste-modal.react.js @@ -6,7 +6,7 @@ import filesystem from 'react-native-fs'; import type { PhotoPaste } from 'lib/types/media-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import sleep from 'lib/utils/sleep.js'; @@ -18,7 +18,7 @@ export type ImagePasteModalParams = { +imagePasteStagingInfo: PhotoPaste, - +thread: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +thread: LegacyThreadInfo | ThreadInfo, }; const safeAreaEdges = ['top']; diff --git a/native/chat/inline-engagement.react.js b/native/chat/inline-engagement.react.js --- a/native/chat/inline-engagement.react.js +++ b/native/chat/inline-engagement.react.js @@ -13,7 +13,7 @@ import { getInlineEngagementSidebarText } from 'lib/shared/inline-engagement-utils.js'; import { useNextLocalID } from 'lib/shared/message-utils.js'; import type { MessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { @@ -33,7 +33,7 @@ import type { ChatMessageInfoItemWithHeight } from '../types/chat-types.js'; function dummyNodeForInlineEngagementHeightMeasurement( - sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + sidebarInfo: ?LegacyThreadInfo | ?ThreadInfo, reactions: ReactionInfo, ): React.Element { return ( @@ -49,7 +49,7 @@ type DummyInlineEngagementNodeProps = { ...React.ElementConfig, +editedLabel?: ?string, - +sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +sidebarInfo: ?LegacyThreadInfo | ?ThreadInfo, +reactions: ReactionInfo, }; function DummyInlineEngagementNode( @@ -129,8 +129,8 @@ type Props = { +messageInfo: MessageInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - +sidebarThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, + +sidebarThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, +reactions: ReactionInfo, +disabled?: boolean, +positioning?: 'left' | 'right' | 'center', diff --git a/native/chat/inner-robotext-message.react.js b/native/chat/inner-robotext-message.react.js --- a/native/chat/inner-robotext-message.react.js +++ b/native/chat/inner-robotext-message.react.js @@ -6,7 +6,7 @@ import type { ReactionInfo } from 'lib/selectors/chat-selectors.js'; import { threadInfoSelector } from 'lib/selectors/thread-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { type EntityText, @@ -27,7 +27,7 @@ function dummyNodeForRobotextMessageHeightMeasurement( robotext: EntityText, threadID: string, - sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + sidebarInfo: ?LegacyThreadInfo | ?ThreadInfo, reactions: ReactionInfo, ): React.Element { return ( diff --git a/native/chat/inner-text-message.react.js b/native/chat/inner-text-message.react.js --- a/native/chat/inner-text-message.react.js +++ b/native/chat/inner-text-message.react.js @@ -6,7 +6,7 @@ import type { ReactionInfo } from 'lib/selectors/chat-selectors.js'; import { colorIsDark } from 'lib/shared/color-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useComposedMessageMaxWidth } from './composed-message-width.js'; @@ -32,7 +32,7 @@ function dummyNodeForTextMessageHeightMeasurement( text: string, editedLabel?: ?string, - sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + sidebarInfo: ?LegacyThreadInfo | ?ThreadInfo, reactions: ReactionInfo, ): React.Element { return ( diff --git a/native/chat/message-list-container.react.js b/native/chat/message-list-container.react.js --- a/native/chat/message-list-container.react.js +++ b/native/chat/message-list-container.react.js @@ -17,7 +17,7 @@ pendingThreadType, useExistingThreadInfoFinder, } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { AccountUserInfo, UserListItem } from 'lib/types/user-types.js'; import { pinnedMessageCountText } from 'lib/utils/message-pinning-utils.js'; @@ -87,8 +87,8 @@ +updateTagInput: (items: $ReadOnlyArray) => void, +resolveToUser: (user: AccountUserInfo) => void, +userSearchResults: $ReadOnlyArray, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - +genesisThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, + +genesisThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, +messageListData: ?$ReadOnlyArray, +colors: Colors, +styles: $ReadOnly, diff --git a/native/chat/message-list-header-title.react.js b/native/chat/message-list-header-title.react.js --- a/native/chat/message-list-header-title.react.js +++ b/native/chat/message-list-header-title.react.js @@ -5,7 +5,7 @@ import * as React from 'react'; import { View } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; import { firstLine } from 'lib/utils/string-utils.js'; @@ -31,7 +31,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +navigate: $PropertyType, 'navigate'>, +isSearchEmpty: boolean, +areSettingsEnabled: boolean, diff --git a/native/chat/message-list-types.js b/native/chat/message-list-types.js --- a/native/chat/message-list-types.js +++ b/native/chat/message-list-types.js @@ -6,7 +6,7 @@ import * as React from 'react'; import { useThreadChatMentionCandidates } from 'lib/hooks/chat-mention-hooks.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { type UserInfo } from 'lib/types/user-types.js'; @@ -20,7 +20,7 @@ } from '../navigation/route-names.js'; export type MessageListParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +pendingPersonalThreadUserInfo?: UserInfo, +searching?: boolean, +removeEditMode?: ?RemoveEditMode, @@ -37,9 +37,7 @@ const MessageListContext: React.Context = React.createContext(); -function useMessageListContext( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, -) { +function useMessageListContext(threadInfo: LegacyThreadInfo | ThreadInfo) { const chatMentionCandidates = useThreadChatMentionCandidates(threadInfo); const getTextMessageMarkdownRules = useTextMessageRulesFunc( threadInfo, @@ -55,7 +53,7 @@ type Props = { +children: React.Node, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function MessageListContextProvider(props: Props): React.Node { const context = useMessageListContext(props.threadInfo); @@ -98,7 +96,7 @@ } function useNavigateToThreadWithFadeAnimation( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, messageKey: ?string, ): () => mixed { const chatContext = React.useContext(ChatContext); diff --git a/native/chat/message-list.react.js b/native/chat/message-list.react.js --- a/native/chat/message-list.react.js +++ b/native/chat/message-list.react.js @@ -19,7 +19,7 @@ import { messageKey } from 'lib/shared/message-utils.js'; import { useWatchThread } from 'lib/shared/thread-utils.js'; import type { FetchMessageInfosPayload } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { @@ -69,7 +69,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +messageListData: $ReadOnlyArray, +navigation: ChatNavigationProp<'MessageList'>, +route: NavigationRoute<'MessageList'>, diff --git a/native/chat/message-preview.react.js b/native/chat/message-preview.react.js --- a/native/chat/message-preview.react.js +++ b/native/chat/message-preview.react.js @@ -7,7 +7,7 @@ import { useThreadChatMentionCandidates } from 'lib/hooks/chat-mention-hooks.js'; import { useMessagePreview } from 'lib/shared/message-utils.js'; import { type MessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import SingleLine from '../components/single-line.react.js'; @@ -16,7 +16,7 @@ type Props = { +messageInfo: MessageInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function MessagePreview(props: Props): React.Node { const { messageInfo, threadInfo } = props; diff --git a/native/chat/message-result.react.js b/native/chat/message-result.react.js --- a/native/chat/message-result.react.js +++ b/native/chat/message-result.react.js @@ -4,7 +4,7 @@ import { Text, View } from 'react-native'; import { ScrollView } from 'react-native-gesture-handler'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { longAbsoluteDate } from 'lib/utils/date-utils.js'; @@ -20,7 +20,7 @@ type MessageResultProps = { +item: ChatMessageInfoItemWithHeight, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +navigation: | AppNavigationProp<'TogglePinModal'> | ChatNavigationProp<'MessageResultsScreen'> diff --git a/native/chat/message-results-screen.react.js b/native/chat/message-results-screen.react.js --- a/native/chat/message-results-screen.react.js +++ b/native/chat/message-results-screen.react.js @@ -15,7 +15,7 @@ isInvalidPinSourceForThread, } from 'lib/shared/message-utils.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useHeightMeasurer } from './chat-context.js'; @@ -29,7 +29,7 @@ import type { VerticalBounds } from '../types/layout-types.js'; export type MessageResultsScreenParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type MessageResultsScreenProps = { diff --git a/native/chat/parent-thread-header.react.js b/native/chat/parent-thread-header.react.js --- a/native/chat/parent-thread-header.react.js +++ b/native/chat/parent-thread-header.react.js @@ -4,7 +4,7 @@ import { Text, View } from 'react-native'; import { ScrollView } from 'react-native-gesture-handler'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ThreadType } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -15,7 +15,7 @@ import { useColors, useStyles } from '../themes/colors.js'; type Props = { - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, +childThreadType: ThreadType, }; function ParentThreadHeader(props: Props): React.Node { diff --git a/native/chat/relationship-prompt.react.js b/native/chat/relationship-prompt.react.js --- a/native/chat/relationship-prompt.react.js +++ b/native/chat/relationship-prompt.react.js @@ -5,7 +5,7 @@ import { Text, View } from 'react-native'; import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { UserInfo } from 'lib/types/user-types.js'; @@ -16,7 +16,7 @@ type Props = { +pendingPersonalThreadUserInfo: ?UserInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; const RelationshipPrompt: React.ComponentType = React.memo( diff --git a/native/chat/settings/add-users-modal.react.js b/native/chat/settings/add-users-modal.react.js --- a/native/chat/settings/add-users-modal.react.js +++ b/native/chat/settings/add-users-modal.react.js @@ -13,7 +13,7 @@ import { userInfoSelectorForPotentialMembers } from 'lib/selectors/user-selectors.js'; import { usePotentialMemberItems } from 'lib/shared/search-utils.js'; import { threadActualMembers } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { type AccountUserInfo } from 'lib/types/user-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -43,7 +43,7 @@ export type AddUsersModalParams = { +presentedFrom: string, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { diff --git a/native/chat/settings/color-selector-modal.react.js b/native/chat/settings/color-selector-modal.react.js --- a/native/chat/settings/color-selector-modal.react.js +++ b/native/chat/settings/color-selector-modal.react.js @@ -8,7 +8,7 @@ changeThreadSettingsActionTypes, useChangeThreadSettings, } from 'lib/actions/thread-actions.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type ChangeThreadSettingsPayload, type UpdateThreadRequest, @@ -30,7 +30,7 @@ export type ColorSelectorModalParams = { +presentedFrom: string, +color: string, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +setColor: (color: string) => void, }; diff --git a/native/chat/settings/compose-subchannel-modal.react.js b/native/chat/settings/compose-subchannel-modal.react.js --- a/native/chat/settings/compose-subchannel-modal.react.js +++ b/native/chat/settings/compose-subchannel-modal.react.js @@ -5,7 +5,7 @@ import { Text } from 'react-native'; import { threadTypeDescriptions } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -19,7 +19,7 @@ export type ComposeSubchannelModalParams = { +presentedFrom: string, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; const unboundStyles = { diff --git a/native/chat/settings/delete-thread.react.js b/native/chat/settings/delete-thread.react.js --- a/native/chat/settings/delete-thread.react.js +++ b/native/chat/settings/delete-thread.react.js @@ -25,7 +25,7 @@ identifyInvalidatedThreads, } from 'lib/shared/thread-utils.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LeaveThreadPayload, LegacyThreadInfo, @@ -50,7 +50,7 @@ import type { ChatNavigationProp } from '../chat.react.js'; export type DeleteThreadParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; const unboundStyles = { diff --git a/native/chat/settings/emoji-thread-avatar-creation.react.js b/native/chat/settings/emoji-thread-avatar-creation.react.js --- a/native/chat/settings/emoji-thread-avatar-creation.react.js +++ b/native/chat/settings/emoji-thread-avatar-creation.react.js @@ -7,7 +7,7 @@ import { savedEmojiAvatarSelectorForThread } from 'lib/selectors/thread-selectors.js'; import type { UpdateUserAvatarRequest } from 'lib/types/avatar-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -20,7 +20,7 @@ import { useSelector } from '../../redux/redux-utils.js'; export type EmojiThreadAvatarCreationParams = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, }; type Props = { diff --git a/native/chat/settings/thread-settings-child-thread.react.js b/native/chat/settings/thread-settings-child-thread.react.js --- a/native/chat/settings/thread-settings-child-thread.react.js +++ b/native/chat/settings/thread-settings-child-thread.react.js @@ -3,7 +3,7 @@ import * as React from 'react'; import { Platform, View } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import ThreadAvatar from '../../avatars/thread-avatar.react.js'; @@ -14,7 +14,7 @@ import { useNavigateToThread } from '../message-list-types.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +firstListItem: boolean, +lastListItem: boolean, }; diff --git a/native/chat/settings/thread-settings-color.react.js b/native/chat/settings/thread-settings-color.react.js --- a/native/chat/settings/thread-settings-color.react.js +++ b/native/chat/settings/thread-settings-color.react.js @@ -6,7 +6,7 @@ import { changeThreadSettingsActionTypes } from 'lib/actions/thread-actions.js'; import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { ThreadSettingsNavigate } from './thread-settings.react.js'; @@ -39,7 +39,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +colorEditValue: string, +setColorEditValue: (color: string) => void, +canChangeSettings: boolean, diff --git a/native/chat/settings/thread-settings-description.react.js b/native/chat/settings/thread-settings-description.react.js --- a/native/chat/settings/thread-settings-description.react.js +++ b/native/chat/settings/thread-settings-description.react.js @@ -16,7 +16,7 @@ import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; import { threadHasPermission } from 'lib/shared/thread-utils.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { type ChangeThreadSettingsPayload, @@ -88,7 +88,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +descriptionEditValue: ?string, +setDescriptionEditValue: (value: ?string, callback?: () => void) => void, +descriptionTextHeight: ?number, diff --git a/native/chat/settings/thread-settings-edit-relationship.react.js b/native/chat/settings/thread-settings-edit-relationship.react.js --- a/native/chat/settings/thread-settings-edit-relationship.react.js +++ b/native/chat/settings/thread-settings-edit-relationship.react.js @@ -14,7 +14,7 @@ getRelationshipDispatchAction, } from 'lib/shared/relationship-utils.js'; import { getSingleOtherUser } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type RelationshipAction, type RelationshipButton, @@ -30,7 +30,7 @@ import Alert from '../../utils/alert.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +buttonStyle: ViewStyle, +relationshipButton: RelationshipButton, }; diff --git a/native/chat/settings/thread-settings-home-notifs.react.js b/native/chat/settings/thread-settings-home-notifs.react.js --- a/native/chat/settings/thread-settings-home-notifs.react.js +++ b/native/chat/settings/thread-settings-home-notifs.react.js @@ -7,7 +7,7 @@ updateSubscriptionActionTypes, useUpdateSubscription, } from 'lib/actions/user-actions.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { SubscriptionUpdateRequest, SubscriptionUpdateResult, @@ -44,7 +44,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { ...BaseProps, diff --git a/native/chat/settings/thread-settings-leave-thread.react.js b/native/chat/settings/thread-settings-leave-thread.react.js --- a/native/chat/settings/thread-settings-leave-thread.react.js +++ b/native/chat/settings/thread-settings-leave-thread.react.js @@ -13,7 +13,7 @@ import { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors.js'; import { identifyInvalidatedThreads } from 'lib/shared/thread-utils.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LeaveThreadPayload, LegacyThreadInfo, @@ -52,7 +52,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +buttonStyle: ViewStyle, }; type Props = { diff --git a/native/chat/settings/thread-settings-member-tooltip-modal.react.js b/native/chat/settings/thread-settings-member-tooltip-modal.react.js --- a/native/chat/settings/thread-settings-member-tooltip-modal.react.js +++ b/native/chat/settings/thread-settings-member-tooltip-modal.react.js @@ -5,7 +5,7 @@ import { useRemoveUsersFromThread } from 'lib/actions/thread-actions.js'; import { removeMemberFromThread } from 'lib/shared/thread-utils.js'; import { stringForUser } from 'lib/shared/user-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, RelativeMemberInfo, @@ -26,7 +26,7 @@ export type ThreadSettingsMemberTooltipModalParams = TooltipParams<{ +memberInfo: RelativeMemberInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }>; function useOnRemoveUser( diff --git a/native/chat/settings/thread-settings-member.react.js b/native/chat/settings/thread-settings-member.react.js --- a/native/chat/settings/thread-settings-member.react.js +++ b/native/chat/settings/thread-settings-member.react.js @@ -19,7 +19,7 @@ import { getAvailableThreadMemberActions } from 'lib/shared/thread-utils.js'; import { stringForUser } from 'lib/shared/user-utils.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, RelativeMemberInfo, @@ -91,7 +91,7 @@ type BaseProps = { +memberInfo: RelativeMemberInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +canEdit: boolean, +navigate: ThreadSettingsNavigate, +firstListItem: boolean, diff --git a/native/chat/settings/thread-settings-parent.react.js b/native/chat/settings/thread-settings-parent.react.js --- a/native/chat/settings/thread-settings-parent.react.js +++ b/native/chat/settings/thread-settings-parent.react.js @@ -3,7 +3,7 @@ import * as React from 'react'; import { Text, View } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import ThreadAvatar from '../../avatars/thread-avatar.react.js'; @@ -13,7 +13,7 @@ import { useNavigateToThread } from '../message-list-types.js'; type ParentButtonProps = { - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, }; function ParentButton(props: ParentButtonProps): React.Node { const styles = useStyles(unboundStyles); @@ -35,8 +35,8 @@ } type ThreadSettingsParentProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, + +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, }; function ThreadSettingsParent(props: ThreadSettingsParentProps): React.Node { const { threadInfo, parentThreadInfo } = props; diff --git a/native/chat/settings/thread-settings-promote-sidebar.react.js b/native/chat/settings/thread-settings-promote-sidebar.react.js --- a/native/chat/settings/thread-settings-promote-sidebar.react.js +++ b/native/chat/settings/thread-settings-promote-sidebar.react.js @@ -5,7 +5,7 @@ import { usePromoteSidebar } from 'lib/hooks/promote-sidebar.react.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import Button from '../../components/button.react.js'; @@ -31,7 +31,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +buttonStyle: ViewStyle, }; type Props = { diff --git a/native/chat/settings/thread-settings-push-notifs.react.js b/native/chat/settings/thread-settings-push-notifs.react.js --- a/native/chat/settings/thread-settings-push-notifs.react.js +++ b/native/chat/settings/thread-settings-push-notifs.react.js @@ -10,7 +10,7 @@ } from 'lib/actions/user-actions.js'; import { extractKeyserverIDFromID } from 'lib/keyserver-conn/keyserver-call-utils.js'; import { deviceTokenSelector } from 'lib/selectors/keyserver-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { SubscriptionUpdateRequest, SubscriptionUpdateResult, @@ -54,7 +54,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { ...BaseProps, diff --git a/native/chat/settings/thread-settings-visibility.react.js b/native/chat/settings/thread-settings-visibility.react.js --- a/native/chat/settings/thread-settings-visibility.react.js +++ b/native/chat/settings/thread-settings-visibility.react.js @@ -3,14 +3,14 @@ import * as React from 'react'; import { Text, View } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import ThreadVisibility from '../../components/thread-visibility.react.js'; import { useColors, useStyles } from '../../themes/colors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ThreadSettingsVisibility(props: Props): React.Node { const styles = useStyles(unboundStyles); diff --git a/native/chat/settings/thread-settings.react.js b/native/chat/settings/thread-settings.react.js --- a/native/chat/settings/thread-settings.react.js +++ b/native/chat/settings/thread-settings.react.js @@ -33,7 +33,7 @@ viewerIsMember, } from 'lib/shared/thread-utils.js'; import threadWatcher from 'lib/shared/thread-watcher.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { RelationshipButton } from 'lib/types/relationship-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; @@ -107,7 +107,7 @@ const itemPageLength = 5; export type ThreadSettingsParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; export type ThreadSettingsNavigate = $PropertyType< @@ -220,7 +220,7 @@ | { +itemType: 'mediaGallery', +key: string, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +limit: number, +verticalBounds: ?VerticalBounds, } @@ -700,7 +700,7 @@ (propsAndState: PropsAndState) => propsAndState.threadInfo, (propsAndState: PropsAndState) => propsAndState.verticalBounds, ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, verticalBounds: ?VerticalBounds, ) => { const listData: ChatSettingsItem[] = []; @@ -1156,8 +1156,9 @@ ); const threadID = props.route.params.threadInfo.id; - const reduxThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo = - useSelector(state => threadInfoSelector(state)[threadID]); + const reduxThreadInfo: ?LegacyThreadInfo | ?ThreadInfo = useSelector( + state => threadInfoSelector(state)[threadID], + ); React.useEffect(() => { invariant( reduxThreadInfo, @@ -1172,7 +1173,7 @@ setParams({ threadInfo: reduxThreadInfo }); } }, [reduxThreadInfo, setParams]); - const threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo = + const threadInfo: LegacyThreadInfo | ThreadInfo = reduxThreadInfo ?? props.route.params.threadInfo; const resolvedThreadInfo = useResolvedThreadInfo(threadInfo); @@ -1187,10 +1188,10 @@ }, [threadInfo]); const parentThreadID = threadInfo.parentThreadID; - const parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo = - useSelector(state => + const parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo = useSelector( + state => parentThreadID ? threadInfoSelector(state)[parentThreadID] : null, - ); + ); const resolvedParentThreadInfo = useResolvedOptionalThreadInfo(parentThreadInfo); const threadMembers = threadInfo.members; diff --git a/native/chat/sidebar-list-modal.react.js b/native/chat/sidebar-list-modal.react.js --- a/native/chat/sidebar-list-modal.react.js +++ b/native/chat/sidebar-list-modal.react.js @@ -4,7 +4,7 @@ import { View } from 'react-native'; import { useSearchSidebars } from 'lib/hooks/search-threads.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, SidebarInfo } from 'lib/types/thread-types.js'; import { SidebarItem } from './sidebar-item.react.js'; @@ -17,7 +17,7 @@ import Arrow from '../vectors/arrow.react.js'; export type SidebarListModalParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { @@ -31,11 +31,7 @@ const numOfSidebarsWithExtendedArrow = listData.length - 1; const createRenderItem = React.useCallback( - ( - onPressItem: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, - ) => + (onPressItem: (threadInfo: LegacyThreadInfo | ThreadInfo) => void) => // eslint-disable-next-line react/display-name (row: { +item: SidebarInfo, +index: number, ... }) => { let extendArrow: boolean = false; @@ -69,9 +65,7 @@ function Item(props: { item: SidebarInfo, - onPressItem: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + onPressItem: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, extendArrow: boolean, }): React.Node { const { item, onPressItem, extendArrow } = props; diff --git a/native/chat/sidebar-navigation.js b/native/chat/sidebar-navigation.js --- a/native/chat/sidebar-navigation.js +++ b/native/chat/sidebar-navigation.js @@ -10,7 +10,7 @@ createPendingSidebar, createUnresolvedPendingSidebar, } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ChatMentionCandidates, LegacyThreadInfo, @@ -30,7 +30,7 @@ }; function getUnresolvedSidebarThreadInfo( input: GetUnresolvedSidebarThreadInfoInput, -): ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo { +): ?LegacyThreadInfo | ?ThreadInfo { const { sourceMessage, loggedInUserInfo, chatMentionCandidates } = input; const threadCreatedFromMessage = sourceMessage.threadCreatedFromMessage; if (threadCreatedFromMessage) { @@ -57,7 +57,7 @@ }; async function getSidebarThreadInfo( input: GetSidebarThreadInfoInput, -): Promise { +): Promise { const { sourceMessage, loggedInUserInfo, diff --git a/native/chat/subchannels-list-modal.react.js b/native/chat/subchannels-list-modal.react.js --- a/native/chat/subchannels-list-modal.react.js +++ b/native/chat/subchannels-list-modal.react.js @@ -5,7 +5,7 @@ import { useSearchSubchannels } from 'lib/hooks/search-threads.js'; import type { ChatThreadItem } from 'lib/selectors/chat-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import SubchannelItem from './subchannel-item.react.js'; @@ -16,7 +16,7 @@ import { useColors, useStyles } from '../themes/colors.js'; export type SubchannelListModalParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { @@ -42,20 +42,14 @@ } const createRenderItem = - ( - onPressItem: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, - ) => + (onPressItem: (threadInfo: LegacyThreadInfo | ThreadInfo) => void) => // eslint-disable-next-line react/display-name (row: { +item: ChatThreadItem, +index: number, ... }) => { return ; }; function Item(props: { - onPressItem: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + onPressItem: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, subchannelInfo: ChatThreadItem, }): React.Node { const { onPressItem, subchannelInfo } = props; diff --git a/native/chat/swipeable-thread.react.js b/native/chat/swipeable-thread.react.js --- a/native/chat/swipeable-thread.react.js +++ b/native/chat/swipeable-thread.react.js @@ -7,18 +7,16 @@ import SwipeableComponent from 'react-native-gesture-handler/Swipeable'; import useToggleUnreadStatus from 'lib/hooks/toggle-unread-status.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import Swipeable from '../components/swipeable.js'; import { useColors } from '../themes/colors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +mostRecentNonLocalMessage: ?string, - +onSwipeableWillOpen: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + +onSwipeableWillOpen: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, +currentlyOpenedSwipeableId?: string, +iconSize: number, +children: React.Node, diff --git a/native/chat/thread-list-modal.react.js b/native/chat/thread-list-modal.react.js --- a/native/chat/thread-list-modal.react.js +++ b/native/chat/thread-list-modal.react.js @@ -13,7 +13,7 @@ import type { ThreadSearchState } from 'lib/hooks/search-threads.js'; import type { ChatThreadItem } from 'lib/selectors/chat-selectors.js'; import type { SetState } from 'lib/types/hook-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, SidebarInfo } from 'lib/types/thread-types.js'; import { useNavigateToThread } from './message-list-types.js'; @@ -35,11 +35,9 @@ } type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +createRenderItem: ( - onPressItem: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + onPressItem: (threadInfo: LegacyThreadInfo | ThreadInfo) => void, ) => (row: { +item: U, +index: number, ... }) => React.Node, +listData: $ReadOnlyArray, +searchState: ThreadSearchState, @@ -80,7 +78,7 @@ const navigateToThread = useNavigateToThread(); const onPressItem = React.useCallback( - (threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo) => { + (threadInfo: LegacyThreadInfo | ThreadInfo) => { setSearchState({ text: '', results: new Set(), diff --git a/native/chat/thread-settings-button.react.js b/native/chat/thread-settings-button.react.js --- a/native/chat/thread-settings-button.react.js +++ b/native/chat/thread-settings-button.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { ChatNavigationProp } from './chat.react.js'; @@ -19,7 +19,7 @@ }; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +navigate: $PropertyType, 'navigate'>, }; type Props = { diff --git a/native/chat/thread-settings-header-title.react.js b/native/chat/thread-settings-header-title.react.js --- a/native/chat/thread-settings-header-title.react.js +++ b/native/chat/thread-settings-header-title.react.js @@ -4,13 +4,13 @@ import { HeaderTitle } from '@react-navigation/elements'; import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; import { firstLine } from 'lib/utils/string-utils.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, ...HeaderTitleInputProps, }; function ThreadSettingsHeaderTitle(props: Props): React.Node { diff --git a/native/chat/toggle-pin-modal.react.js b/native/chat/toggle-pin-modal.react.js --- a/native/chat/toggle-pin-modal.react.js +++ b/native/chat/toggle-pin-modal.react.js @@ -9,7 +9,7 @@ useToggleMessagePin, } from 'lib/actions/message-actions.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -23,7 +23,7 @@ export type TogglePinModalParams = { +item: ChatMessageInfoItemWithHeight, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type TogglePinModalProps = { diff --git a/native/chat/utils.js b/native/chat/utils.js --- a/native/chat/utils.js +++ b/native/chat/utils.js @@ -9,7 +9,7 @@ import { colorIsDark } from 'lib/shared/color-utils.js'; import { messageKey } from 'lib/shared/message-utils.js'; import { viewerIsMember } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { clusterEndHeight } from './chat-constants.js'; @@ -101,7 +101,7 @@ messageListVerticalBounds: VerticalBounds, currentInputBarHeight: number, targetInputBarHeight: number, - sidebarThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + sidebarThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): { +position: number, +color: string, diff --git a/native/components/community-actions-button.react.js b/native/components/community-actions-button.react.js --- a/native/components/community-actions-button.react.js +++ b/native/components/community-actions-button.react.js @@ -8,7 +8,7 @@ import { primaryInviteLinksSelector } from 'lib/selectors/invite-links-selectors.js'; import { threadHasPermission } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -24,7 +24,7 @@ import { useStyles } from '../themes/colors.js'; type Props = { - +community: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +community: LegacyThreadInfo | ThreadInfo, }; function CommunityActionsButton(props: Props): React.Node { diff --git a/native/components/community-pill.react.js b/native/components/community-pill.react.js --- a/native/components/community-pill.react.js +++ b/native/components/community-pill.react.js @@ -4,7 +4,7 @@ import { StyleSheet, View } from 'react-native'; import { useKeyserverAdmin } from 'lib/shared/user-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import CommIcon from './comm-icon.react.js'; @@ -15,7 +15,7 @@ const threadPillRoundCorners = { left: false, right: true }; type Props = { - +community: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +community: LegacyThreadInfo | ThreadInfo, }; function CommunityPill(props: Props): React.Node { const { community } = props; diff --git a/native/components/thread-ancestors-label.react.js b/native/components/thread-ancestors-label.react.js --- a/native/components/thread-ancestors-label.react.js +++ b/native/components/thread-ancestors-label.react.js @@ -5,14 +5,14 @@ import { Text, View } from 'react-native'; import { useAncestorThreads } from 'lib/shared/ancestor-threads.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfos } from 'lib/utils/entity-helpers.js'; import { useColors, useStyles } from '../themes/colors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ThreadAncestorsLabel(props: Props): React.Node { const { threadInfo } = props; diff --git a/native/components/thread-ancestors.react.js b/native/components/thread-ancestors.react.js --- a/native/components/thread-ancestors.react.js +++ b/native/components/thread-ancestors.react.js @@ -6,7 +6,7 @@ import { ScrollView } from 'react-native-gesture-handler'; import { ancestorThreadInfos } from 'lib/selectors/thread-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import Button from './button.react.js'; @@ -17,7 +17,7 @@ import { useColors, useStyles } from '../themes/colors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ThreadAncestors(props: Props): React.Node { @@ -25,9 +25,8 @@ const styles = useStyles(unboundStyles); const colors = useColors(); - const ancestorThreads: $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - > = useSelector(ancestorThreadInfos(threadInfo.id)); + const ancestorThreads: $ReadOnlyArray = + useSelector(ancestorThreadInfos(threadInfo.id)); const rightArrow = React.useMemo( () => ( diff --git a/native/components/thread-list-thread.react.js b/native/components/thread-list-thread.react.js --- a/native/components/thread-list-thread.react.js +++ b/native/components/thread-list-thread.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, ResolvedThreadInfo, @@ -37,7 +37,7 @@ }; type BaseProps = { ...SharedProps, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { ...SharedProps, diff --git a/native/components/thread-list.react.js b/native/components/thread-list.react.js --- a/native/components/thread-list.react.js +++ b/native/components/thread-list.react.js @@ -6,7 +6,7 @@ import { createSelector } from 'reselect'; import SearchIndex from 'lib/shared/search-index.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import Search from './search.react.js'; @@ -26,7 +26,7 @@ }; type BaseProps = { - +threadInfos: $ReadOnlyArray, + +threadInfos: $ReadOnlyArray, +onSelect: (threadID: string) => void, +itemStyle?: ViewStyle, +itemTextStyle?: TextStyle, @@ -51,7 +51,7 @@ textInput: ?React.ElementRef; listDataSelector: PropsAndState => $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, + LegacyThreadInfo | ThreadInfo, > = createSelector( (propsAndState: PropsAndState) => propsAndState.threadInfos, (propsAndState: PropsAndState) => propsAndState.searchText, @@ -59,12 +59,10 @@ (propsAndState: PropsAndState) => propsAndState.itemStyle, (propsAndState: PropsAndState) => propsAndState.itemTextStyle, ( - threadInfos: $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - >, + threadInfos: $ReadOnlyArray, text: string, searchResults: Set, - ): $ReadOnlyArray => + ): $ReadOnlyArray => text ? threadInfos.filter(threadInfo => searchResults.has(threadInfo.id)) : // We spread to make sure the result of this selector updates when @@ -72,9 +70,7 @@ [...threadInfos], ); - get listData(): $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - > { + get listData(): $ReadOnlyArray { return this.listDataSelector({ ...this.props, ...this.state }); } @@ -107,14 +103,12 @@ ); } - static keyExtractor = ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ): string => { + static keyExtractor = (threadInfo: LegacyThreadInfo | ThreadInfo): string => { return threadInfo.id; }; renderItem = (row: { - +item: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +item: LegacyThreadInfo | ThreadInfo, ... }): React.Node => { return ( @@ -128,7 +122,7 @@ }; static getItemLayout = ( - data: ?$ReadOnlyArray, + data: ?$ReadOnlyArray, index: number, ): { length: number, offset: number, index: number } => { return { length: 24, offset: 24 * index, index }; diff --git a/native/components/thread-pill.react.js b/native/components/thread-pill.react.js --- a/native/components/thread-pill.react.js +++ b/native/components/thread-pill.react.js @@ -2,14 +2,14 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; import Pill from './pill.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +roundCorners?: { +left: boolean, +right: boolean }, +fontSize?: number, }; diff --git a/native/input/input-state-container.react.js b/native/input/input-state-container.react.js --- a/native/input/input-state-container.react.js +++ b/native/input/input-state-container.react.js @@ -72,7 +72,7 @@ import type { RawMediaMessageInfo } from 'lib/types/messages/media.js'; import { getMediaMessageServerDBContentsFromMedia } from 'lib/types/messages/media.js'; import type { RawTextMessageInfo } from 'lib/types/messages/text.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import { type ClientMediaMissionReportCreationRequest, @@ -176,7 +176,7 @@ pendingThreadCreations: Map> = new Map(); pendingThreadUpdateHandlers: Map< string, - (LegacyThreadInfo | MinimallyEncodedThreadInfo) => mixed, + (LegacyThreadInfo | ThreadInfo) => mixed, > = new Map(); // TODO: flip the switch // Note that this enables Blob service for encrypted media only @@ -450,8 +450,8 @@ sendTextMessage = async ( messageInfo: RawTextMessageInfo, - inputThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + inputThreadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => { this.sendCallbacks.forEach(callback => callback()); @@ -548,7 +548,7 @@ }; startThreadCreation( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { if (!threadIsPending(threadInfo.id)) { return Promise.resolve(threadInfo.id); @@ -571,8 +571,8 @@ async sendTextMessageAction( messageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): Promise { try { await this.props.textMessageCreationSideEffectsFunc( @@ -609,15 +609,13 @@ } } - shouldEncryptMedia( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ): boolean { + shouldEncryptMedia(threadInfo: LegacyThreadInfo | ThreadInfo): boolean { return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id); } sendMultimediaMessage = async ( selections: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) => { this.sendCallbacks.forEach(callback => callback()); const localMessageID = this.props.nextLocalID; @@ -718,7 +716,7 @@ async uploadFiles( localMessageID: string, uploadFileInputs: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) { const results = await Promise.all( uploadFileInputs.map(uploadFileInput => @@ -734,7 +732,7 @@ async uploadFile( localMessageID: string, uploadFileInput: UploadFileInput, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { const { ids, selection } = uploadFileInput; const { localMediaID } = ids; @@ -1344,8 +1342,8 @@ retryTextMessage = async ( rawMessageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => { await this.sendTextMessage( { @@ -1360,7 +1358,7 @@ retryMultimediaMessage = async ( rawMessageInfo: RawMultimediaMessageInfo, localMessageID: string, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise => { const pendingUploads = this.state.pendingUploads[localMessageID] ?? {}; @@ -1574,8 +1572,8 @@ retryMessage = async ( localMessageID: string, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => { this.sendCallbacks.forEach(callback => callback()); @@ -1673,9 +1671,7 @@ setPendingThreadUpdateHandler = ( threadID: string, - pendingThreadUpdateHandler: ?( - LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => mixed, + pendingThreadUpdateHandler: ?(LegacyThreadInfo | ThreadInfo) => mixed, ) => { if (!pendingThreadUpdateHandler) { this.pendingThreadUpdateHandlers.delete(threadID); diff --git a/native/input/input-state.js b/native/input/input-state.js --- a/native/input/input-state.js +++ b/native/input/input-state.js @@ -4,7 +4,7 @@ import type { NativeMediaSelection } from 'lib/types/media-types.js'; import type { RawTextMessageInfo } from 'lib/types/messages/text.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; export type MultimediaProcessingStep = 'transcoding' | 'uploading'; @@ -32,12 +32,12 @@ +pendingUploads: PendingMultimediaUploads, +sendTextMessage: ( messageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => Promise, +sendMultimediaMessage: ( selections: $ReadOnlyArray, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) => Promise, +editInputMessage: (params: EditInputBarMessageParameters) => void, +addEditInputMessageListener: ( @@ -49,8 +49,8 @@ +messageHasUploadFailure: (localMessageID: string) => boolean, +retryMessage: ( localMessageID: string, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => Promise, +registerSendCallback: (() => void) => void, +unregisterSendCallback: (() => void) => void, @@ -58,9 +58,7 @@ +reportURIDisplayed: (uri: string, loaded: boolean) => void, +setPendingThreadUpdateHandler: ( threadID: string, - pendingThreadUpdateHandler: ?( - LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => mixed, + pendingThreadUpdateHandler: ?(LegacyThreadInfo | ThreadInfo) => mixed, ) => void, +scrollToMessage: (messageKey: string) => void, +addScrollToMessageListener: ((messageKey: string) => void) => void, diff --git a/native/invite-links/manage-public-link-screen.react.js b/native/invite-links/manage-public-link-screen.react.js --- a/native/invite-links/manage-public-link-screen.react.js +++ b/native/invite-links/manage-public-link-screen.react.js @@ -10,7 +10,7 @@ defaultErrorMessage, inviteLinkErrorMessages, } from 'lib/shared/invite-links.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import Button from '../components/button.react.js'; @@ -22,7 +22,7 @@ import Alert from '../utils/alert.js'; export type ManagePublicLinkScreenParams = { - +community: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +community: LegacyThreadInfo | ThreadInfo, }; type Props = { diff --git a/native/invite-links/view-invite-links-screen.react.js b/native/invite-links/view-invite-links-screen.react.js --- a/native/invite-links/view-invite-links-screen.react.js +++ b/native/invite-links/view-invite-links-screen.react.js @@ -9,7 +9,7 @@ import { primaryInviteLinksSelector } from 'lib/selectors/invite-links-selectors.js'; import { threadHasPermission } from 'lib/shared/thread-utils.js'; import type { InviteLink } from 'lib/types/link-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -25,7 +25,7 @@ import { useColors, useStyles } from '../themes/colors.js'; export type ViewInviteLinksScreenParams = { - +community: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +community: LegacyThreadInfo | ThreadInfo, }; type Props = { diff --git a/native/keyboard/keyboard-input-host.react.js b/native/keyboard/keyboard-input-host.react.js --- a/native/keyboard/keyboard-input-host.react.js +++ b/native/keyboard/keyboard-input-host.react.js @@ -6,7 +6,7 @@ import { KeyboardAccessoryView } from 'react-native-keyboard-input'; import type { MediaLibrarySelection } from 'lib/types/media-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { KeyboardContext, type KeyboardState } from './keyboard-state.js'; @@ -76,7 +76,7 @@ keyboardName: string, result: { +selections: $ReadOnlyArray, - +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: ?LegacyThreadInfo | ?ThreadInfo, }, ) => { const { keyboardState } = this.props; diff --git a/native/keyboard/keyboard-state-container.react.js b/native/keyboard/keyboard-state-container.react.js --- a/native/keyboard/keyboard-state-container.react.js +++ b/native/keyboard/keyboard-state-container.react.js @@ -4,7 +4,7 @@ import { Platform } from 'react-native'; import { KeyboardUtils } from 'react-native-keyboard-input'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import sleep from 'lib/utils/sleep.js'; @@ -24,7 +24,7 @@ type State = { +systemKeyboardShowing: boolean, +mediaGalleryOpen: boolean, - +mediaGalleryThread: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +mediaGalleryThread: ?LegacyThreadInfo | ?ThreadInfo, +renderKeyboardInputHost: boolean, }; class KeyboardStateContainer extends React.PureComponent { @@ -94,9 +94,9 @@ return systemKeyboardShowing || mediaGalleryOpen; } - showMediaGallery: ( - thread: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void = (thread: LegacyThreadInfo | MinimallyEncodedThreadInfo) => { + showMediaGallery: (thread: LegacyThreadInfo | ThreadInfo) => void = ( + thread: LegacyThreadInfo | ThreadInfo, + ) => { this.setState({ mediaGalleryOpen: true, mediaGalleryThread: thread, @@ -111,8 +111,8 @@ }); }; - getMediaGalleryThread: () => ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo = - () => this.state.mediaGalleryThread; + getMediaGalleryThread: () => ?LegacyThreadInfo | ?ThreadInfo = () => + this.state.mediaGalleryThread; render(): React.Node { const { systemKeyboardShowing, mediaGalleryOpen, renderKeyboardInputHost } = diff --git a/native/keyboard/keyboard-state.js b/native/keyboard/keyboard-state.js --- a/native/keyboard/keyboard-state.js +++ b/native/keyboard/keyboard-state.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; export type KeyboardState = { @@ -11,11 +11,9 @@ +dismissKeyboardIfShowing: () => boolean, +systemKeyboardShowing: boolean, +mediaGalleryOpen: boolean, - +showMediaGallery: ( - thread: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ) => void, + +showMediaGallery: (thread: LegacyThreadInfo | ThreadInfo) => void, +hideMediaGallery: () => void, - +getMediaGalleryThread: () => ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +getMediaGalleryThread: () => ?LegacyThreadInfo | ?ThreadInfo, }; const KeyboardContext: React.Context = diff --git a/native/markdown/rules.react.js b/native/markdown/rules.react.js --- a/native/markdown/rules.react.js +++ b/native/markdown/rules.react.js @@ -7,7 +7,7 @@ import * as SharedMarkdown from 'lib/shared/markdown.js'; import { chatMentionRegex } from 'lib/shared/mention-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ChatMentionCandidates, LegacyThreadInfo, @@ -349,7 +349,7 @@ }); function useTextMessageRulesFunc( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, chatMentionCandidates: ChatMentionCandidates, ): (useDarkStyle: boolean) => MarkdownRules { const { members } = threadInfo; diff --git a/native/media/chat-camera-modal.react.js b/native/media/chat-camera-modal.react.js --- a/native/media/chat-camera-modal.react.js +++ b/native/media/chat-camera-modal.react.js @@ -4,7 +4,7 @@ import * as React from 'react'; import type { PhotoCapture } from 'lib/types/media-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import CameraModal from './camera-modal.react.js'; @@ -14,7 +14,7 @@ export type ChatCameraModalParams = { +presentedFrom: string, - +thread: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +thread: LegacyThreadInfo | ThreadInfo, }; type Props = { diff --git a/native/media/media-gallery-keyboard.react.js b/native/media/media-gallery-keyboard.react.js --- a/native/media/media-gallery-keyboard.react.js +++ b/native/media/media-gallery-keyboard.react.js @@ -22,7 +22,7 @@ } from 'lib/media/file-utils.js'; import { useIsAppForegrounded } from 'lib/shared/lifecycle-utils.js'; import type { MediaLibrarySelection } from 'lib/types/media-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { getCompatibleMediaURI } from './identifier-utils.js'; @@ -103,7 +103,7 @@ }; type BaseProps = { - +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: ?LegacyThreadInfo | ?ThreadInfo, }; type Props = { ...BaseProps, diff --git a/native/navigation/nav-selectors.js b/native/navigation/nav-selectors.js --- a/native/navigation/nav-selectors.js +++ b/native/navigation/nav-selectors.js @@ -15,7 +15,7 @@ ComposableMessageInfo, RobotextMessageInfo, } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { GlobalTheme } from 'lib/types/theme-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -404,7 +404,7 @@ } function useCanEditMessageNative( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, targetMessageInfo: ComposableMessageInfo | RobotextMessageInfo, ): boolean { const route = useRoute(); diff --git a/native/navigation/subchannels-button.react.js b/native/navigation/subchannels-button.react.js --- a/native/navigation/subchannels-button.react.js +++ b/native/navigation/subchannels-button.react.js @@ -5,14 +5,14 @@ import * as React from 'react'; import { Text, TouchableOpacity, View } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { SubchannelsListModalRouteName } from './route-names.js'; import { useStyles } from '../themes/colors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function SubchnnelsButton(props: Props): React.Node { diff --git a/native/push/push-handler.react.js b/native/push/push-handler.react.js --- a/native/push/push-handler.react.js +++ b/native/push/push-handler.react.js @@ -28,7 +28,7 @@ import { isLoggedIn } from 'lib/selectors/user-selectors.js'; import { mergePrefixIntoBody } from 'lib/shared/notif-utils.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import { type ConnectionInfo } from 'lib/types/socket-types.js'; import type { GlobalTheme } from 'lib/types/theme-types.js'; @@ -106,7 +106,7 @@ +[keyserverID: string]: ?string, }, +threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, +notifPermissionAlertInfo: NotifPermissionAlertInfo, +connection: ConnectionInfo, @@ -525,7 +525,7 @@ } navigateToThread( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, clearChatRoutes: boolean, ) { if (clearChatRoutes) { diff --git a/native/roles/change-roles-screen.react.js b/native/roles/change-roles-screen.react.js --- a/native/roles/change-roles-screen.react.js +++ b/native/roles/change-roles-screen.react.js @@ -12,7 +12,7 @@ import { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors.js'; import { roleIsAdminRole } from 'lib/shared/thread-utils.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, RelativeMemberInfo, @@ -28,7 +28,7 @@ import { useStyles } from '../themes/colors.js'; export type ChangeRolesScreenParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +memberInfo: RelativeMemberInfo, +role: ?string, }; diff --git a/native/roles/community-roles-screen.react.js b/native/roles/community-roles-screen.react.js --- a/native/roles/community-roles-screen.react.js +++ b/native/roles/community-roles-screen.react.js @@ -9,7 +9,7 @@ useRoleMemberCountsForCommunity, useRoleUserSurfacedPermissions, } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import RolePanelEntry from './role-panel-entry.react.js'; @@ -21,7 +21,7 @@ import { useStyles } from '../themes/colors.js'; export type CommunityRolesScreenParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type CommunityRolesScreenProps = { @@ -38,8 +38,9 @@ // manually pull in the threadInfo from the redux store, since the threadInfo // passed into the route params will not be updated automatically. const threadID = threadInfo.id; - const reduxThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo = - useSelector(state => threadInfoSelector(state)[threadID]); + const reduxThreadInfo: ?LegacyThreadInfo | ?ThreadInfo = useSelector( + state => threadInfoSelector(state)[threadID], + ); const { setParams } = props.navigation; React.useEffect(() => { diff --git a/native/roles/create-roles-screen.react.js b/native/roles/create-roles-screen.react.js --- a/native/roles/create-roles-screen.react.js +++ b/native/roles/create-roles-screen.react.js @@ -7,7 +7,7 @@ import { modifyCommunityRoleActionTypes } from 'lib/actions/thread-actions.js'; import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type UserSurfacedPermission, type UserSurfacedPermissionOption, @@ -25,7 +25,7 @@ import { useStyles } from '../themes/colors.js'; export type CreateRolesScreenParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +action: 'create_role' | 'edit_role', +existingRoleID?: string, +roleName: string, diff --git a/native/roles/role-panel-entry.react.js b/native/roles/role-panel-entry.react.js --- a/native/roles/role-panel-entry.react.js +++ b/native/roles/role-panel-entry.react.js @@ -6,7 +6,7 @@ import { Platform, Text, TouchableOpacity, View } from 'react-native'; import { useSafeAreaInsets } from 'react-native-safe-area-context'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { UserSurfacedPermission } from 'lib/types/thread-permission-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -20,7 +20,7 @@ type RolePanelEntryProps = { +navigation: RolesNavigationProp<'CommunityRolesScreen'>, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +roleName: string, +rolePermissions: $ReadOnlySet, +memberCount: number, diff --git a/native/roles/role-utils.react.js b/native/roles/role-utils.react.js --- a/native/roles/role-utils.react.js +++ b/native/roles/role-utils.react.js @@ -6,7 +6,7 @@ deleteCommunityRoleActionTypes, useDeleteCommunityRole, } from 'lib/actions/thread-actions.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { constructRoleDeletionMessagePrompt } from 'lib/utils/role-utils.js'; @@ -14,7 +14,7 @@ import Alert from '../utils/alert.js'; function useDisplayDeleteRoleAlert( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, existingRoleID: string, defaultRoleID: string, memberCount: number, diff --git a/native/search/message-search.react.js b/native/search/message-search.react.js --- a/native/search/message-search.react.js +++ b/native/search/message-search.react.js @@ -12,7 +12,7 @@ useSearchMessages, } from 'lib/shared/search-utils.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import SearchFooter from './search-footer.react.js'; @@ -29,7 +29,7 @@ import type { VerticalBounds } from '../types/layout-types.js'; export type MessageSearchParams = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; export type MessageSearchProps = { diff --git a/native/search/search-messages-button.react.js b/native/search/search-messages-button.react.js --- a/native/search/search-messages-button.react.js +++ b/native/search/search-messages-button.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { ChatNavigationProp } from '../chat/chat.react.js'; @@ -12,7 +12,7 @@ import { useStyles } from '../themes/colors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +navigate: $PropertyType, 'navigate'>, }; diff --git a/native/selectors/calendar-selectors.js b/native/selectors/calendar-selectors.js --- a/native/selectors/calendar-selectors.js +++ b/native/selectors/calendar-selectors.js @@ -8,7 +8,7 @@ } from 'lib/selectors/thread-selectors.js'; import { isLoggedIn } from 'lib/selectors/user-selectors.js'; import type { EntryInfo } from 'lib/types/entry-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { dateString } from 'lib/utils/date-utils.js'; @@ -33,7 +33,7 @@ | { itemType: 'entryInfo', entryInfo: EntryInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, }; const calendarListData: (state: AppState) => ?(CalendarItem[]) = createSelector( @@ -44,7 +44,7 @@ loggedIn: boolean, daysToEntries: { +[dayString: string]: EntryInfo[] }, threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, ) => { if (!loggedIn || daysToEntries[dateString(new Date())] === undefined) { diff --git a/native/types/chat-types.js b/native/types/chat-types.js --- a/native/types/chat-types.js +++ b/native/types/chat-types.js @@ -7,7 +7,7 @@ RobotextMessageInfo, } from 'lib/types/message-types.js'; import type { TextMessageInfo } from 'lib/types/messages/text.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { EntityText } from 'lib/utils/entity-text.js'; @@ -17,12 +17,12 @@ +itemType: 'message', +messageShapeType: 'robotext', +messageInfo: RobotextMessageInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +startsConversation: boolean, +startsCluster: boolean, +endsCluster: boolean, +robotext: EntityText, - +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadCreatedFromMessage: ?LegacyThreadInfo | ?ThreadInfo, +contentHeight: number, +reactions: ReactionInfo, }; @@ -32,12 +32,12 @@ +messageShapeType: 'text', +messageInfo: TextMessageInfo, +localMessageInfo: ?LocalMessageInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +startsConversation: boolean, +startsCluster: boolean, +endsCluster: boolean, +contentHeight: number, - +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadCreatedFromMessage: ?LegacyThreadInfo | ?ThreadInfo, +reactions: ReactionInfo, +hasBeenEdited: ?boolean, +isPinned: ?boolean, @@ -57,11 +57,11 @@ +messageShapeType: 'multimedia', +messageInfo: MultimediaMessageInfo, +localMessageInfo: ?LocalMessageInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +startsConversation: boolean, +startsCluster: boolean, +endsCluster: boolean, - +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadCreatedFromMessage: ?LegacyThreadInfo | ?ThreadInfo, +pendingUploads: ?MessagePendingUploads, +reactions: ReactionInfo, +hasBeenEdited: ?boolean, diff --git a/native/user-profile/user-profile-menu-button.react.js b/native/user-profile/user-profile-menu-button.react.js --- a/native/user-profile/user-profile-menu-button.react.js +++ b/native/user-profile/user-profile-menu-button.react.js @@ -6,7 +6,7 @@ import { TouchableOpacity, View } from 'react-native'; import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { UserInfo } from 'lib/types/user-types'; @@ -22,7 +22,7 @@ const onMenuButtonLayout = () => {}; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +pendingPersonalThreadUserInfo: ?UserInfo, }; diff --git a/native/user-profile/user-profile-message-button.react.js b/native/user-profile/user-profile-message-button.react.js --- a/native/user-profile/user-profile-message-button.react.js +++ b/native/user-profile/user-profile-message-button.react.js @@ -4,7 +4,7 @@ import * as React from 'react'; import { Text } from 'react-native'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { UserInfo } from 'lib/types/user-types'; @@ -14,7 +14,7 @@ import { useStyles } from '../themes/colors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +pendingPersonalThreadUserInfo?: UserInfo, }; diff --git a/native/user-profile/user-profile-relationship-button.react.js b/native/user-profile/user-profile-relationship-button.react.js --- a/native/user-profile/user-profile-relationship-button.react.js +++ b/native/user-profile/user-profile-relationship-button.react.js @@ -5,7 +5,7 @@ import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; import type { SetState } from 'lib/types/hook-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { UserInfo } from 'lib/types/user-types'; @@ -20,7 +20,7 @@ }; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +pendingPersonalThreadUserInfo?: UserInfo, +setUserProfileRelationshipButtonHeight: SetState, }; diff --git a/native/utils/drawer-utils.react.js b/native/utils/drawer-utils.react.js --- a/native/utils/drawer-utils.react.js +++ b/native/utils/drawer-utils.react.js @@ -1,6 +1,6 @@ // @flow -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypeIsCommunityRoot } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { CommunityDrawerItemData } from 'lib/utils/drawer-utils.react.js'; @@ -8,7 +8,7 @@ import type { TextStyle } from '../types/styles.js'; export type CommunityDrawerItemDataFlattened = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +hasSubchannelsButton: boolean, +labelStyle: TextStyle, +hasChildren: boolean, diff --git a/web/avatars/edit-thread-avatar-menu.react.js b/web/avatars/edit-thread-avatar-menu.react.js --- a/web/avatars/edit-thread-avatar-menu.react.js +++ b/web/avatars/edit-thread-avatar-menu.react.js @@ -7,7 +7,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -26,7 +26,7 @@ ); type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, }; function EditThreadAvatarMenu(props: Props): React.Node { const { threadInfo } = props; diff --git a/web/avatars/edit-thread-avatar.react.js b/web/avatars/edit-thread-avatar.react.js --- a/web/avatars/edit-thread-avatar.react.js +++ b/web/avatars/edit-thread-avatar.react.js @@ -6,7 +6,7 @@ import { EditThreadAvatarContext } from 'lib/components/base-edit-thread-avatar-provider.react.js'; import { threadHasPermission } from 'lib/shared/thread-utils.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; @@ -17,7 +17,7 @@ import ThreadAvatar from './thread-avatar.react.js'; type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, +disabled?: boolean, }; function EditThreadAvatar(props: Props): React.Node { diff --git a/web/avatars/thread-avatar.react.js b/web/avatars/thread-avatar.react.js --- a/web/avatars/thread-avatar.react.js +++ b/web/avatars/thread-avatar.react.js @@ -9,7 +9,7 @@ import { getSingleOtherUser } from 'lib/shared/thread-utils.js'; import type { AvatarSize } from 'lib/types/avatar-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; @@ -19,7 +19,7 @@ import { useSelector } from '../redux/redux-utils.js'; type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, +size: AvatarSize, +showSpinner?: boolean, }; diff --git a/web/avatars/thread-emoji-avatar-selection-modal.react.js b/web/avatars/thread-emoji-avatar-selection-modal.react.js --- a/web/avatars/thread-emoji-avatar-selection-modal.react.js +++ b/web/avatars/thread-emoji-avatar-selection-modal.react.js @@ -13,7 +13,7 @@ ClientEmojiAvatar, } from 'lib/types/avatar-types.js'; import type { - MinimallyEncodedThreadInfo, + ThreadInfo, RawThreadInfo, } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -21,7 +21,7 @@ import EmojiAvatarSelectionModal from './emoji-avatar-selection-modal.react.js'; type Props = { - +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: RawThreadInfo | LegacyThreadInfo | ThreadInfo, }; function ThreadEmojiAvatarSelectionModal(props: Props): React.Node { diff --git a/web/calendar/day.react.js b/web/calendar/day.react.js --- a/web/calendar/day.react.js +++ b/web/calendar/day.react.js @@ -16,7 +16,7 @@ import { onScreenThreadInfos as onScreenThreadInfosSelector } from 'lib/selectors/thread-selectors.js'; import { entryKey } from 'lib/shared/entry-utils.js'; import type { EntryInfo } from 'lib/types/entry-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { dateFromString, dateString } from 'lib/utils/date-utils.js'; @@ -39,9 +39,7 @@ }; type Props = { ...BaseProps, - +onScreenThreadInfos: $ReadOnlyArray< - LegacyThreadInfo | MinimallyEncodedThreadInfo, - >, + +onScreenThreadInfos: $ReadOnlyArray, +viewerID: ?string, +loggedIn: boolean, +nextLocalID: number, diff --git a/web/chat/chat-input-bar.react.js b/web/chat/chat-input-bar.react.js --- a/web/chat/chat-input-bar.react.js +++ b/web/chat/chat-input-bar.react.js @@ -35,7 +35,7 @@ import type { CalendarQuery } from 'lib/types/entry-types.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { type ClientThreadJoinRequest, @@ -67,7 +67,7 @@ } from '../utils/typeahead-utils.js'; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +inputState: InputState, }; type Props = { @@ -83,7 +83,7 @@ +joinThread: (request: ClientThreadJoinRequest) => Promise, +typeaheadMatchedStrings: ?TypeaheadMatchedStrings, +suggestions: $ReadOnlyArray, - +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, }; class ChatInputBar extends React.PureComponent { diff --git a/web/chat/chat-message-list.react.js b/web/chat/chat-message-list.react.js --- a/web/chat/chat-message-list.react.js +++ b/web/chat/chat-message-list.react.js @@ -26,7 +26,7 @@ import { messageKey } from 'lib/shared/message-utils.js'; import { threadIsPending } from 'lib/shared/thread-utils.js'; import type { FetchMessageInfosPayload } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { @@ -56,7 +56,7 @@ const editBoxTopMargin = 10; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { diff --git a/web/chat/chat-thread-list-item-menu.react.js b/web/chat/chat-thread-list-item-menu.react.js --- a/web/chat/chat-thread-list-item-menu.react.js +++ b/web/chat/chat-thread-list-item-menu.react.js @@ -5,7 +5,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import useToggleUnreadStatus from 'lib/hooks/toggle-unread-status.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-thread-list-item-menu.css'; @@ -13,7 +13,7 @@ import { useThreadIsActive } from '../selectors/thread-selectors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +mostRecentNonLocalMessage: ?string, +renderStyle?: 'chat' | 'thread', }; diff --git a/web/chat/chat-thread-list-see-more-sidebars.react.js b/web/chat/chat-thread-list-see-more-sidebars.react.js --- a/web/chat/chat-thread-list-see-more-sidebars.react.js +++ b/web/chat/chat-thread-list-see-more-sidebars.react.js @@ -5,14 +5,14 @@ import { IoIosMore } from 'react-icons/io/index.js'; import { useModalContext } from 'lib/components/modal-provider.react.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-thread-list.css'; import SidebarsModal from '../modals/threads/sidebars/sidebars-modal.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +unread: boolean, }; function ChatThreadListSeeMoreSidebars(props: Props): React.Node { diff --git a/web/chat/composed-message.react.js b/web/chat/composed-message.react.js --- a/web/chat/composed-message.react.js +++ b/web/chat/composed-message.react.js @@ -12,7 +12,7 @@ import { type ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { getMessageLabel } from 'lib/shared/edit-messages-utils.js'; import { assertComposableMessageType } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { getComposedMessageID } from './chat-constants.js'; @@ -51,7 +51,7 @@ type BaseProps = { +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +shouldDisplayPinIndicator: boolean, +sendFailed: boolean, +children: React.Node, diff --git a/web/chat/edit-message-provider.js b/web/chat/edit-message-provider.js --- a/web/chat/edit-message-provider.js +++ b/web/chat/edit-message-provider.js @@ -5,7 +5,7 @@ import ModalOverlay from 'lib/components/modal-overlay.react.js'; import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types'; import { EditTextMessage } from './edit-text-message.react.js'; @@ -19,7 +19,7 @@ export type EditState = { +messageInfo: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +editedMessageDraft: ?string, +isError: boolean, +position?: ModalPosition, diff --git a/web/chat/edit-text-message.react.js b/web/chat/edit-text-message.react.js --- a/web/chat/edit-text-message.react.js +++ b/web/chat/edit-text-message.react.js @@ -8,7 +8,7 @@ import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { useEditMessage } from 'lib/shared/edit-messages-utils.js'; import { trimMessage } from 'lib/shared/message-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { editBoxBottomRowHeight } from './chat-constants.js'; @@ -21,7 +21,7 @@ type Props = { +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +background: boolean, }; diff --git a/web/chat/failed-send.react.js b/web/chat/failed-send.react.js --- a/web/chat/failed-send.react.js +++ b/web/chat/failed-send.react.js @@ -11,7 +11,7 @@ assertComposableMessageType, type RawComposableMessageInfo, } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-message-list.css'; @@ -23,13 +23,13 @@ type BaseProps = { +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; type Props = { ...BaseProps, +rawMessageInfo: RawComposableMessageInfo, +inputState: ?InputState, - +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, }; class FailedSend extends React.PureComponent { retryingText = false; diff --git a/web/chat/inline-engagement.react.js b/web/chat/inline-engagement.react.js --- a/web/chat/inline-engagement.react.js +++ b/web/chat/inline-engagement.react.js @@ -7,7 +7,7 @@ import type { ReactionInfo } from 'lib/selectors/chat-selectors.js'; import { getInlineEngagementSidebarText } from 'lib/shared/inline-engagement-utils.js'; import type { MessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './inline-engagement.css'; @@ -17,8 +17,8 @@ type Props = { +messageInfo: MessageInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - +sidebarThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, + +sidebarThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, +reactions: ReactionInfo, +positioning: 'left' | 'center' | 'right', +label?: ?string, diff --git a/web/chat/message-preview.react.js b/web/chat/message-preview.react.js --- a/web/chat/message-preview.react.js +++ b/web/chat/message-preview.react.js @@ -7,7 +7,7 @@ import { useThreadChatMentionCandidates } from 'lib/hooks/chat-mention-hooks.js'; import { useMessagePreview } from 'lib/shared/message-utils.js'; import { type MessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-thread-list.css'; @@ -15,7 +15,7 @@ type Props = { +messageInfo: ?MessageInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function MessagePreview(props: Props): React.Node { const { messageInfo, threadInfo } = props; diff --git a/web/chat/message.react.js b/web/chat/message.react.js --- a/web/chat/message.react.js +++ b/web/chat/message.react.js @@ -5,7 +5,7 @@ import { type ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { longAbsoluteDate } from 'lib/utils/date-utils.js'; @@ -18,7 +18,7 @@ type Props = { +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +shouldDisplayPinIndicator: boolean, }; function Message(props: Props): React.Node { diff --git a/web/chat/multimedia-message.react.js b/web/chat/multimedia-message.react.js --- a/web/chat/multimedia-message.react.js +++ b/web/chat/multimedia-message.react.js @@ -9,7 +9,7 @@ } from 'lib/media/media-utils.js'; import { type ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-message-list.css'; @@ -20,7 +20,7 @@ type BaseProps = { +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +shouldDisplayPinIndicator: boolean, }; type Props = { diff --git a/web/chat/pinned-messages-banner.react.js b/web/chat/pinned-messages-banner.react.js --- a/web/chat/pinned-messages-banner.react.js +++ b/web/chat/pinned-messages-banner.react.js @@ -4,7 +4,7 @@ import { ChevronRight } from 'react-feather'; import { useModalContext } from 'lib/components/modal-provider.react.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { pinnedMessageCountText } from 'lib/utils/message-pinning-utils.js'; @@ -13,7 +13,7 @@ import PinnedMessagesModal from '../modals/chat/pinned-messages-modal.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function PinnedMessagesBanner(props: Props): React.Node { diff --git a/web/chat/relationship-prompt/relationship-prompt.js b/web/chat/relationship-prompt/relationship-prompt.js --- a/web/chat/relationship-prompt/relationship-prompt.js +++ b/web/chat/relationship-prompt/relationship-prompt.js @@ -9,7 +9,7 @@ import * as React from 'react'; import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -17,7 +17,7 @@ import RelationshipPromptButton from './relationship-prompt-button.js'; import { buttonThemes } from '../../components/button.react.js'; -type Props = { +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo }; +type Props = { +threadInfo: LegacyThreadInfo | ThreadInfo }; function RelationshipPrompt(props: Props) { const { threadInfo } = props; diff --git a/web/chat/robotext-message.react.js b/web/chat/robotext-message.react.js --- a/web/chat/robotext-message.react.js +++ b/web/chat/robotext-message.react.js @@ -5,7 +5,7 @@ import { type RobotextChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { threadInfoSelector } from 'lib/selectors/thread-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { @@ -35,7 +35,7 @@ type Props = { +item: RobotextChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function RobotextMessage(props: Props): React.Node { let inlineEngagement; @@ -101,7 +101,7 @@ }; type InnerThreadEntityProps = { ...BaseInnerThreadEntityProps, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +dispatch: Dispatch, }; class InnerThreadEntity extends React.PureComponent { diff --git a/web/chat/text-message.react.js b/web/chat/text-message.react.js --- a/web/chat/text-message.react.js +++ b/web/chat/text-message.react.js @@ -8,7 +8,7 @@ import { colorIsDark } from 'lib/shared/color-utils.js'; import { onlyEmojiRegex } from 'lib/shared/emojis.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './chat-message-list.css'; @@ -19,7 +19,7 @@ type Props = { +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +shouldDisplayPinIndicator: boolean, }; function TextMessage(props: Props): React.Node { diff --git a/web/chat/thread-menu.react.js b/web/chat/thread-menu.react.js --- a/web/chat/thread-menu.react.js +++ b/web/chat/thread-menu.react.js @@ -15,7 +15,7 @@ threadIsChannel, viewerIsMember, } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -36,7 +36,7 @@ import { useSelector } from '../redux/redux-utils.js'; type ThreadMenuProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ThreadMenu(props: ThreadMenuProps): React.Node { diff --git a/web/chat/thread-top-bar.react.js b/web/chat/thread-top-bar.react.js --- a/web/chat/thread-top-bar.react.js +++ b/web/chat/thread-top-bar.react.js @@ -5,7 +5,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { threadIsPending } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; @@ -18,7 +18,7 @@ import MessageSearchModal from '../modals/search/message-search-modal.react.js'; type ThreadTopBarProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ThreadTopBar(props: ThreadTopBarProps): React.Node { const { threadInfo } = props; diff --git a/web/components/message-result.react.js b/web/components/message-result.react.js --- a/web/components/message-result.react.js +++ b/web/components/message-result.react.js @@ -6,7 +6,7 @@ import { useThreadChatMentionCandidates } from 'lib/hooks/chat-mention-hooks.js'; import { useStringForUser } from 'lib/hooks/ens-cache.js'; import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { longAbsoluteDate } from 'lib/utils/date-utils.js'; @@ -17,7 +17,7 @@ type MessageResultProps = { +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +scrollable: boolean, }; diff --git a/web/input/input-state-container.react.js b/web/input/input-state-container.react.js --- a/web/input/input-state-container.react.js +++ b/web/input/input-state-container.react.js @@ -73,7 +73,7 @@ import type { RawImagesMessageInfo } from 'lib/types/messages/images.js'; import type { RawMediaMessageInfo } from 'lib/types/messages/media.js'; import type { RawTextMessageInfo } from 'lib/types/messages/text.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { Dispatch } from 'lib/types/redux-types.js'; import { reportTypes } from 'lib/types/report-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; @@ -420,9 +420,7 @@ return rawMessageInfo; } - shouldEncryptMedia( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - ): boolean { + shouldEncryptMedia(threadInfo: LegacyThreadInfo | ThreadInfo): boolean { return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id); } @@ -569,7 +567,7 @@ } startThreadCreation( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): Promise { if (!threadIsPending(threadInfo.id)) { return Promise.resolve(threadInfo.id); @@ -631,20 +629,20 @@ draft: draft ?? '', textCursorPosition: textCursorPosition ?? 0, appendFiles: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, files: $ReadOnlyArray, ) => this.appendFiles(threadInfo, files), cancelPendingUpload: (localUploadID: string) => this.cancelPendingUpload(threadID, localUploadID), sendTextMessage: ( messageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => this.sendTextMessage(messageInfo, threadInfo, parentThreadInfo), createMultimediaMessage: ( localID: number, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) => this.createMultimediaMessage(localID, threadInfo), setDraft: (newDraft: string) => this.setDraft(threadID, newDraft), setTextCursorPosition: (newPosition: number) => @@ -653,7 +651,7 @@ this.messageHasUploadFailure(assignedUploads[localMessageID]), retryMultimediaMessage: ( localMessageID: string, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) => this.retryMultimediaMessage( localMessageID, @@ -692,7 +690,7 @@ } async appendFiles( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, files: $ReadOnlyArray, ): Promise { const selectionTime = Date.now(); @@ -749,7 +747,7 @@ } async appendFile( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, file: File, selectTime: number, ): Promise<{ @@ -1246,8 +1244,8 @@ async sendTextMessage( messageInfo: RawTextMessageInfo, - inputThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + inputThreadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) { this.props.sendCallbacks.forEach(callback => callback()); @@ -1344,8 +1342,8 @@ async sendTextMessageAction( messageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): Promise { try { await this.props.textMessageCreationSideEffectsFunc( @@ -1386,7 +1384,7 @@ // if there are any createMultimediaMessage( localID: number, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) { this.props.sendCallbacks.forEach(callback => callback()); @@ -1508,7 +1506,7 @@ retryMultimediaMessage( localMessageID: string, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, pendingUploads: ?$ReadOnlyArray, ) { this.props.sendCallbacks.forEach(callback => callback()); diff --git a/web/input/input-state.js b/web/input/input-state.js --- a/web/input/input-state.js +++ b/web/input/input-state.js @@ -9,7 +9,7 @@ type MediaType, } from 'lib/types/media-types.js'; import type { RawTextMessageInfo } from 'lib/types/messages/text.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ChatMentionCandidates, LegacyThreadInfo, @@ -64,25 +64,25 @@ +draft: string, +textCursorPosition: number, +appendFiles: ( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, files: $ReadOnlyArray, ) => Promise, +cancelPendingUpload: (localUploadID: string) => void, +sendTextMessage: ( messageInfo: RawTextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, + parentThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, ) => mixed, +createMultimediaMessage: ( localID: number, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) => void, +setDraft: (draft: string) => void, +setTextCursorPosition: (newPosition: number) => void, +messageHasUploadFailure: (localMessageID: string) => boolean, +retryMultimediaMessage: ( localMessageID: string, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ) => void, +addReply: (text: string) => void, +addReplyListener: ((message: string) => void) => void, diff --git a/web/invite-links/manage/edit-link-modal.react.js b/web/invite-links/manage/edit-link-modal.react.js --- a/web/invite-links/manage/edit-link-modal.react.js +++ b/web/invite-links/manage/edit-link-modal.react.js @@ -11,7 +11,7 @@ inviteLinkErrorMessages, } from 'lib/shared/invite-links.js'; import type { InviteLink } from 'lib/types/link-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './manage-invite-links-modal.css'; @@ -23,7 +23,7 @@ +inviteLink: ?InviteLink, +enterViewMode: () => mixed, +enterDisableMode: () => mixed, - +community: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +community: LegacyThreadInfo | ThreadInfo, }; const disableButtonColor = { diff --git a/web/markdown/rules.react.js b/web/markdown/rules.react.js --- a/web/markdown/rules.react.js +++ b/web/markdown/rules.react.js @@ -6,7 +6,7 @@ import * as SharedMarkdown from 'lib/shared/markdown.js'; import { chatMentionRegex } from 'lib/shared/mention-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { ChatMentionCandidates, LegacyThreadInfo, @@ -162,7 +162,7 @@ }); function useTextMessageRulesFunc( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, chatMentionCandidates: ChatMentionCandidates, ): boolean => MarkdownRules { const { members } = threadInfo; diff --git a/web/modals/chat/pinned-messages-modal.react.js b/web/modals/chat/pinned-messages-modal.react.js --- a/web/modals/chat/pinned-messages-modal.react.js +++ b/web/modals/chat/pinned-messages-modal.react.js @@ -18,7 +18,7 @@ modifyItemForResultScreen, } from 'lib/shared/message-utils.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { pinnedMessageCountText } from 'lib/utils/message-pinning-utils.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -30,7 +30,7 @@ import Modal from '../modal.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; const loadingStatusSelector = createLoadingStatusSelector( diff --git a/web/modals/chat/sidebar-promote-modal.react.js b/web/modals/chat/sidebar-promote-modal.react.js --- a/web/modals/chat/sidebar-promote-modal.react.js +++ b/web/modals/chat/sidebar-promote-modal.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; @@ -13,7 +13,7 @@ type Props = { +onClose: () => void, +onConfirm: () => void, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function SidebarPromoteModal(props: Props): React.Node { diff --git a/web/modals/chat/toggle-pin-modal.react.js b/web/modals/chat/toggle-pin-modal.react.js --- a/web/modals/chat/toggle-pin-modal.react.js +++ b/web/modals/chat/toggle-pin-modal.react.js @@ -11,7 +11,7 @@ import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { modifyItemForResultScreen } from 'lib/shared/message-utils.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -22,7 +22,7 @@ type TogglePinModalProps = { +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function TogglePinModal(props: TogglePinModalProps): React.Node { diff --git a/web/modals/search/message-search-modal.react.js b/web/modals/search/message-search-modal.react.js --- a/web/modals/search/message-search-modal.react.js +++ b/web/modals/search/message-search-modal.react.js @@ -4,7 +4,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; @@ -19,7 +19,7 @@ import Modal from '../modal.react.js'; type ContentProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function MessageSearchModal(props: ContentProps): React.Node { diff --git a/web/modals/search/message-search-utils.react.js b/web/modals/search/message-search-utils.react.js --- a/web/modals/search/message-search-utils.react.js +++ b/web/modals/search/message-search-utils.react.js @@ -12,13 +12,13 @@ } from 'lib/shared/message-utils.js'; import { filterChatMessageInfosForSearch } from 'lib/shared/search-utils.js'; import type { RawMessageInfo } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useSelector } from '../../redux/redux-utils.js'; function useParseSearchResults( - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, searchResults: $ReadOnlyArray, ): $ReadOnlyArray { const userInfos = useSelector(state => state.userStore.userInfos); diff --git a/web/modals/threads/confirm-leave-thread-modal.react.js b/web/modals/threads/confirm-leave-thread-modal.react.js --- a/web/modals/threads/confirm-leave-thread-modal.react.js +++ b/web/modals/threads/confirm-leave-thread-modal.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; @@ -11,7 +11,7 @@ import Modal from '../modal.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +onClose: () => void, +onConfirm: () => void, }; diff --git a/web/modals/threads/create/compose-subchannel-modal.react.js b/web/modals/threads/create/compose-subchannel-modal.react.js --- a/web/modals/threads/create/compose-subchannel-modal.react.js +++ b/web/modals/threads/create/compose-subchannel-modal.react.js @@ -7,7 +7,7 @@ useNewThread, } from 'lib/actions/thread-actions.js'; import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; @@ -27,7 +27,7 @@ type Props = { +onClose: () => void, - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, }; const getThreadType = (visibility: VisibilityType, announcement: boolean) => { diff --git a/web/modals/threads/create/steps/subchannel-members-list.react.js b/web/modals/threads/create/steps/subchannel-members-list.react.js --- a/web/modals/threads/create/steps/subchannel-members-list.react.js +++ b/web/modals/threads/create/steps/subchannel-members-list.react.js @@ -4,7 +4,7 @@ import { useENSNames } from 'lib/hooks/ens-cache.js'; import { stringForUser } from 'lib/shared/user-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, RelativeMemberInfo, @@ -17,8 +17,8 @@ type Props = { +searchText: string, +searchResult: $ReadOnlySet, - +communityThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +communityThreadInfo: LegacyThreadInfo | ThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, +selectedUsers: $ReadOnlySet, +toggleUserSelection: (userID: string) => void, }; diff --git a/web/modals/threads/create/steps/subchannel-members.react.js b/web/modals/threads/create/steps/subchannel-members.react.js --- a/web/modals/threads/create/steps/subchannel-members.react.js +++ b/web/modals/threads/create/steps/subchannel-members.react.js @@ -4,7 +4,7 @@ import { useUserSearchIndex } from 'lib/selectors/nav-selectors.js'; import { useAncestorThreads } from 'lib/shared/ancestor-threads.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import MembersList from './subchannel-members-list.react.js'; @@ -12,7 +12,7 @@ import Search from '../../../../components/search.react.js'; type SubchannelMembersProps = { - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, +selectedUsers: $ReadOnlySet, +searchText: string, +setSearchText: string => void, diff --git a/web/modals/threads/gallery/thread-settings-media-gallery.react.js b/web/modals/threads/gallery/thread-settings-media-gallery.react.js --- a/web/modals/threads/gallery/thread-settings-media-gallery.react.js +++ b/web/modals/threads/gallery/thread-settings-media-gallery.react.js @@ -10,7 +10,7 @@ encryptedVideoThumbnailBlobURI, } from 'lib/media/media-utils.js'; import type { Media } from 'lib/types/media-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import GalleryItem from './thread-settings-media-gallery-item.react.js'; @@ -38,7 +38,7 @@ type ThreadSettingsMediaGalleryModalProps = { +onClose: () => void, - +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +parentThreadInfo: LegacyThreadInfo | ThreadInfo, +limit: number, +activeTab: MediaGalleryTab, }; diff --git a/web/modals/threads/members/change-member-role-modal.react.js b/web/modals/threads/members/change-member-role-modal.react.js --- a/web/modals/threads/members/change-member-role-modal.react.js +++ b/web/modals/threads/members/change-member-role-modal.react.js @@ -11,7 +11,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors.js'; import { roleIsAdminRole } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, RelativeMemberInfo, @@ -29,7 +29,7 @@ type ChangeMemberRoleModalProps = { +memberInfo: RelativeMemberInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ChangeMemberRoleModal(props: ChangeMemberRoleModalProps): React.Node { diff --git a/web/modals/threads/members/member.react.js b/web/modals/threads/members/member.react.js --- a/web/modals/threads/members/member.react.js +++ b/web/modals/threads/members/member.react.js @@ -11,7 +11,7 @@ } from 'lib/shared/thread-utils.js'; import { stringForUser } from 'lib/shared/user-utils.js'; import type { SetState } from 'lib/types/hook-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, RelativeMemberInfo, @@ -32,7 +32,7 @@ type Props = { +memberInfo: RelativeMemberInfo, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +setOpenMenu: SetState, }; diff --git a/web/modals/threads/members/members-list.react.js b/web/modals/threads/members/members-list.react.js --- a/web/modals/threads/members/members-list.react.js +++ b/web/modals/threads/members/members-list.react.js @@ -7,7 +7,7 @@ import { useENSNames } from 'lib/hooks/ens-cache.js'; import { stringForUser } from 'lib/shared/user-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type RelativeMemberInfo, type LegacyThreadInfo, @@ -17,7 +17,7 @@ import css from './members-modal.css'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +threadMembers: $ReadOnlyArray, }; diff --git a/web/modals/threads/settings/thread-settings-delete-confirmation-modal.react.js b/web/modals/threads/settings/thread-settings-delete-confirmation-modal.react.js --- a/web/modals/threads/settings/thread-settings-delete-confirmation-modal.react.js +++ b/web/modals/threads/settings/thread-settings-delete-confirmation-modal.react.js @@ -4,7 +4,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import { getThreadsToDeleteText } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types'; import css from './thread-settings-delete-confirmation-modal.css'; @@ -12,7 +12,7 @@ import Modal from '../../modal.react.js'; type BaseProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +onConfirmation: () => mixed, }; diff --git a/web/modals/threads/settings/thread-settings-delete-tab.react.js b/web/modals/threads/settings/thread-settings-delete-tab.react.js --- a/web/modals/threads/settings/thread-settings-delete-tab.react.js +++ b/web/modals/threads/settings/thread-settings-delete-tab.react.js @@ -10,7 +10,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { containedThreadInfos } from 'lib/selectors/thread-selectors.js'; import { type SetState } from 'lib/types/hook-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; @@ -22,7 +22,7 @@ type ThreadSettingsDeleteTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +setErrorMessage: SetState, +errorMessage?: ?string, }; diff --git a/web/modals/threads/settings/thread-settings-general-tab.react.js b/web/modals/threads/settings/thread-settings-general-tab.react.js --- a/web/modals/threads/settings/thread-settings-general-tab.react.js +++ b/web/modals/threads/settings/thread-settings-general-tab.react.js @@ -9,7 +9,7 @@ } from 'lib/actions/thread-actions.js'; import { threadHasPermission } from 'lib/shared/thread-utils.js'; import { type SetState } from 'lib/types/hook-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { type ThreadChanges, @@ -28,7 +28,7 @@ type ThreadSettingsGeneralTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +threadNamePlaceholder: string, +queuedChanges: ThreadChanges, +setQueuedChanges: SetState, diff --git a/web/modals/threads/settings/thread-settings-modal.react.js b/web/modals/threads/settings/thread-settings-modal.react.js --- a/web/modals/threads/settings/thread-settings-modal.react.js +++ b/web/modals/threads/settings/thread-settings-modal.react.js @@ -16,7 +16,7 @@ threadHasPermission, threadUIName, } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { RelationshipButton } from 'lib/types/relationship-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; @@ -54,8 +54,9 @@ deleteThreadLoadingStatusSelector(state) === 'loading' || changeThreadSettingsLoadingStatusSelector(state) === 'loading', ); - const threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo = - useSelector(state => threadInfoSelector(state)[props.threadID]); + const threadInfo: ?LegacyThreadInfo | ?ThreadInfo = useSelector( + state => threadInfoSelector(state)[props.threadID], + ); const modalContext = useModalContext(); const [errorMessage, setErrorMessage] = React.useState(''); const [currentTabType, setCurrentTabType] = @@ -103,7 +104,7 @@ const hasPermissionForTab = React.useCallback( // ESLint doesn't recognize that invariant always throws // eslint-disable-next-line consistent-return - (thread: LegacyThreadInfo | MinimallyEncodedThreadInfo, tab: TabType) => { + (thread: LegacyThreadInfo | ThreadInfo, tab: TabType) => { if (tab === 'general') { return ( threadHasPermission(thread, threadPermissions.EDIT_THREAD_NAME) || diff --git a/web/modals/threads/settings/thread-settings-privacy-tab.react.js b/web/modals/threads/settings/thread-settings-privacy-tab.react.js --- a/web/modals/threads/settings/thread-settings-privacy-tab.react.js +++ b/web/modals/threads/settings/thread-settings-privacy-tab.react.js @@ -10,7 +10,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { threadTypeDescriptions } from 'lib/shared/thread-utils.js'; import { type SetState } from 'lib/types/hook-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import { type ThreadChanges, @@ -42,7 +42,7 @@ type ThreadSettingsPrivacyTabProps = { +threadSettingsOperationInProgress: boolean, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +queuedChanges: ThreadChanges, +setQueuedChanges: SetState, +setErrorMessage: SetState, diff --git a/web/modals/threads/thread-picker-modal.react.js b/web/modals/threads/thread-picker-modal.react.js --- a/web/modals/threads/thread-picker-modal.react.js +++ b/web/modals/threads/thread-picker-modal.react.js @@ -5,7 +5,7 @@ import { useGlobalThreadSearchIndex } from 'lib/selectors/nav-selectors.js'; import { onScreenEntryEditableThreadInfos } from 'lib/selectors/thread-selectors.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; @@ -17,7 +17,7 @@ import Modal, { type ModalOverridableProps } from '../modal.react.js'; type OptionProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +createNewEntry: (threadID: string) => void, +onCloseModal: () => void, }; diff --git a/web/modals/user-profile/user-profile-action-buttons.react.js b/web/modals/user-profile/user-profile-action-buttons.react.js --- a/web/modals/user-profile/user-profile-action-buttons.react.js +++ b/web/modals/user-profile/user-profile-action-buttons.react.js @@ -4,7 +4,7 @@ import * as React from 'react'; import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types'; @@ -14,7 +14,7 @@ import { buttonThemes } from '../../components/button.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function UserProfileActionButtons(props: Props): React.Node { diff --git a/web/modals/user-profile/user-profile-menu.react.js b/web/modals/user-profile/user-profile-menu.react.js --- a/web/modals/user-profile/user-profile-menu.react.js +++ b/web/modals/user-profile/user-profile-menu.react.js @@ -6,7 +6,7 @@ import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { userRelationshipStatus } from 'lib/types/relationship-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types'; @@ -22,7 +22,7 @@ const unblockIcon = ; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function UserProfileMenu(props: Props): React.Node { diff --git a/web/modals/user-profile/user-profile-message-button.react.js b/web/modals/user-profile/user-profile-message-button.react.js --- a/web/modals/user-profile/user-profile-message-button.react.js +++ b/web/modals/user-profile/user-profile-message-button.react.js @@ -4,7 +4,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './user-profile.css'; @@ -12,7 +12,7 @@ import { useOnClickThread } from '../../selectors/thread-selectors.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function UserProfileMessageButton(props: Props): React.Node { diff --git a/web/navigation-panels/chat-thread-ancestors.react.js b/web/navigation-panels/chat-thread-ancestors.react.js --- a/web/navigation-panels/chat-thread-ancestors.react.js +++ b/web/navigation-panels/chat-thread-ancestors.react.js @@ -5,14 +5,14 @@ import { ChevronRight } from 'react-feather'; import { useAncestorThreads } from 'lib/shared/ancestor-threads.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js'; import css from './chat-thread-ancestors.css'; type ThreadAncestorsProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ThreadAncestors(props: ThreadAncestorsProps): React.Node { const { threadInfo } = props; diff --git a/web/navigation-panels/nav-state-info-bar.react.js b/web/navigation-panels/nav-state-info-bar.react.js --- a/web/navigation-panels/nav-state-info-bar.react.js +++ b/web/navigation-panels/nav-state-info-bar.react.js @@ -3,7 +3,7 @@ import classnames from 'classnames'; import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import ThreadAncestors from './chat-thread-ancestors.react.js'; @@ -11,7 +11,7 @@ import ThreadAvatar from '../avatars/thread-avatar.react.js'; type NavStateInfoBarProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function NavStateInfoBar(props: NavStateInfoBarProps): React.Node { const { threadInfo } = props; @@ -27,7 +27,7 @@ } type PossiblyEmptyNavStateInfoBarProps = { - +threadInfoInput: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + +threadInfoInput: ?LegacyThreadInfo | ?ThreadInfo, }; function PossiblyEmptyNavStateInfoBar( props: PossiblyEmptyNavStateInfoBarProps, diff --git a/web/roles/community-roles-modal.react.js b/web/roles/community-roles-modal.react.js --- a/web/roles/community-roles-modal.react.js +++ b/web/roles/community-roles-modal.react.js @@ -5,7 +5,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import { threadInfoSelector } from 'lib/selectors/thread-selectors.js'; import { useRoleMemberCountsForCommunity } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { UserSurfacedPermission } from 'lib/types/thread-permission-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; @@ -17,7 +17,7 @@ import { useSelector } from '../redux/redux-utils.js'; type CommunityRolesModalProps = { - +community: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +community: LegacyThreadInfo | ThreadInfo, }; function CommunityRolesModal(props: CommunityRolesModalProps): React.Node { @@ -25,11 +25,12 @@ const { community } = props; const [threadInfo, setThreadInfo] = React.useState< - LegacyThreadInfo | MinimallyEncodedThreadInfo, + LegacyThreadInfo | ThreadInfo, >(community); const threadID = threadInfo.id; - const reduxThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo = - useSelector(state => threadInfoSelector(state)[threadID]); + const reduxThreadInfo: ?LegacyThreadInfo | ?ThreadInfo = useSelector( + state => threadInfoSelector(state)[threadID], + ); React.useEffect(() => { if (reduxThreadInfo) { diff --git a/web/roles/create-roles-modal.react.js b/web/roles/create-roles-modal.react.js --- a/web/roles/create-roles-modal.react.js +++ b/web/roles/create-roles-modal.react.js @@ -11,7 +11,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type UserSurfacedPermission, type UserSurfacedPermissionOption, @@ -38,7 +38,7 @@ ); type CreateRolesModalProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +action: 'create_role' | 'edit_role', +existingRoleID?: string, +roleName: string, diff --git a/web/roles/delete-role-modal.react.js b/web/roles/delete-role-modal.react.js --- a/web/roles/delete-role-modal.react.js +++ b/web/roles/delete-role-modal.react.js @@ -10,7 +10,7 @@ import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js'; import { useRoleMemberCountsForCommunity } from 'lib/shared/thread-utils.js'; import type { LoadingStatus } from 'lib/types/loading-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatchActionPromise } from 'lib/utils/redux-promise-utils.js'; import { constructRoleDeletionMessagePrompt } from 'lib/utils/role-utils.js'; @@ -25,7 +25,7 @@ ); type DeleteRoleModalProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +defaultRoleID: string, +roleID: string, }; diff --git a/web/roles/role-actions-menu.react.js b/web/roles/role-actions-menu.react.js --- a/web/roles/role-actions-menu.react.js +++ b/web/roles/role-actions-menu.react.js @@ -6,7 +6,7 @@ import { useModalContext } from 'lib/components/modal-provider.react.js'; import SWMansionIcon from 'lib/components/SWMansionIcon.react.js'; import { useRoleUserSurfacedPermissions } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useRoleDeletableAndEditableStatus } from 'lib/utils/role-utils.js'; @@ -19,7 +19,7 @@ const menuIcon = ; type RoleActionsMenuProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +roleName: string, }; diff --git a/web/roles/role-panel-entry.react.js b/web/roles/role-panel-entry.react.js --- a/web/roles/role-panel-entry.react.js +++ b/web/roles/role-panel-entry.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import RoleActionsMenu from './role-actions-menu.react.js'; @@ -10,7 +10,7 @@ import CommIcon from '../CommIcon.react.js'; type RolePanelEntryProps = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, +roleName: string, +memberCount: number, }; diff --git a/web/selectors/calendar-selectors.js b/web/selectors/calendar-selectors.js --- a/web/selectors/calendar-selectors.js +++ b/web/selectors/calendar-selectors.js @@ -9,7 +9,7 @@ import { threadInfoSelector } from 'lib/selectors/thread-selectors.js'; import type SearchIndex from 'lib/shared/search-index.js'; import type { FilterThreadInfo } from 'lib/types/filter-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { filterThreadIDsBelongingToCommunity } from 'lib/utils/drawer-utils.react.js'; @@ -34,7 +34,7 @@ ( calendarPickedCommunityID: ?string, threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, ) => { if (!calendarPickedCommunityID) { diff --git a/web/selectors/chat-selectors.js b/web/selectors/chat-selectors.js --- a/web/selectors/chat-selectors.js +++ b/web/selectors/chat-selectors.js @@ -14,7 +14,7 @@ } from 'lib/selectors/thread-selectors.js'; import { threadIsPending } from 'lib/shared/thread-utils.js'; import type { MessageInfo, MessageStore } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, SidebarInfo } from 'lib/types/thread-types.js'; import type { AppState } from '../redux/redux-setup.js'; @@ -30,12 +30,12 @@ sidebarInfoSelector, ( threadInfos: { - +[id: string]: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +[id: string]: LegacyThreadInfo | ThreadInfo, }, messageStore: MessageStore, messageInfos: { +[id: string]: ?MessageInfo }, activeChatThreadID: ?string, - pendingThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + pendingThreadInfo: ?LegacyThreadInfo | ?ThreadInfo, sidebarInfos: { +[id: string]: $ReadOnlyArray }, ): ?ChatThreadItem => { if (!activeChatThreadID) { @@ -59,7 +59,7 @@ ); function useChatThreadItem( - threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + threadInfo: ?LegacyThreadInfo | ?ThreadInfo, ): ?ChatThreadItem { const messageInfos = useSelector(messageInfoSelector); const sidebarInfos = useSelector(sidebarInfoSelector); diff --git a/web/selectors/thread-selectors.js b/web/selectors/thread-selectors.js --- a/web/selectors/thread-selectors.js +++ b/web/selectors/thread-selectors.js @@ -15,7 +15,7 @@ ComposableMessageInfo, RobotextMessageInfo, } from 'lib/types/message-types.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo, RawThreadInfos, @@ -29,7 +29,7 @@ import { useSelector } from '../redux/redux-utils.js'; function useOnClickThread( - thread: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo, + thread: ?LegacyThreadInfo | ?ThreadInfo, ): (event: SyntheticEvent) => void { const dispatch = useDispatch(); return React.useCallback( @@ -69,7 +69,7 @@ function useOnClickPendingSidebar( messageInfo: ComposableMessageInfo | RobotextMessageInfo, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): (event: SyntheticEvent) => mixed { const dispatch = useDispatch(); const loggedInUserInfo = useLoggedInUserInfo(); diff --git a/web/sidebar/community-drawer-item-community-handlers.react.js b/web/sidebar/community-drawer-item-community-handlers.react.js --- a/web/sidebar/community-drawer-item-community-handlers.react.js +++ b/web/sidebar/community-drawer-item-community-handlers.react.js @@ -7,7 +7,7 @@ updateCalendarCommunityFilter, updateChatCommunityFilter, } from 'lib/actions/community-actions.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { useDispatch } from 'lib/utils/redux-utils.js'; @@ -22,7 +22,7 @@ export type HandlerProps = { +setHandler: (handler: CommunityDrawerItemCommunityHandler) => void, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ChatDrawerItemCommunityHandler(props: HandlerProps): React.Node { diff --git a/web/sidebar/community-drawer-item-handlers.react.js b/web/sidebar/community-drawer-item-handlers.react.js --- a/web/sidebar/community-drawer-item-handlers.react.js +++ b/web/sidebar/community-drawer-item-handlers.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { CommunityDrawerItemHandler } from './community-drawer-item-handler.react.js'; @@ -15,7 +15,7 @@ export type HandlerProps = { +setHandler: (handler: CommunityDrawerItemHandler) => void, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function ChatDrawerItemHandler(props: HandlerProps): React.Node { diff --git a/web/sidebar/community-drawer-utils.react.js b/web/sidebar/community-drawer-utils.react.js --- a/web/sidebar/community-drawer-utils.react.js +++ b/web/sidebar/community-drawer-utils.react.js @@ -2,7 +2,7 @@ import * as React from 'react'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types'; import type { CommunityDrawerItemData } from 'lib/utils/drawer-utils.react'; @@ -28,7 +28,7 @@ hasSubchannelsButton: boolean, itemChildren: $ReadOnlyArray>, paddingLeft: number, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, expandable: boolean, handlerType: NavigationTab, }): React.Node { diff --git a/web/sidebar/subchannels-button.react.js b/web/sidebar/subchannels-button.react.js --- a/web/sidebar/subchannels-button.react.js +++ b/web/sidebar/subchannels-button.react.js @@ -4,7 +4,7 @@ import { CornerDownRight } from 'react-feather'; import { useModalContext } from 'lib/components/modal-provider.react.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './subchannels-button.css'; @@ -12,7 +12,7 @@ import SubchannelsModal from '../modals/threads/subchannels/subchannels-modal.react.js'; type Props = { - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function SubchannelsButton(props: Props): React.Node { diff --git a/web/tooltips/message-tooltip.react.js b/web/tooltips/message-tooltip.react.js --- a/web/tooltips/message-tooltip.react.js +++ b/web/tooltips/message-tooltip.react.js @@ -7,7 +7,7 @@ import type { ChatMessageInfoItem } from 'lib/selectors/chat-selectors.js'; import { useNextLocalID } from 'lib/shared/message-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import css from './message-tooltip.css'; @@ -33,7 +33,7 @@ +tooltipPositionStyle: TooltipPositionStyle, +tooltipSize: TooltipSize, +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function MessageTooltip(props: MessageTooltipProps): React.Node { const { diff --git a/web/tooltips/tooltip-action-utils.js b/web/tooltips/tooltip-action-utils.js --- a/web/tooltips/tooltip-action-utils.js +++ b/web/tooltips/tooltip-action-utils.js @@ -17,7 +17,7 @@ useSidebarExistsOrCanBeCreated, } from 'lib/shared/thread-utils.js'; import { messageTypes } from 'lib/types/message-types-enum.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadPermissions } from 'lib/types/thread-permission-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { longAbsoluteDate } from 'lib/utils/date-utils.js'; @@ -130,7 +130,7 @@ function useMessageTooltipSidebarAction( item: ChatMessageInfoItem, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): ?MessageTooltipAction { const { threadCreatedFromMessage, messageInfo } = item; const { popModal } = useModalContext(); @@ -172,7 +172,7 @@ function useMessageTooltipReplyAction( item: ChatMessageInfoItem, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): ?MessageTooltipAction { const { messageInfo } = item; const { popModal } = useModalContext(); @@ -237,7 +237,7 @@ function useMessageReactAction( item: ChatMessageInfoItem, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): ?MessageTooltipAction { const { messageInfo } = item; @@ -272,7 +272,7 @@ function useMessageTogglePinAction( item: ChatMessageInfoItem, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): ?MessageTooltipAction { const { pushModal } = useModalContext(); const { messageInfo, isPinned } = item; @@ -308,7 +308,7 @@ function useMessageEditAction( item: ChatMessageInfoItem, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): ?MessageTooltipAction { const { messageInfo } = item; @@ -351,7 +351,7 @@ function useMessageTooltipActions( item: ChatMessageInfoItem, - threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + threadInfo: LegacyThreadInfo | ThreadInfo, ): $ReadOnlyArray { const sidebarAction = useMessageTooltipSidebarAction(item, threadInfo); const replyAction = useMessageTooltipReplyAction(item, threadInfo); @@ -388,7 +388,7 @@ type UseMessageTooltipArgs = { +availablePositions: $ReadOnlyArray, +item: ChatMessageInfoItem, - +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +threadInfo: LegacyThreadInfo | ThreadInfo, }; function useMessageTooltip({ diff --git a/web/types/nav-types.js b/web/types/nav-types.js --- a/web/types/nav-types.js +++ b/web/types/nav-types.js @@ -2,7 +2,7 @@ import type { TInterface } from 'tcomb'; import t from 'tcomb'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { type BaseNavInfo } from 'lib/types/nav-types.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import { legacyThreadInfoValidator } from 'lib/types/thread-types.js'; @@ -34,7 +34,7 @@ ...$Exact, +tab: NavigationTab, +activeChatThreadID: ?string, - +pendingThread?: LegacyThreadInfo | MinimallyEncodedThreadInfo, + +pendingThread?: LegacyThreadInfo | ThreadInfo, +settingsSection?: NavigationSettingsSection, +selectedUserList?: $ReadOnlyArray, +chatMode?: NavigationChatMode, diff --git a/web/utils/thread-utils.js b/web/utils/thread-utils.js --- a/web/utils/thread-utils.js +++ b/web/utils/thread-utils.js @@ -10,7 +10,7 @@ createPendingThread, useExistingThreadInfoFinder, } from 'lib/shared/thread-utils.js'; -import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; +import type { ThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js'; import { threadTypes } from 'lib/types/thread-types-enum.js'; import type { LegacyThreadInfo } from 'lib/types/thread-types.js'; import type { AccountUserInfo } from 'lib/types/user-types.js'; @@ -40,7 +40,7 @@ function useThreadInfoForPossiblyPendingThread( activeChatThreadID: ?string, -): ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo { +): ?LegacyThreadInfo | ?ThreadInfo { const { isChatCreation, selectedUserInfos } = useInfosForPendingThread(); const loggedInUserInfo = useLoggedInUserInfo();