Page MenuHomePhabricator

D10095.diff
No OneTemporary

D10095.diff

This file is larger than 256 KB, so syntax highlighting was skipped.
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
@@ -39,7 +39,10 @@
ResolvedNotifTexts,
} from 'lib/types/notif-types.js';
import { resolvedNotifTextsValidator } from 'lib/types/notif-types.js';
-import type { ServerThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ ServerThreadInfo,
+ LegacyThreadInfo,
+} from 'lib/types/thread-types.js';
import { updateTypes } from 'lib/types/update-types-enum.js';
import { type GlobalUserInfo } from 'lib/types/user-types.js';
import { isDev } from 'lib/utils/dev-utils.js';
@@ -193,7 +196,7 @@
userID: string,
pushUserInfo: PushUserInfo,
unreadCount: number,
- threadInfos: { +[threadID: string]: ThreadInfo },
+ threadInfos: { +[threadID: string]: LegacyThreadInfo },
userInfos: { +[userID: string]: GlobalUserInfo },
dbIDs: string[], // mutable
rowsToSave: Map<string, NotificationRow>, // 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
@@ -14,7 +14,7 @@
ChatMentionCandidates,
ChatMentionCandidatesObj,
ResolvedThreadInfo,
- ThreadInfo,
+ LegacyThreadInfo,
} from '../types/thread-types.js';
import { useResolvedThreadInfosObj } from '../utils/entity-helpers.js';
import { useSelector } from '../utils/redux-utils.js';
@@ -24,7 +24,7 @@
};
export type ChatMentionContextType = {
+getChatMentionSearchIndex: (
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => SentencePrefixSearchIndex,
+communityThreadIDForGenesisThreads: { +[id: string]: string },
+chatMentionCandidatesObj: ChatMentionCandidatesObj,
@@ -46,7 +46,7 @@
const searchIndices = useChatMentionSearchIndex(chatMentionCandidatesObj);
const getChatMentionSearchIndex = React.useCallback(
- (threadInfo: ThreadInfo | MinimallyEncodedThreadInfo) => {
+ (threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo) => {
if (threadInfo.community === genesis.id) {
return searchIndices[communityThreadIDForGenesisThreads[threadInfo.id]];
}
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
@@ -11,7 +11,7 @@
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import type {
ChatMentionCandidates,
- ThreadInfo,
+ LegacyThreadInfo,
} from '../types/thread-types.js';
function useChatMentionContext(): ChatMentionContextType {
@@ -22,7 +22,7 @@
}
function useThreadChatMentionCandidates(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): 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,12 +15,14 @@
import { threadInChatList } from '../shared/thread-utils.js';
import threadWatcher from '../shared/thread-watcher.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo, RawThreadInfo } from '../types/thread-types.js';
+import type { LegacyThreadInfo, RawThreadInfo } from '../types/thread-types.js';
import { useDispatchActionPromise } from '../utils/action-utils.js';
import { useSelector } from '../utils/redux-utils.js';
type ThreadFilter = {
- +predicate?: (thread: ThreadInfo | MinimallyEncodedThreadInfo) => boolean,
+ +predicate?: (
+ thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ ) => boolean,
+searchText?: string,
};
@@ -41,7 +43,9 @@
}, [childThreads, predicate]);
const filterSubchannels = React.useCallback(
- (thread: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo)) => {
+ (
+ thread: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ ) => {
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
@@ -16,13 +16,13 @@
import type { MinimallyEncodedThreadInfo } 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 ThreadInfo } from '../types/thread-types.js';
+import { type LegacyThreadInfo } from '../types/thread-types.js';
import { useDispatchActionPromise } from '../utils/action-utils.js';
import { useSelector } from '../utils/redux-utils.js';
function canPromoteSidebar(
- sidebarThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): boolean {
if (!threadIsSidebar(sidebarThreadInfo)) {
return false;
@@ -46,7 +46,7 @@
};
function usePromoteSidebar(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
onError?: () => mixed,
): PromoteSidebarType {
const dispatchActionPromise = useDispatchActionPromise();
@@ -57,7 +57,7 @@
const loadingStatus = useSelector(loadingStatusSelector);
const { parentThreadID } = threadInfo;
- const parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo =
+ const parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo =
useSelector(state =>
parentThreadID ? threadInfoSelector(state)[parentThreadID] : null,
);
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
@@ -13,7 +13,7 @@
type RelationshipAction,
relationshipActions,
} from '../types/relationship-types.js';
-import type { ThreadInfo } from '../types/thread-types.js';
+import type { LegacyThreadInfo } from '../types/thread-types.js';
import type { UserInfo } from '../types/user-types.js';
import {
useDispatchActionPromise,
@@ -34,7 +34,7 @@
};
function useRelationshipPrompt(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -13,7 +13,7 @@
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import type {
SidebarInfo,
- ThreadInfo,
+ LegacyThreadInfo,
RawThreadInfo,
} from '../types/thread-types.js';
import { useSelector } from '../utils/redux-utils.js';
@@ -32,7 +32,7 @@
};
function useSearchThreads<U: SidebarInfo | ChatThreadItem>(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
childThreadInfos: $ReadOnlyArray<U>,
): SearchThreadsResult<U> {
const [searchState, setSearchState] = React.useState<ThreadSearchState>({
@@ -92,7 +92,7 @@
}
function useSearchSidebars(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): SearchThreadsResult<SidebarInfo> {
const childThreadInfos = useSelector(
state => sidebarInfoSelector(state)[threadInfo.id] ?? [],
@@ -101,11 +101,12 @@
}
function useSearchSubchannels(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): SearchThreadsResult<ChatThreadItem> {
const filterFunc = React.useCallback(
- (thread: ?(ThreadInfo | MinimallyEncodedThreadInfo | RawThreadInfo)) =>
- threadIsChannel(thread) && thread?.parentThreadID === threadInfo.id,
+ (
+ thread: ?(LegacyThreadInfo | MinimallyEncodedThreadInfo | 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
@@ -11,11 +11,11 @@
SetThreadUnreadStatusRequest,
} from '../types/activity-types.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from '../types/thread-types.js';
+import type { LegacyThreadInfo } from '../types/thread-types.js';
import { useDispatchActionPromise } from '../utils/action-utils.js';
function useToggleUnreadStatus(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -19,7 +19,7 @@
legacyRawThreadInfoValidator,
legacyRoleInfoValidator,
threadCurrentUserInfoValidator,
- threadInfoValidator,
+ legacyThreadInfoValidator,
} from '../types/thread-types.js';
import { tBool, tID, tShape } from '../utils/validation-utils.js';
@@ -53,7 +53,7 @@
const minimallyEncodedThreadInfoValidator: TInterface<MinimallyEncodedThreadInfo> =
tShape<MinimallyEncodedThreadInfo>({
- ...threadInfoValidator.meta.props,
+ ...legacyThreadInfoValidator.meta.props,
minimallyEncoded: tBool(true),
members: t.list(minimallyEncodedRelativeMemberInfoValidator),
roles: t.dict(tID, minimallyEncodedRoleInfoValidator),
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
@@ -39,7 +39,7 @@
import type { BaseAppState } from '../types/redux-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type RawThreadInfo,
type SidebarInfo,
maxReadSidebars,
@@ -68,7 +68,7 @@
export type ChatThreadItem = {
+type: 'chatThreadItem',
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+mostRecentMessageInfo: ?MessageInfo,
+mostRecentNonLocalMessage: ?string,
+lastUpdatedTime: number,
@@ -96,7 +96,7 @@
}
function getMostRecentMessageInfo(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
messageStore: MessageStore,
messages: { +[id: string]: ?MessageInfo },
): ?MessageInfo {
@@ -115,7 +115,7 @@
}
function getLastUpdatedTime(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
mostRecentMessageInfo: ?MessageInfo,
): number {
return mostRecentMessageInfo
@@ -124,7 +124,7 @@
}
function createChatThreadItem(
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
messageStore: MessageStore,
messages: { +[id: string]: ?MessageInfo },
sidebarInfos: ?$ReadOnlyArray<SidebarInfo>,
@@ -209,7 +209,7 @@
messageInfoSelector,
sidebarInfoSelector,
(
- threadInfos: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
messageStore: MessageStore,
messageInfos: { +[id: string]: ?MessageInfo },
sidebarInfos: { +[id: string]: $ReadOnlyArray<SidebarInfo> },
@@ -229,7 +229,11 @@
function useFilteredChatListData(
filterFunction: (
- threadInfo: ?(ThreadInfo | MinimallyEncodedThreadInfo | RawThreadInfo),
+ threadInfo: ?(
+ | LegacyThreadInfo
+ | MinimallyEncodedThreadInfo
+ | RawThreadInfo
+ ),
) => boolean,
): $ReadOnlyArray<ChatThreadItem> {
const threadInfos = useSelector(threadInfoSelector);
@@ -251,17 +255,21 @@
}
function getChatThreadItems(
- threadInfos: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
messageStore: MessageStore,
messageInfos: { +[id: string]: ?MessageInfo },
sidebarInfos: { +[id: string]: $ReadOnlyArray<SidebarInfo> },
filterFunction: (
- threadInfo: ?(ThreadInfo | MinimallyEncodedThreadInfo | RawThreadInfo),
+ threadInfo: ?(
+ | LegacyThreadInfo
+ | MinimallyEncodedThreadInfo
+ | RawThreadInfo
+ ),
) => boolean,
): $ReadOnlyArray<ChatThreadItem> {
return _flow(
_filter(filterFunction),
- _map((threadInfo: ThreadInfo): ChatThreadItem =>
+ _map((threadInfo: LegacyThreadInfo): ChatThreadItem =>
createChatThreadItem(
threadInfo,
messageStore,
@@ -281,7 +289,7 @@
+startsCluster: boolean,
endsCluster: boolean,
+robotext: EntityText,
- +threadCreatedFromMessage: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+reactions: ReactionInfo,
};
export type ChatMessageInfoItem =
@@ -294,7 +302,9 @@
+startsConversation: boolean,
+startsCluster: boolean,
endsCluster: boolean,
- +threadCreatedFromMessage: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadCreatedFromMessage:
+ | ?LegacyThreadInfo
+ | ?MinimallyEncodedThreadInfo,
+reactions: ReactionInfo,
+hasBeenEdited: boolean,
+isPinned: boolean,
@@ -313,8 +323,8 @@
threadID: string,
messageStore: MessageStore,
messageInfos: { +[id: string]: ?MessageInfo },
- threadInfos: { +[id: string]: ThreadInfo },
- threadInfoFromSourceMessageID: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
+ threadInfoFromSourceMessageID: { +[id: string]: LegacyThreadInfo },
additionalMessages: $ReadOnlyArray<MessageInfo>,
viewerID: string,
): ChatMessageItem[] {
@@ -585,8 +595,8 @@
(
messageStore: MessageStore,
messageInfos: { +[id: string]: ?MessageInfo },
- threadInfos: { +[id: string]: ThreadInfo },
- threadInfoFromSourceMessageID: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
+ threadInfoFromSourceMessageID: { +[id: string]: LegacyThreadInfo },
viewerID: ?string,
): ?(ChatMessageItem[]) => {
if (!threadID || !viewerID) {
@@ -612,7 +622,7 @@
export type UseMessageListDataArgs = {
+searching: boolean,
+userInfoInputArray: $ReadOnlyArray<AccountUserInfo>,
- +threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
};
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
@@ -15,7 +15,7 @@
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import type { BaseNavInfo } from '../types/nav-types.js';
import type { BaseAppState } from '../types/redux-types.js';
-import type { RawThreadInfo, ThreadInfo } from '../types/thread-types.js';
+import type { RawThreadInfo, LegacyThreadInfo } from '../types/thread-types.js';
import type { UserInfo } from '../types/user-types.js';
import { getConfig } from '../utils/config.js';
import { values } from '../utils/objects.js';
@@ -81,7 +81,7 @@
function useThreadSearchIndex(
threadInfos: $ReadOnlyArray<
- RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
>,
): SearchIndex {
const userInfos = useSelector(state => state.userStore.userInfos);
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
@@ -48,7 +48,7 @@
type ThreadType,
} from '../types/thread-types-enum.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type LegacyRawThreadInfo,
type SidebarInfo,
type LegacyRawThreadInfos,
@@ -60,7 +60,7 @@
const _mapValuesWithKeys = _mapValues.convert({ cap: false });
type ThreadInfoSelectorType = (state: BaseAppState<>) => {
- +[id: string]: ThreadInfo,
+ +[id: string]: LegacyThreadInfo,
};
const threadInfoSelector: ThreadInfoSelectorType = createObjectSelector(
(state: BaseAppState<>) => state.threadStore.threadInfos,
@@ -71,9 +71,9 @@
const communityThreadSelector: (
state: BaseAppState<>,
-) => $ReadOnlyArray<ThreadInfo> = createSelector(
+) => $ReadOnlyArray<LegacyThreadInfo> = createSelector(
threadInfoSelector,
- (threadInfos: { +[id: string]: ThreadInfo }) => {
+ (threadInfos: { +[id: string]: LegacyThreadInfo }) => {
const result = [];
for (const threadID in threadInfos) {
const threadInfo = threadInfos[threadID];
@@ -88,9 +88,9 @@
const canBeOnScreenThreadInfos: (
state: BaseAppState<>,
-) => $ReadOnlyArray<ThreadInfo> = createSelector(
+) => $ReadOnlyArray<LegacyThreadInfo> = createSelector(
threadInfoSelector,
- (threadInfos: { +[id: string]: ThreadInfo }) => {
+ (threadInfos: { +[id: string]: LegacyThreadInfo }) => {
const result = [];
for (const threadID in threadInfos) {
const threadInfo = threadInfos[threadID];
@@ -105,13 +105,13 @@
const onScreenThreadInfos: (
state: BaseAppState<>,
-) => $ReadOnlyArray<ThreadInfo> = createSelector(
+) => $ReadOnlyArray<LegacyThreadInfo> = createSelector(
filteredThreadIDsSelector,
canBeOnScreenThreadInfos,
(
inputThreadIDs: ?$ReadOnlySet<string>,
- threadInfos: $ReadOnlyArray<ThreadInfo>,
- ): $ReadOnlyArray<ThreadInfo> => {
+ threadInfos: $ReadOnlyArray<LegacyThreadInfo>,
+ ): $ReadOnlyArray<LegacyThreadInfo> => {
const threadIDs = inputThreadIDs;
if (!threadIDs) {
return threadInfos;
@@ -122,9 +122,11 @@
const onScreenEntryEditableThreadInfos: (
state: BaseAppState<>,
-) => $ReadOnlyArray<ThreadInfo> = createSelector(
+) => $ReadOnlyArray<LegacyThreadInfo> = createSelector(
onScreenThreadInfos,
- (threadInfos: $ReadOnlyArray<ThreadInfo>): $ReadOnlyArray<ThreadInfo> =>
+ (
+ threadInfos: $ReadOnlyArray<LegacyThreadInfo>,
+ ): $ReadOnlyArray<LegacyThreadInfo> =>
threadInfos.filter(threadInfo =>
threadHasPermission(threadInfo, threadPermissions.EDIT_ENTRIES),
),
@@ -155,7 +157,7 @@
daysToEntries: { +[day: string]: string[] },
startDateString: string,
endDateString: string,
- onScreen: $ReadOnlyArray<ThreadInfo>,
+ onScreen: $ReadOnlyArray<LegacyThreadInfo>,
includeDeleted: boolean,
) => {
const allDaysWithinRange: { [string]: string[] } = {},
@@ -184,11 +186,11 @@
);
const childThreadInfos: (state: BaseAppState<>) => {
- +[id: string]: $ReadOnlyArray<ThreadInfo>,
+ +[id: string]: $ReadOnlyArray<LegacyThreadInfo>,
} = createSelector(
threadInfoSelector,
- (threadInfos: { +[id: string]: ThreadInfo }) => {
- const result: { [string]: ThreadInfo[] } = {};
+ (threadInfos: { +[id: string]: LegacyThreadInfo }) => {
+ const result: { [string]: LegacyThreadInfo[] } = {};
for (const id in threadInfos) {
const threadInfo = threadInfos[id];
const parentThreadID = threadInfo.parentThreadID;
@@ -196,7 +198,7 @@
continue;
}
if (result[parentThreadID] === undefined) {
- result[parentThreadID] = ([]: ThreadInfo[]);
+ result[parentThreadID] = ([]: LegacyThreadInfo[]);
}
result[parentThreadID].push(threadInfo);
}
@@ -205,11 +207,11 @@
);
const containedThreadInfos: (state: BaseAppState<>) => {
- +[id: string]: $ReadOnlyArray<ThreadInfo>,
+ +[id: string]: $ReadOnlyArray<LegacyThreadInfo>,
} = createSelector(
threadInfoSelector,
- (threadInfos: { +[id: string]: ThreadInfo }) => {
- const result: { [string]: ThreadInfo[] } = {};
+ (threadInfos: { +[id: string]: LegacyThreadInfo }) => {
+ const result: { [string]: LegacyThreadInfo[] } = {};
for (const id in threadInfos) {
const threadInfo = threadInfos[id];
const { containingThreadID } = threadInfo;
@@ -217,7 +219,7 @@
continue;
}
if (result[containingThreadID] === undefined) {
- result[containingThreadID] = ([]: ThreadInfo[]);
+ result[containingThreadID] = ([]: LegacyThreadInfo[]);
}
result[containingThreadID].push(threadInfo);
}
@@ -226,7 +228,7 @@
);
function getMostRecentRawMessageInfo(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
messageStore: MessageStore,
): ?RawMessageInfo {
const thread = messageStore.threads[threadInfo.id];
@@ -244,7 +246,10 @@
} = createObjectSelector(
childThreadInfos,
(state: BaseAppState<>) => state.messageStore,
- (childThreads: $ReadOnlyArray<ThreadInfo>, messageStore: MessageStore) => {
+ (
+ childThreads: $ReadOnlyArray<LegacyThreadInfo>,
+ messageStore: MessageStore,
+ ) => {
const sidebarInfos = [];
for (const childThreadInfo of childThreads) {
if (
@@ -293,14 +298,16 @@
const baseAncestorThreadInfos: (
threadID: string,
-) => (BaseAppState<>) => $ReadOnlyArray<ThreadInfo> = (threadID: string) =>
+) => (BaseAppState<>) => $ReadOnlyArray<LegacyThreadInfo> = (
+ threadID: string,
+) =>
createSelector(
(state: BaseAppState<>) => threadInfoSelector(state),
(threadInfos: {
- +[id: string]: ThreadInfo,
- }): $ReadOnlyArray<ThreadInfo> => {
- const pathComponents: ThreadInfo[] = [];
- let node: ?ThreadInfo = threadInfos[threadID];
+ +[id: string]: LegacyThreadInfo,
+ }): $ReadOnlyArray<LegacyThreadInfo> => {
+ const pathComponents: LegacyThreadInfo[] = [];
+ let node: ?LegacyThreadInfo = threadInfos[threadID];
while (node) {
pathComponents.push(node);
node = node.parentThreadID ? threadInfos[node.parentThreadID] : null;
@@ -312,7 +319,7 @@
const ancestorThreadInfos: (
threadID: string,
-) => (state: BaseAppState<>) => $ReadOnlyArray<ThreadInfo> = _memoize(
+) => (state: BaseAppState<>) => $ReadOnlyArray<LegacyThreadInfo> = _memoize(
baseAncestorThreadInfos,
);
@@ -394,17 +401,17 @@
);
const threadInfoFromSourceMessageIDSelector: (state: BaseAppState<>) => {
- +[id: string]: ThreadInfo,
+ +[id: string]: LegacyThreadInfo,
} = createSelector(
(state: BaseAppState<>) => state.threadStore.threadInfos,
threadInfoSelector,
(
rawThreadInfos: LegacyRawThreadInfos,
- threadInfos: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
) => {
const pendingToRealizedThreadIDs =
pendingToRealizedThreadIDsSelector(rawThreadInfos);
- const result: { [string]: ThreadInfo } = {};
+ const result: { [string]: LegacyThreadInfo } = {};
for (const realizedID of pendingToRealizedThreadIDs.values()) {
const threadInfo = threadInfos[realizedID];
if (threadInfo && threadInfo.sourceMessageID) {
@@ -460,7 +467,7 @@
(state: BaseAppState<>) => threadInfoSelector(state)[threadID],
(state: BaseAppState<>) =>
containingThreadID ? threadInfoSelector(state)[containingThreadID] : null,
- (threadInfo: ThreadInfo, containingThreadInfo: ?ThreadInfo) => {
+ (threadInfo: LegacyThreadInfo, containingThreadInfo: ?LegacyThreadInfo) => {
return () => {
let threadAvatar = getAvatarForThread(threadInfo, containingThreadInfo);
if (threadAvatar.type !== 'emoji') {
@@ -480,14 +487,14 @@
const baseThreadInfosSelectorForThreadType: (
threadType: ThreadType,
-) => (BaseAppState<>) => $ReadOnlyArray<ThreadInfo> = (
+) => (BaseAppState<>) => $ReadOnlyArray<LegacyThreadInfo> = (
threadType: ThreadType,
) =>
createSelector(
(state: BaseAppState<>) => threadInfoSelector(state),
(threadInfos: {
- +[id: string]: ThreadInfo,
- }): $ReadOnlyArray<ThreadInfo> => {
+ +[id: string]: LegacyThreadInfo,
+ }): $ReadOnlyArray<LegacyThreadInfo> => {
const result = [];
for (const threadID in threadInfos) {
@@ -503,7 +510,7 @@
const threadInfosSelectorForThreadType: (
threadType: ThreadType,
-) => (state: BaseAppState<>) => $ReadOnlyArray<ThreadInfo> = _memoize(
+) => (state: BaseAppState<>) => $ReadOnlyArray<LegacyThreadInfo> = _memoize(
baseThreadInfosSelectorForThreadType,
);
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
@@ -7,12 +7,12 @@
} 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/thread-types.js';
+import { type LegacyThreadInfo } from '../types/thread-types.js';
import { useSelector } from '../utils/redux-utils.js';
function useAncestorThreads(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
-): $ReadOnlyArray<ThreadInfo> {
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+): $ReadOnlyArray<LegacyThreadInfo> {
return useSelector(state => {
if (!threadIsPending(threadInfo.id)) {
const ancestorThreads = ancestorThreadInfos(threadInfo.id)(state);
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
@@ -18,7 +18,7 @@
} from '../types/avatar-types.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
-import type { ThreadInfo, RawThreadInfo } from '../types/thread-types.js';
+import type { LegacyThreadInfo, RawThreadInfo } from '../types/thread-types.js';
import type { UserInfos } from '../types/user-types.js';
import { useSelector } from '../utils/redux-utils.js';
import { ashoatKeyserverID } from '../utils/validation-utils.js';
@@ -271,7 +271,7 @@
}
function getUserAvatarForThread(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): ClientAvatar {
@@ -297,8 +297,8 @@
}
function getAvatarForThread(
- thread: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
- containingThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ thread: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ containingThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): ClientAvatar {
if (thread.avatar) {
return thread.avatar;
@@ -314,7 +314,7 @@
}
function useAvatarForThread(
- thread: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ thread: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
): 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
@@ -16,7 +16,7 @@
import { messageTypes } from '../types/message-types-enum.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from '../types/thread-permission-types.js';
-import { type ThreadInfo } from '../types/thread-types.js';
+import { type LegacyThreadInfo } from '../types/thread-types.js';
import { useDispatchActionPromise } from '../utils/action-utils.js';
import { useSelector } from '../utils/redux-utils.js';
@@ -49,7 +49,7 @@
}
function useCanEditMessage(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -2,10 +2,10 @@
import type { ReactionInfo } from '../selectors/chat-selectors.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from '../types/thread-types.js';
+import type { LegacyThreadInfo } from '../types/thread-types.js';
function getInlineEngagementSidebarText(
- threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): 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
@@ -10,7 +10,7 @@
} from '../types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ResolvedThreadInfo,
ChatMentionCandidates,
RelativeMemberInfo,
@@ -164,8 +164,8 @@
}
function getUserMentionsCandidates(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): $ReadOnlyArray<RelativeMemberInfo> {
if (threadInfo.type !== threadTypes.SIDEBAR) {
return threadInfo.members;
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
@@ -42,7 +42,7 @@
ReactionMessageInfo,
} from '../types/messages/reaction.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
-import type { RawThreadInfo, ThreadInfo } from '../types/thread-types.js';
+import type { RawThreadInfo, LegacyThreadInfo } from '../types/thread-types.js';
import type { UserInfos } from '../types/user-types.js';
import { extractKeyserverIDFromID } from '../utils/action-utils.js';
import {
@@ -76,8 +76,8 @@
function robotextForMessageInfo(
messageInfo: RobotextMessageInfo,
- threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): EntityText {
const messageSpec = messageSpecs[messageInfo.type];
invariant(
@@ -91,7 +91,7 @@
rawMessageInfo: RawMessageInfo,
viewerID: ?string,
userInfos: UserInfos,
- threadInfos: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
): ?MessageInfo {
const creatorInfo = userInfos[rawMessageInfo.creatorID];
const creator = {
@@ -411,8 +411,8 @@
| RobotextMessageInfo
| ReactionMessageInfo
| EditMessageInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
markdownRules: ParserRules,
): EntityText {
const { messageTitle } = messageSpecs[messageInfo.type];
@@ -498,7 +498,7 @@
};
function useMessagePreview(
originalMessageInfo: ?MessageInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
markdownRules: ParserRules,
): ?MessagePreviewResult {
let messageInfo;
@@ -680,7 +680,7 @@
function isInvalidPinSourceForThread(
messageInfo: RawMessageInfo | MessageInfo,
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
): 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
@@ -20,7 +20,7 @@
rawAddMembersMessageInfoValidator,
} from '../../types/messages/add-members.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import {
ET,
@@ -124,7 +124,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
params: NotificationTextsParams,
): Promise<NotifTexts> {
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
@@ -24,7 +24,7 @@
} from '../../types/messages/change-role.js';
import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import {
ET,
@@ -158,7 +158,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
params: NotificationTextsParams,
): Promise<NotifTexts> {
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
@@ -22,7 +22,7 @@
} from '../../types/messages/change-settings.js';
import type { NotifTexts } from '../../types/notif-types.js';
import { assertThreadType } from '../../types/thread-types-enum.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { ET, type EntityText } from '../../utils/entity-text.js';
import { validHexColorRegex } from '../account-utils.js';
@@ -158,7 +158,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
params: NotificationTextsParams,
): Promise<NotifTexts> {
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
@@ -16,7 +16,7 @@
rawCreateEntryMessageInfoValidator,
} from '../../types/messages/create-entry.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { prettyDate } from '../../utils/date-utils.js';
import { ET, type EntityText } from '../../utils/entity-text.js';
@@ -119,7 +119,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -22,7 +22,7 @@
rawCreateSidebarMessageInfoValidator,
} from '../../types/messages/create-sidebar.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import {
ET,
@@ -173,7 +173,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
params: NotificationTextsParams,
): Promise<NotifTexts> {
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
@@ -24,7 +24,7 @@
import type { NotifTexts } from '../../types/notif-types.js';
import { threadPermissions } from '../../types/thread-permission-types.js';
import { threadTypes } from '../../types/thread-types-enum.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { ET, type EntityText } from '../../utils/entity-text.js';
import { notifTextsForSubthreadCreation } from '../notif-utils.js';
@@ -140,7 +140,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -21,7 +21,7 @@
rawCreateThreadMessageInfoValidator,
} from '../../types/messages/create-thread.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import {
ET,
@@ -157,7 +157,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -16,7 +16,7 @@
rawDeleteEntryMessageInfoValidator,
} from '../../types/messages/delete-entry.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { prettyDate } from '../../utils/date-utils.js';
import { ET, type EntityText } from '../../utils/entity-text.js';
@@ -118,7 +118,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -16,7 +16,7 @@
rawEditEntryMessageInfoValidator,
} from '../../types/messages/edit-entry.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { prettyDate } from '../../utils/date-utils.js';
import { ET, type EntityText } from '../../utils/entity-text.js';
@@ -119,7 +119,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -16,7 +16,7 @@
rawJoinThreadMessageInfoValidator,
} from '../../types/messages/join-thread.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import {
ET,
@@ -89,7 +89,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -16,7 +16,7 @@
rawLeaveThreadMessageInfoValidator,
} from '../../types/messages/leave-thread.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import {
ET,
@@ -89,7 +89,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -14,14 +14,14 @@
import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js';
import type { MinimallyEncodedThreadInfo } from '../../types/minimally-encoded-thread-permissions-types.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo, UserInfo } from '../../types/user-types.js';
import type { EntityText } from '../../utils/entity-text.js';
import { type ParserRules } from '../markdown.js';
export type MessageTitleParam<Info> = {
+messageInfo: Info,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+markdownRules: ParserRules,
};
@@ -35,7 +35,7 @@
};
export type CreateMessageInfoParams = {
- +threadInfos: { +[id: string]: ThreadInfo },
+ +threadInfos: { +[id: string]: LegacyThreadInfo },
+createMessageInfoFromRaw: (rawInfo: RawMessageInfo) => ?MessageInfo,
+createRelativeUserInfos: (
userIDs: $ReadOnlyArray<string>,
@@ -43,13 +43,13 @@
};
export type RobotextParams = {
- +threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
- +parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
};
export type NotificationTextsParams = {
+notifTargetUserInfo: UserInfo,
- +parentThreadInfo: ?ThreadInfo,
+ +parentThreadInfo: ?LegacyThreadInfo,
};
export type GeneratesNotifsParams = {
@@ -66,8 +66,8 @@
export type CreationSideEffectsFunc<RawInfo> = (
messageInfo: RawInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) => Promise<mixed>;
export type MessageSpec<Data, RawInfo, Info> = {
@@ -98,7 +98,7 @@
) => ?RawMessageInfo,
+notificationTexts?: (
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
params: NotificationTextsParams,
) => Promise<?NotifTexts>,
+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
@@ -42,7 +42,7 @@
import { getMediaMessageServerDBContentsFromMedia } from '../../types/messages/media.js';
import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { ET } from '../../utils/entity-text.js';
import {
@@ -311,7 +311,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -26,7 +26,7 @@
} from '../../types/messages/reaction.js';
import type { RawUnsupportedMessageInfo } from '../../types/messages/unsupported.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { ET } from '../../utils/entity-text.js';
import { threadIsGroupChat } from '../thread-utils.js';
@@ -163,7 +163,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -20,7 +20,7 @@
rawRemoveMembersMessageInfoValidator,
} from '../../types/messages/remove-members.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import {
ET,
@@ -125,7 +125,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
params: NotificationTextsParams,
): Promise<NotifTexts> {
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
@@ -16,7 +16,7 @@
rawRestoreEntryMessageInfoValidator,
} from '../../types/messages/restore-entry.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { prettyDate } from '../../utils/date-utils.js';
import { ET, type EntityText } from '../../utils/entity-text.js';
@@ -118,7 +118,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -28,7 +28,7 @@
import type { MinimallyEncodedThreadInfo } 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 { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { useDispatchActionPromise } from '../../utils/action-utils.js';
import { ET } from '../../utils/entity-text.js';
@@ -199,7 +199,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
params: NotificationTextsParams,
): Promise<?NotifTexts> {
// We special-case sidebarCreations. Usually we don't send any notifs in
@@ -295,8 +295,8 @@
const callChangeThreadSettings = useChangeThreadSettings();
return async (
messageInfo: RawTextMessageInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) => {
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
@@ -20,7 +20,7 @@
rawUpdateRelationshipMessageInfoValidator,
} from '../../types/messages/update-relationship.js';
import type { NotifTexts } from '../../types/notif-types.js';
-import type { ThreadInfo } from '../../types/thread-types.js';
+import type { LegacyThreadInfo } from '../../types/thread-types.js';
import type { RelativeUserInfo } from '../../types/user-types.js';
import { ET, type EntityText } from '../../utils/entity-text.js';
@@ -148,7 +148,7 @@
async notificationTexts(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): Promise<NotifTexts> {
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
@@ -20,7 +20,7 @@
import type { MinimallyEncodedThreadInfo } 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 ThreadInfo } from '../types/thread-types.js';
+import { type LegacyThreadInfo } from '../types/thread-types.js';
import type { RelativeUserInfo, UserInfo } from '../types/user-types.js';
import { prettyDate } from '../utils/date-utils.js';
import type { GetENSNames } from '../utils/ens-helpers.js';
@@ -35,8 +35,8 @@
async function notifTextsForMessageInfo(
messageInfos: MessageInfo[],
- threadInfo: ThreadInfo,
- parentThreadInfo: ?ThreadInfo,
+ threadInfo: LegacyThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo,
notifTargetUserInfo: UserInfo,
getENSNames: ?GetENSNames,
): Promise<?ResolvedNotifTexts> {
@@ -62,7 +62,7 @@
function notifTextsForEntryCreationOrEdit(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): NotifTexts {
const hasCreateEntry = messageInfos.some(
messageInfo => messageInfo.type === messageTypes.CREATE_ENTRY,
@@ -109,7 +109,7 @@
type NotifTextsForSubthreadCreationInput = {
+creator: RelativeUserInfo,
+threadType: ThreadType,
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+childThreadName: ?string,
+childThreadUIName: string | ThreadEntity,
};
@@ -151,7 +151,7 @@
+createSidebarMessageInfo: CreateSidebarMessageInfo,
+sidebarSourceMessageInfo?: ?SidebarSourceMessageInfo,
+firstSidebarMessageInfo?: ?TextMessageInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+params: NotificationTextsParams,
};
function notifTextsForSidebarCreation(
@@ -215,8 +215,8 @@
async function fullNotifTextsForMessageInfo(
messageInfos: $ReadOnlyArray<MessageInfo>,
- threadInfo: ThreadInfo,
- parentThreadInfo: ?ThreadInfo,
+ threadInfo: LegacyThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo,
notifTargetUserInfo: UserInfo,
getENSNames: ?GetENSNames,
): Promise<?ResolvedNotifTexts> {
@@ -266,8 +266,8 @@
function notifRobotextForMessageInfo(
messageInfo: RobotextMessageInfo,
- threadInfo: ThreadInfo,
- parentThreadInfo: ?ThreadInfo,
+ threadInfo: LegacyThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo,
): 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
@@ -14,7 +14,7 @@
} from '../types/message-types.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from '../types/thread-permission-types.js';
-import { type ThreadInfo } from '../types/thread-types.js';
+import { type LegacyThreadInfo } from '../types/thread-types.js';
import { useSelector } from '../utils/redux-utils.js';
function useViewerAlreadySelectedMessageReactions(
@@ -75,7 +75,7 @@
}
function useCanCreateReactionFromMessage(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -28,7 +28,7 @@
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';
-import { type ThreadInfo } from '../types/thread-types.js';
+import { type LegacyThreadInfo } from '../types/thread-types.js';
import type {
AccountUserInfo,
UserListItem,
@@ -59,8 +59,8 @@
+searchIndex: SearchIndex,
+excludeUserIDs: $ReadOnlyArray<string>,
+includeServerSearchUsers?: $ReadOnlyArray<GlobalAccountUserInfo>,
- +inputParentThreadInfo?: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
- +inputCommunityThreadInfo?: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +inputParentThreadInfo?: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +inputCommunityThreadInfo?: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+threadType?: ?ThreadType,
}): UserListItem[] {
const communityThreadInfo =
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
@@ -82,7 +82,7 @@
} from '../types/thread-types-enum.js';
import {
type LegacyRawThreadInfo,
- type ThreadInfo,
+ type LegacyThreadInfo,
type MemberInfo,
type ServerThreadInfo,
type ThreadCurrentUserInfo,
@@ -123,7 +123,7 @@
import { pendingThreadIDRegex } from '../utils/validation-utils.js';
function threadHasPermission(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
permission: ThreadPermission,
): boolean {
if (!threadInfo) {
@@ -141,7 +141,7 @@
}
function viewerIsMember(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return !!(
threadInfo &&
@@ -151,14 +151,14 @@
}
function threadIsInHome(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return !!(threadInfo && threadInfo.currentUser.subscription.home);
}
// Can have messages
function threadInChatList(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return (
viewerIsMember(threadInfo) &&
@@ -167,31 +167,31 @@
}
function threadIsTopLevel(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return threadInChatList(threadInfo) && threadIsChannel(threadInfo);
}
function threadIsChannel(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return !!(threadInfo && threadInfo.type !== threadTypes.SIDEBAR);
}
function threadIsSidebar(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return threadInfo?.type === threadTypes.SIDEBAR;
}
function threadInBackgroundChatList(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return threadInChatList(threadInfo) && !threadIsInHome(threadInfo);
}
function threadInHomeChatList(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return threadInChatList(threadInfo) && threadIsInHome(threadInfo);
}
@@ -199,7 +199,7 @@
// Can have Calendar entries,
// does appear as a top-level entity in the thread list
function threadInFilterList(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
): boolean {
return (
threadInChatList(threadInfo) &&
@@ -209,7 +209,7 @@
}
function userIsMember(
- threadInfo: ?(ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
+ threadInfo: ?(LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo),
userID: string,
): boolean {
if (!threadInfo) {
@@ -239,7 +239,7 @@
}
function threadMembersWithoutAddedAshoat<
- T: ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
+ T: LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
>(threadInfo: T): $PropertyType<T, 'members'> {
if (threadInfo.community !== genesis.id) {
return threadInfo.members;
@@ -250,13 +250,13 @@
}
function threadIsGroupChat(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): boolean {
return threadInfo.members.length > 2;
}
function threadOrParentThreadIsGroupChat(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
) {
return threadMembersWithoutAddedAshoat(threadInfo).length > 2;
}
@@ -270,7 +270,7 @@
}
function getSingleOtherUser(
- threadInfo: ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
viewerID: ?string,
): ?string {
if (!viewerID) {
@@ -332,7 +332,7 @@
+viewerID: string,
+threadType: ThreadType,
+members: $ReadOnlyArray<UserIDAndUsername>,
- +parentThreadInfo?: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +parentThreadInfo?: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+threadColor?: ?string,
+name?: ?string,
+sourceMessageID?: string,
@@ -346,7 +346,7 @@
threadColor,
name,
sourceMessageID,
-}: CreatePendingThreadArgs): ThreadInfo {
+}: CreatePendingThreadArgs): LegacyThreadInfo {
const now = Date.now();
if (!members.some(member => member.id === viewerID)) {
throw new Error(
@@ -417,7 +417,7 @@
}
type PendingPersonalThread = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+pendingPersonalThreadUserInfo: UserInfo,
};
@@ -477,7 +477,7 @@
// Returns map from user ID to AccountUserInfo
function extractMentionedMembers(
text: string,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): Map<string, AccountUserInfo> {
const memberMap = memberLowercaseUsernameMap(threadInfo.members);
const mentions = extractUserMentionsFromText(text);
@@ -496,8 +496,8 @@
// they will be automatically added to that sidebar
function extractNewMentionedParentMembers(
messageText: string,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): AccountUserInfo[] {
const mentionedMembersOfParent = extractMentionedMembers(
messageText,
@@ -513,7 +513,7 @@
type SharedCreatePendingSidebarInput = {
+sourceMessageInfo: ComposableMessageInfo | RobotextMessageInfo,
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+loggedInUserInfo: LoggedInUserInfo,
};
@@ -523,7 +523,7 @@
};
function baseCreatePendingSidebar(
input: BaseCreatePendingSidebarInput,
-): ThreadInfo {
+): LegacyThreadInfo {
const {
sourceMessageInfo,
parentThreadInfo,
@@ -599,7 +599,7 @@
};
function createUnresolvedPendingSidebar(
input: CreateUnresolvedPendingSidebarInput,
-): ThreadInfo {
+): LegacyThreadInfo {
const {
sourceMessageInfo,
parentThreadInfo,
@@ -632,7 +632,7 @@
};
async function createPendingSidebar(
input: CreatePendingSidebarInput,
-): Promise<ThreadInfo> {
+): Promise<LegacyThreadInfo> {
const {
sourceMessageInfo,
parentThreadInfo,
@@ -685,7 +685,7 @@
}
type CreateRealThreadParameters = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+dispatchActionPromise: DispatchActionPromise,
+createNewThread: ClientNewThreadRequest => Promise<NewThreadResult>,
+sourceMessageID: ?string,
@@ -871,7 +871,7 @@
}
function threadUIName(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): string | ThreadEntity {
if (threadInfo.name) {
return firstLine(threadInfo.name);
@@ -905,8 +905,8 @@
rawThreadInfo: LegacyRawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
-): ThreadInfo {
- let threadInfo: ThreadInfo = {
+): LegacyThreadInfo {
+ let threadInfo: LegacyThreadInfo = {
id: rawThreadInfo.id,
type: rawThreadInfo.type,
name: rawThreadInfo.name,
@@ -951,7 +951,7 @@
}
function getCurrentUser(
- threadInfo: LegacyRawThreadInfo | ThreadInfo,
+ threadInfo: LegacyRawThreadInfo | LegacyThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): ThreadCurrentUserInfo {
@@ -991,7 +991,7 @@
}
function threadIsWithBlockedUserOnly(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
checkOnlyViewerBlock?: boolean,
@@ -1023,7 +1023,7 @@
}
function threadFrozenDueToBlock(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
@@ -1031,7 +1031,7 @@
}
function threadFrozenDueToViewerBlock(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
@@ -1047,7 +1047,7 @@
function memberIsAdmin(
memberInfo: RelativeMemberInfo | MemberInfo,
- threadInfo: ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
): boolean {
return !!(
memberInfo.role && roleIsAdminRole(threadInfo.roles[memberInfo.role])
@@ -1072,7 +1072,7 @@
function threadHasAdminRole(
threadInfo: ?(
| RawThreadInfo
- | ThreadInfo
+ | LegacyThreadInfo
| ServerThreadInfo
| MinimallyEncodedThreadInfo
),
@@ -1084,7 +1084,7 @@
}
function threadOrParentThreadHasAdminRole(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
) {
return (
threadMembersWithoutAddedAshoat(threadInfo).filter(member =>
@@ -1185,7 +1185,9 @@
}
}
-function useWatchThread(threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo) {
+function useWatchThread(
+ threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+) {
const dispatchActionPromise = useDispatchActionPromise();
const callFetchMostRecentMessages = useFetchMostRecentMessages();
@@ -1218,10 +1220,10 @@
};
type ExistingThreadInfoFinder = (
params: ExistingThreadInfoFinderParams,
-) => ?ThreadInfo | ?MinimallyEncodedThreadInfo;
+) => ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo;
// TODO (atul): Parameterize function once `createPendingThread` is updated.
function useExistingThreadInfoFinder(
- baseThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ baseThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): ExistingThreadInfoFinder {
const threadInfos = useSelector(threadInfoSelector);
const loggedInUserInfo = useLoggedInUserInfo();
@@ -1233,7 +1235,7 @@
return React.useCallback(
(
params: ExistingThreadInfoFinderParams,
- ): ?ThreadInfo | ?MinimallyEncodedThreadInfo => {
+ ): ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo => {
if (!baseThreadInfo) {
return null;
}
@@ -1337,7 +1339,7 @@
threadInfo:
| ServerThreadInfo
| RawThreadInfo
- | ThreadInfo
+ | LegacyThreadInfo
| MinimallyEncodedThreadInfo,
memberID: string,
permission: ThreadPermission,
@@ -1355,7 +1357,7 @@
}
function useCanCreateSidebarFromMessage(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
messageInfo: ComposableMessageInfo | RobotextMessageInfo,
): boolean {
const messageCreatorUserInfo = useSelector(
@@ -1384,7 +1386,7 @@
}
function useSidebarExistsOrCanBeCreated(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
messageItem: ChatMessageInfoItem,
): boolean {
const canCreateSidebarFromMessage = useCanCreateSidebarFromMessage(
@@ -1395,7 +1397,7 @@
}
function checkIfDefaultMembersAreVoiced(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): boolean {
const defaultRoleID = Object.keys(threadInfo.roles).find(
roleID => threadInfo.roles[roleID].isDefault,
@@ -1422,7 +1424,7 @@
parentThreadInfo:
| ?ServerThreadInfo
| RawThreadInfo
- | ThreadInfo
+ | LegacyThreadInfo
| MinimallyEncodedThreadInfo,
threadType: ThreadType,
): ?string {
@@ -1442,7 +1444,7 @@
parentThreadInfo:
| ?ServerThreadInfo
| RawThreadInfo
- | ThreadInfo
+ | LegacyThreadInfo
| MinimallyEncodedThreadInfo,
): ?string {
if (!parentThreadInfo) {
@@ -1461,7 +1463,7 @@
function getThreadListSearchResults(
chatListData: $ReadOnlyArray<ChatThreadItem>,
searchText: string,
- threadFilter: ThreadInfo => boolean,
+ threadFilter: LegacyThreadInfo => boolean,
threadSearchResults: $ReadOnlySet<string>,
usersSearchResults: $ReadOnlyArray<GlobalAccountUserInfo>,
loggedInUserInfo: ?LoggedInUserInfo,
@@ -1549,7 +1551,7 @@
}
function removeMemberFromThread(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
memberInfo: RelativeMemberInfo,
dispatchActionPromise: DispatchActionPromise,
removeUserFromThreadServerCall: (
@@ -1568,7 +1570,7 @@
}
function switchMemberAdminRoleInThread(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
memberInfo: RelativeMemberInfo,
isCurrentlyAdmin: boolean,
dispatchActionPromise: DispatchActionPromise,
@@ -1601,7 +1603,7 @@
function getAvailableThreadMemberActions(
memberInfo: RelativeMemberInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
canEdit: ?boolean = true,
): $ReadOnlyArray<'change_role' | 'remove_user'> {
const role = memberInfo.role;
@@ -1636,11 +1638,11 @@
}
function patchThreadInfoToIncludeMentionedMembersOfParent(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
messageText: string,
viewerID: string,
-): ThreadInfo | MinimallyEncodedThreadInfo {
+): LegacyThreadInfo | MinimallyEncodedThreadInfo {
const members: UserIDAndUsername[] = threadInfo.members
.map(({ id, username }) =>
username ? ({ id, username }: UserIDAndUsername) : null,
@@ -1667,7 +1669,7 @@
}
function threadInfoInsideCommunity(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
communityID: string,
): boolean {
return threadInfo.community === communityID || threadInfo.id === communityID;
@@ -1678,7 +1680,7 @@
};
function useRoleMemberCountsForCommunity(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): RoleAndMemberCount {
return React.useMemo(() => {
const roleIDsToNames: { [string]: string } = {};
@@ -1715,7 +1717,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: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): RoleUserSurfacedPermissions {
return React.useMemo(() => {
const roleNamesToPermissions: { [string]: Set<UserSurfacedPermission> } =
@@ -1745,7 +1747,7 @@
}
function communityOrThreadNoun(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
): string {
return threadTypeIsCommunityRoot(threadInfo.type)
? 'community'
@@ -1753,7 +1755,7 @@
}
function getThreadsToDeleteText(
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
): string {
return `${
threadTypeIsCommunityRoot(threadInfo.type)
@@ -1788,13 +1790,13 @@
}
if (isViewerProfile) {
- const privateThreadInfo: ?ThreadInfo = privateThreadInfos[0];
+ const privateThreadInfo: ?LegacyThreadInfo = privateThreadInfos[0];
return privateThreadInfo ? { threadInfo: privateThreadInfo } : null;
}
if (usersWithPersonalThread.has(userID)) {
- const personalThreadInfo: ?ThreadInfo = personalThreadInfos.find(
+ const personalThreadInfo: ?LegacyThreadInfo = personalThreadInfos.find(
threadInfo =>
userID === getSingleOtherUser(threadInfo, loggedInUserInfo.id),
);
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
@@ -6,7 +6,7 @@
import type {
RawThreadInfo,
ServerThreadInfo,
- ThreadInfo,
+ LegacyThreadInfo,
} from '../types/thread-types.js';
import type { UserInfo } from '../types/user-types.js';
import { useSelector } from '../utils/redux-utils.js';
@@ -35,7 +35,7 @@
function useKeyserverAdmin(
community:
- | ThreadInfo
+ | LegacyThreadInfo
| RawThreadInfo
| ServerThreadInfo
| MinimallyEncodedThreadInfo,
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 { ThreadInfo } from '../thread-types.js';
+import type { LegacyThreadInfo } from '../thread-types.js';
import type { RelativeUserInfo } from '../user-types.js';
export type CreateSidebarMessageData = {
@@ -51,7 +51,7 @@
+sourceMessageAuthor: RelativeUserInfo,
+initialThreadState: {
+name: ?string,
- +parentThreadInfo: ThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo,
+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 { ThreadInfo } from '../thread-types.js';
+import type { LegacyThreadInfo } from '../thread-types.js';
import type { RelativeUserInfo } from '../user-types.js';
export type CreateSubthreadMessageData = {
@@ -36,5 +36,5 @@
threadID: string,
creator: RelativeUserInfo,
time: number,
- childThreadInfo: ThreadInfo,
+ childThreadInfo: LegacyThreadInfo,
};
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
@@ -11,7 +11,7 @@
} from '../../utils/validation-utils.js';
import { messageTypes } from '../message-types-enum.js';
import { threadTypes, type ThreadType } from '../thread-types-enum.js';
-import { type ThreadInfo } from '../thread-types.js';
+import { type LegacyThreadInfo } from '../thread-types.js';
import type { RelativeUserInfo } from '../user-types.js';
export type CreateThreadMessageData = {
@@ -58,7 +58,7 @@
initialThreadState: {
type: ThreadType,
name: ?string,
- parentThreadInfo: ?ThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo,
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
@@ -8,7 +8,7 @@
LegacyRelativeMemberInfo,
LegacyRoleInfo,
ThreadCurrentUserInfo,
- ThreadInfo,
+ LegacyThreadInfo,
} from './thread-types.js';
import {
decodeThreadRolePermissionsBitmaskArray,
@@ -156,7 +156,7 @@
};
export type MinimallyEncodedThreadInfo = $ReadOnly<{
- ...ThreadInfo,
+ ...LegacyThreadInfo,
+minimallyEncoded: true,
+members: $ReadOnlyArray<MinimallyEncodedRelativeMemberInfo>,
+roles: { +[id: string]: MinimallyEncodedRoleInfo },
@@ -164,7 +164,7 @@
}>;
const minimallyEncodeThreadInfo = (
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
): MinimallyEncodedThreadInfo => {
const { members, roles, currentUser, ...rest } = threadInfo;
return {
@@ -178,7 +178,7 @@
const decodeMinimallyEncodedThreadInfo = (
minimallyEncodedThreadInfo: MinimallyEncodedThreadInfo,
-): ThreadInfo => {
+): LegacyThreadInfo => {
const { minimallyEncoded, members, roles, currentUser, ...rest } =
minimallyEncodedThreadInfo;
return {
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
@@ -145,7 +145,7 @@
export type RawThreadInfo = LegacyRawThreadInfo | MinimallyEncodedRawThreadInfo;
-export type ThreadInfo = {
+export type LegacyThreadInfo = {
+id: string,
+type: ThreadType,
+name: ?string,
@@ -164,25 +164,26 @@
+repliesCount: number,
+pinnedCount?: number,
};
-export const threadInfoValidator: TInterface<ThreadInfo> = tShape<ThreadInfo>({
- id: tID,
- type: threadTypeValidator,
- name: t.maybe(t.String),
- uiName: t.union([t.String, threadEntityValidator]),
- avatar: t.maybe(clientAvatarValidator),
- description: t.maybe(t.String),
- color: t.String,
- creationTime: t.Number,
- parentThreadID: t.maybe(tID),
- containingThreadID: t.maybe(tID),
- community: t.maybe(tID),
- members: t.list(legacyRelativeMemberInfoValidator),
- roles: t.dict(tID, legacyRoleInfoValidator),
- currentUser: threadCurrentUserInfoValidator,
- sourceMessageID: t.maybe(tID),
- repliesCount: t.Number,
- pinnedCount: t.maybe(t.Number),
-});
+export const legacyThreadInfoValidator: TInterface<LegacyThreadInfo> =
+ tShape<LegacyThreadInfo>({
+ id: tID,
+ type: threadTypeValidator,
+ name: t.maybe(t.String),
+ uiName: t.union([t.String, threadEntityValidator]),
+ avatar: t.maybe(clientAvatarValidator),
+ description: t.maybe(t.String),
+ color: t.String,
+ creationTime: t.Number,
+ parentThreadID: t.maybe(tID),
+ containingThreadID: t.maybe(tID),
+ community: t.maybe(tID),
+ members: t.list(legacyRelativeMemberInfoValidator),
+ roles: t.dict(tID, legacyRoleInfoValidator),
+ currentUser: threadCurrentUserInfoValidator,
+ sourceMessageID: t.maybe(tID),
+ repliesCount: t.Number,
+ pinnedCount: t.maybe(t.Number),
+ });
export type ResolvedThreadInfo = {
+id: string,
@@ -404,7 +405,7 @@
};
export type SidebarInfo = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+lastUpdatedTime: number,
+mostRecentNonLocalMessage: ?string,
};
@@ -487,6 +488,6 @@
};
export type UserProfileThreadInfo = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+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
@@ -8,13 +8,13 @@
} from '../types/minimally-encoded-thread-permissions-types.js';
import { communitySubthreads } from '../types/thread-types-enum.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ResolvedThreadInfo,
RawThreadInfo,
} from '../types/thread-types.js';
type WritableCommunityDrawerItemData<T> = {
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
itemChildren: $ReadOnlyArray<CommunityDrawerItemData<T>>,
hasSubchannelsButton: boolean,
labelStyle: T,
@@ -25,7 +25,9 @@
function createRecursiveDrawerItemsData<LabelStyleType>(
childThreadInfosMap: {
- +[id: string]: $ReadOnlyArray<ThreadInfo | MinimallyEncodedThreadInfo>,
+ +[id: string]: $ReadOnlyArray<
+ LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ >,
},
communities: $ReadOnlyArray<
ResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
@@ -66,7 +68,7 @@
return result;
}
-function threadHasSubchannels<T: ThreadInfo | MinimallyEncodedThreadInfo>(
+function threadHasSubchannels<T: LegacyThreadInfo | MinimallyEncodedThreadInfo>(
threadInfo: T,
childThreadInfosMap: {
+[id: string]: $ReadOnlyArray<T>,
@@ -106,7 +108,10 @@
function filterThreadIDsBelongingToCommunity(
communityID: string,
threadInfosObj: {
- +[id: string]: ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
+ +[id: string]:
+ | LegacyThreadInfo
+ | RawThreadInfo
+ | MinimallyEncodedThreadInfo,
},
): $ReadOnlySet<string> {
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
@@ -13,11 +13,14 @@
MinimallyEncodedResolvedThreadInfo,
MinimallyEncodedThreadInfo,
} from '../types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo, ResolvedThreadInfo } from '../types/thread-types.js';
+import type {
+ LegacyThreadInfo,
+ ResolvedThreadInfo,
+} from '../types/thread-types.js';
import { values } from '../utils/objects.js';
function useResolvedThreadInfos(
- threadInfos: $ReadOnlyArray<ThreadInfo | MinimallyEncodedThreadInfo>,
+ threadInfos: $ReadOnlyArray<LegacyThreadInfo | MinimallyEncodedThreadInfo>,
options?: ?UseENSNamesOptions,
): $ReadOnlyArray<ResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo> {
const entityText = React.useMemo(
@@ -56,7 +59,7 @@
}
function useResolvedOptionalThreadInfos(
- threadInfos: ?$ReadOnlyArray<ThreadInfo>,
+ threadInfos: ?$ReadOnlyArray<LegacyThreadInfo>,
): ?$ReadOnlyArray<ResolvedThreadInfo> {
const entityText = React.useMemo(() => {
if (!threadInfos) {
@@ -91,7 +94,7 @@
}
function useResolvedThreadInfosObj(
- threadInfosObj: { +[id: string]: ThreadInfo },
+ threadInfosObj: { +[id: string]: LegacyThreadInfo },
options?: ?UseENSNamesOptions,
): { +[id: string]: ResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo } {
const threadInfosArray = React.useMemo(
@@ -114,7 +117,7 @@
}
function useResolvedThreadInfo(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): ResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo {
const resolutionInput = React.useMemo(() => [threadInfo], [threadInfo]);
const [resolvedThreadInfo] = useResolvedThreadInfos(resolutionInput);
@@ -122,7 +125,7 @@
}
function useResolvedOptionalThreadInfo(
- threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): ?ResolvedThreadInfo | ?MinimallyEncodedResolvedThreadInfo {
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
@@ -15,7 +15,7 @@
threadTypes,
threadTypeValidator,
} from '../types/thread-types-enum.js';
-import type { ThreadInfo, RawThreadInfo } from '../types/thread-types.js';
+import type { LegacyThreadInfo, RawThreadInfo } from '../types/thread-types.js';
import { basePluralize } from '../utils/text-utils.js';
export type UserEntity = {
@@ -135,17 +135,23 @@
type EntityTextThreadInput =
| {
+display: 'uiName',
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
}
| {
+display?: 'shortName',
- +threadInfo: ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo:
+ | LegacyThreadInfo
+ | RawThreadInfo
+ | MinimallyEncodedThreadInfo,
+subchannel?: ?boolean,
+possessive?: ?boolean,
}
| {
+display: 'alwaysDisplayShortName',
- +threadInfo: ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo:
+ | LegacyThreadInfo
+ | RawThreadInfo
+ | MinimallyEncodedThreadInfo,
+possessive?: ?boolean,
}
| {
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
@@ -11,7 +11,7 @@
type UserSurfacedPermission,
} from '../types/thread-permission-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
RoleInfo,
RelativeMemberInfo,
} from '../types/thread-types';
@@ -57,7 +57,7 @@
}
function useRolesFromCommunityThreadInfo(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
memberInfos: $ReadOnlyArray<RelativeMemberInfo>,
): $ReadOnlyMap<string, ?RoleInfo> {
// Our in-code system has chat-specific roles, while the
diff --git a/lib/utils/toggle-pin-utils.js b/lib/utils/toggle-pin-utils.js
--- a/lib/utils/toggle-pin-utils.js
+++ b/lib/utils/toggle-pin-utils.js
@@ -5,11 +5,11 @@
import type { RawMessageInfo, MessageInfo } from '../types/message-types.js';
import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from '../types/thread-permission-types.js';
-import type { RawThreadInfo, ThreadInfo } from '../types/thread-types.js';
+import type { RawThreadInfo, LegacyThreadInfo } from '../types/thread-types.js';
function canToggleMessagePin(
messageInfo: RawMessageInfo | MessageInfo,
- threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
): boolean {
const isValidMessage = !isInvalidPinSourceForThread(messageInfo, threadInfo);
const hasManagePinsPermission = threadHasPermission(
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,10 @@
import { EditThreadAvatarContext } from 'lib/components/base-edit-thread-avatar-provider.react.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ RawThreadInfo,
+ LegacyThreadInfo,
+} from 'lib/types/thread-types.js';
import {
useNativeSetThreadAvatar,
@@ -23,7 +26,7 @@
import { useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -14,7 +14,7 @@
} from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ResolvedThreadInfo,
RawThreadInfo,
} from 'lib/types/thread-types.js';
@@ -25,7 +25,7 @@
type Props = {
+threadInfo:
| RawThreadInfo
- | ThreadInfo
+ | LegacyThreadInfo
| ResolvedThreadInfo
| MinimallyEncodedThreadInfo
| MinimallyEncodedResolvedThreadInfo,
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
@@ -36,7 +36,7 @@
import type { CalendarFilter } from 'lib/types/filter-types.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
import type { ConnectionStatus } from 'lib/types/socket-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
useDispatchActionPromise,
type DispatchActionPromise,
@@ -114,7 +114,7 @@
| {
itemType: 'entryInfo',
entryInfo: EntryInfoWithHeight,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
};
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
@@ -46,7 +46,7 @@
import type { Dispatch } from 'lib/types/redux-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type ResolvedThreadInfo,
} from 'lib/types/thread-types.js';
import {
@@ -191,7 +191,7 @@
};
type BaseProps = {
...SharedProps,
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
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
@@ -3,7 +3,7 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { ChatContext } from './chat-context.js';
import type { SidebarAnimationType } from './chat-context.js';
@@ -17,7 +17,7 @@
export type MeasurementTask = {
+messages: $ReadOnlyArray<NativeChatMessageItem>,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+onMessagesMeasured: (
messagesWithHeight: $ReadOnlyArray<ChatMessageItemWithHeight>,
measuredHeights: $ReadOnlyMap<string, number>,
@@ -38,7 +38,7 @@
const measureMessages = React.useCallback(
(
messages: ?$ReadOnlyArray<NativeChatMessageItem>,
- threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
onMessagesMeasured: ($ReadOnlyArray<ChatMessageItemWithHeight>) => mixed,
measurerID: number,
) => {
@@ -94,7 +94,7 @@
return {
measure: (
messages: ?$ReadOnlyArray<NativeChatMessageItem>,
- threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
onMessagesMeasured: (
$ReadOnlyArray<ChatMessageItemWithHeight>,
) => 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
@@ -5,14 +5,14 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { NativeChatMessageItem } from './message-data.react.js';
import type { ChatMessageItemWithHeight } from '../types/chat-types.js';
export type MessagesMeasurer = (
?$ReadOnlyArray<NativeChatMessageItem>,
- ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
($ReadOnlyArray<ChatMessageItemWithHeight>) => 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
@@ -75,7 +75,7 @@
import type { Dispatch } from 'lib/types/redux-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ClientThreadJoinRequest,
ThreadJoinPayload,
ChatMentionCandidates,
@@ -274,7 +274,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
type Props = {
...BaseProps,
@@ -299,7 +299,7 @@
+userMentionsCandidates: $ReadOnlyArray<RelativeMemberInfo>,
+chatMentionSearchIndex: SentencePrefixSearchIndex,
+chatMentionCandidates: ChatMentionCandidates,
- +parentThreadInfo: ?ThreadInfo,
+ +parentThreadInfo: ?LegacyThreadInfo,
+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
@@ -12,7 +12,7 @@
import { StackRouter, CommonActions } from '@react-navigation/native';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { createNavigateToThreadAction } from './message-list-types.js';
import {
@@ -40,7 +40,7 @@
type ReplaceWithThreadAction = {
+type: 'REPLACE_WITH_THREAD',
+payload: {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
},
};
type ClearThreadsAction = {
@@ -52,7 +52,7 @@
type PushNewThreadAction = {
+type: 'PUSH_NEW_THREAD',
+payload: {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
},
};
export type ChatRouterNavigationAction =
@@ -65,10 +65,12 @@
export type ChatRouterNavigationHelpers = {
+clearScreens: (routeNames: $ReadOnlyArray<string>) => void,
+replaceWithThread: (
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => void,
+clearThreads: (threadIDs: $ReadOnlyArray<string>) => void,
- +pushNewThread: (threadInfo: ThreadInfo | MinimallyEncodedThreadInfo) => void,
+ +pushNewThread: (
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ ) => void,
};
function ChatRouter(
@@ -162,7 +164,7 @@
routeNames,
},
}),
- replaceWithThread: (threadInfo: ThreadInfo) =>
+ replaceWithThread: (threadInfo: LegacyThreadInfo) =>
({
type: replaceWithThreadActionType,
payload: { threadInfo },
@@ -171,7 +173,7 @@
type: clearThreadsActionType,
payload: { threadIDs },
}),
- pushNewThread: (threadInfo: ThreadInfo) =>
+ pushNewThread: (threadInfo: LegacyThreadInfo) =>
({
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 { ThreadInfo } from 'lib/types/thread-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';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
@@ -23,11 +23,11 @@
type Props = {
+data: ChatThreadItem,
+onPressItem: (
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
pendingPersonalThreadUserInfo?: UserInfo,
) => void,
- +onPressSeeMoreSidebars: (threadInfo: ThreadInfo) => void,
- +onSwipeableWillOpen: (threadInfo: ThreadInfo) => void,
+ +onPressSeeMoreSidebars: (threadInfo: LegacyThreadInfo) => void,
+ +onSwipeableWillOpen: (threadInfo: LegacyThreadInfo) => 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,16 +4,16 @@
import * as React from 'react';
import { Text } from 'react-native';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { sidebarHeight } from './sidebar-item.react.js';
import Button from '../components/button.react.js';
import { useColors, useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+unread: boolean,
- +onPress: (threadInfo: ThreadInfo) => void,
+ +onPress: (threadInfo: LegacyThreadInfo) => 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 { ThreadInfo, SidebarInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, SidebarInfo } from 'lib/types/thread-types.js';
import { SidebarItem, sidebarHeight } from './sidebar-item.react.js';
import SwipeableThread from './swipeable-thread.react.js';
@@ -15,8 +15,8 @@
type Props = {
+sidebarInfo: SidebarInfo,
- +onPressItem: (threadInfo: ThreadInfo) => void,
- +onSwipeableWillOpen: (threadInfo: ThreadInfo) => void,
+ +onPressItem: (threadInfo: LegacyThreadInfo) => void,
+ +onSwipeableWillOpen: (threadInfo: LegacyThreadInfo) => 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
@@ -33,7 +33,7 @@
} from 'lib/shared/thread-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types.js';
import { ChatThreadListItem } from './chat-thread-list-item.react.js';
@@ -78,7 +78,7 @@
| NavigationRoute<'HomeChatThreadList'>
| NavigationRoute<'BackgroundChatThreadList'>,
+filterThreads: (
- threadItem: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadItem: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => boolean,
+emptyItem?: React.ComponentType<{}>,
};
@@ -129,7 +129,7 @@
);
const onSwipeableWillOpen = React.useCallback(
- (threadInfo: ThreadInfo) => setOpenedSwipeableID(threadInfo.id),
+ (threadInfo: LegacyThreadInfo) => setOpenedSwipeableID(threadInfo.id),
[],
);
@@ -178,7 +178,10 @@
const searchInputRef = React.useRef<?React.ElementRef<typeof TextInput>>();
const onPressItem = React.useCallback(
- (threadInfo: ThreadInfo, pendingPersonalThreadUserInfo?: UserInfo) => {
+ (
+ threadInfo: LegacyThreadInfo,
+ pendingPersonalThreadUserInfo?: UserInfo,
+ ) => {
onChangeSearchText('');
if (searchInputRef.current) {
searchInputRef.current.blur();
@@ -189,7 +192,7 @@
);
const onPressSeeMoreSidebars = React.useCallback(
- (threadInfo: ThreadInfo) => {
+ (threadInfo: LegacyThreadInfo) => {
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
@@ -21,7 +21,7 @@
import { threadInFilterList, userIsMember } from 'lib/shared/thread-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { type ThreadType, threadTypes } from 'lib/types/thread-types-enum.js';
-import { type ThreadInfo } from 'lib/types/thread-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/action-utils.js';
@@ -53,7 +53,7 @@
export type ComposeSubchannelParams = {
+threadType: ThreadType,
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
type Props = {
@@ -223,25 +223,28 @@
],
);
- const existingThreads: $ReadOnlyArray<ThreadInfo> = React.useMemo(() => {
- if (userInfoInputIDs.length === 0) {
- return [];
- }
- return _flow(
- _filter(
- (threadInfo: ThreadInfo) =>
- threadInFilterList(threadInfo) &&
- threadInfo.parentThreadID === parentThreadInfo.id &&
- userInfoInputIDs.every(userID => userIsMember(threadInfo, userID)),
- ),
- _sortBy(
- ([
- 'members.length',
- (threadInfo: ThreadInfo) => (threadInfo.name ? 1 : 0),
- ]: $ReadOnlyArray<string | ((threadInfo: ThreadInfo) => mixed)>),
- ),
- )(threadInfos);
- }, [userInfoInputIDs, threadInfos, parentThreadInfo]);
+ const existingThreads: $ReadOnlyArray<LegacyThreadInfo> =
+ React.useMemo(() => {
+ if (userInfoInputIDs.length === 0) {
+ return [];
+ }
+ return _flow(
+ _filter(
+ (threadInfo: LegacyThreadInfo) =>
+ threadInFilterList(threadInfo) &&
+ threadInfo.parentThreadID === parentThreadInfo.id &&
+ userInfoInputIDs.every(userID => userIsMember(threadInfo, userID)),
+ ),
+ _sortBy(
+ ([
+ 'members.length',
+ (threadInfo: LegacyThreadInfo) => (threadInfo.name ? 1 : 0),
+ ]: $ReadOnlyArray<
+ string | ((threadInfo: LegacyThreadInfo) => 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 { assertComposableRawMessage } from 'lib/types/message-types.js';
import type { RawComposableMessageInfo } from 'lib/types/message-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { multimediaMessageSendFailed } from './multimedia-message-utils.js';
import textMessageSendFailed from './text-message-send-failed.js';
@@ -46,7 +46,7 @@
+rawMessageInfo: ?RawComposableMessageInfo,
+styles: $ReadOnly<typeof unboundStyles>,
+inputState: ?InputState,
- +parentThreadInfo: ?ThreadInfo,
+ +parentThreadInfo: ?LegacyThreadInfo,
};
class FailedSend extends React.PureComponent<Props> {
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
@@ -4,7 +4,7 @@
import { Text, View, TouchableOpacity } from 'react-native';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { ChatNavigationProp } from './chat.react.js';
import ThreadSettingsMediaGallery from './settings/thread-settings-media-gallery.react.js';
@@ -13,7 +13,7 @@
import type { VerticalBounds } from '../types/layout-types.js';
export type FullScreenThreadMediaGalleryParams = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -7,7 +7,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import sleep from 'lib/utils/sleep.js';
import Modal from '../components/modal.react.js';
@@ -18,7 +18,7 @@
export type ImagePasteModalParams = {
+imagePasteStagingInfo: PhotoPaste,
- +thread: ThreadInfo | MinimallyEncodedThreadInfo,
+ +thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -14,7 +14,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
inlineEngagementLabelStyle,
@@ -33,7 +33,7 @@
import type { ChatMessageInfoItemWithHeight } from '../types/chat-types.js';
function dummyNodeForInlineEngagementHeightMeasurement(
- sidebarInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
reactions: ReactionInfo,
): React.Element<typeof View> {
return (
@@ -49,7 +49,7 @@
type DummyInlineEngagementNodeProps = {
...React.ElementConfig<typeof View>,
+editedLabel?: ?string,
- +sidebarInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+reactions: ReactionInfo,
};
function DummyInlineEngagementNode(
@@ -129,8 +129,8 @@
type Props = {
+messageInfo: MessageInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- +sidebarThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +sidebarThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+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
@@ -7,7 +7,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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
entityTextToReact,
entityTextToRawString,
@@ -27,7 +27,7 @@
function dummyNodeForRobotextMessageHeightMeasurement(
robotext: EntityText,
threadID: string,
- sidebarInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
reactions: ReactionInfo,
): React.Element<typeof View> {
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
@@ -7,7 +7,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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useComposedMessageMaxWidth } from './composed-message-width.js';
import { DummyInlineEngagementNode } from './inline-engagement.react.js';
@@ -34,7 +34,7 @@
function dummyNodeForTextMessageHeightMeasurement(
text: string,
editedLabel?: ?string,
- sidebarInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
reactions: ReactionInfo,
): React.Element<typeof View> {
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
@@ -21,7 +21,7 @@
pendingThreadType,
} from 'lib/shared/thread-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { AccountUserInfo, UserListItem } from 'lib/types/user-types.js';
import { type MessagesMeasurer, useHeightMeasurer } from './chat-context.js';
@@ -89,8 +89,8 @@
+updateTagInput: (items: $ReadOnlyArray<AccountUserInfo>) => void,
+resolveToUser: (user: AccountUserInfo) => void,
+userSearchResults: $ReadOnlyArray<UserListItem>,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- +genesisThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +genesisThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+messageListData: ?$ReadOnlyArray<NativeChatMessageItem>,
+colors: Colors,
+styles: $ReadOnly<typeof unboundStyles>,
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
@@ -6,7 +6,7 @@
import { View } from 'react-native';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-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: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+navigate: $PropertyType<ChatNavigationProp<'MessageList'>, '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
@@ -7,7 +7,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { type UserInfo } from 'lib/types/user-types.js';
import { ChatContext } from './chat-context.js';
@@ -20,7 +20,7 @@
} from '../navigation/route-names.js';
export type MessageListParams = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+pendingPersonalThreadUserInfo?: UserInfo,
+searching?: boolean,
+removeEditMode?: ?RemoveEditMode,
@@ -38,7 +38,7 @@
React.createContext<?MessageListContextType>();
function useMessageListContext(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) {
const chatMentionCandidates = useThreadChatMentionCandidates(threadInfo);
const getTextMessageMarkdownRules = useTextMessageRulesFunc(
@@ -55,7 +55,7 @@
type Props = {
+children: React.Node,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
function MessageListContextProvider(props: Props): React.Node {
const context = useMessageListContext(props.threadInfo);
@@ -98,7 +98,7 @@
}
function useNavigateToThreadWithFadeAnimation(
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
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
@@ -21,7 +21,7 @@
import type { FetchMessageInfosPayload } from 'lib/types/message-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
useDispatchActionPromise,
@@ -69,7 +69,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+messageListData: $ReadOnlyArray<ChatMessageItemWithHeight>,
+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 ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import SingleLine from '../components/single-line.react.js';
import { getDefaultTextMessageRules } from '../markdown/rules.react.js';
@@ -15,7 +15,7 @@
type Props = {
+messageInfo: MessageInfo,
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
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
@@ -5,7 +5,7 @@
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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { longAbsoluteDate } from 'lib/utils/date-utils.js';
import { type ChatNavigationProp } from './chat.react.js';
@@ -20,7 +20,7 @@
type MessageResultProps = {
+item: ChatMessageInfoItemWithHeight,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -16,7 +16,7 @@
} 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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useHeightMeasurer } from './chat-context.js';
import type { ChatNavigationProp } from './chat.react';
@@ -29,7 +29,7 @@
import type { VerticalBounds } from '../types/layout-types.js';
export type MessageResultsScreenParams = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -6,7 +6,7 @@
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { ThreadType } from 'lib/types/thread-types-enum.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useNavigateToThread } from './message-list-types.js';
import Button from '../components/button.react.js';
@@ -15,7 +15,7 @@
import { useColors, useStyles } from '../themes/colors.js';
type Props = {
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -7,7 +7,7 @@
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types.js';
import Button from '../components/button.react.js';
@@ -16,7 +16,7 @@
type Props = {
+pendingPersonalThreadUserInfo: ?UserInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
const RelationshipPrompt: React.ComponentType<Props> = React.memo<Props>(
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
@@ -17,7 +17,7 @@
import { getPotentialMemberItems } 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/thread-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/action-utils.js';
@@ -46,7 +46,7 @@
export type AddUsersModalParams = {
+presentedFrom: string,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -10,7 +10,7 @@
} from 'lib/actions/thread-actions.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type ChangeThreadSettingsPayload,
type UpdateThreadRequest,
} from 'lib/types/thread-types.js';
@@ -28,7 +28,7 @@
export type ColorSelectorModalParams = {
+presentedFrom: string,
+color: string,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -7,7 +7,7 @@
import { threadTypeDescriptions } from 'lib/shared/thread-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import Button from '../../components/button.react.js';
import Modal from '../../components/modal.react.js';
@@ -19,7 +19,7 @@
export type ComposeSubchannelModalParams = {
+presentedFrom: string,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -30,7 +30,7 @@
MinimallyEncodedThreadInfo,
} from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ResolvedThreadInfo,
LeaveThreadPayload,
} from 'lib/types/thread-types.js';
@@ -53,7 +53,7 @@
import type { ChatNavigationProp } from '../chat.react.js';
export type DeleteThreadParams = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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,10 @@
import { savedEmojiAvatarSelectorForThread } from 'lib/selectors/thread-selectors.js';
import type { UpdateUserAvatarRequest } from 'lib/types/avatar-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ RawThreadInfo,
+ LegacyThreadInfo,
+} from 'lib/types/thread-types.js';
import { useNativeSetThreadAvatar } from '../../avatars/avatar-hooks.js';
import EmojiAvatarCreation from '../../avatars/emoji-avatar-creation.react.js';
@@ -17,7 +20,7 @@
import { useSelector } from '../../redux/redux-utils.js';
export type EmojiThreadAvatarCreationParams = {
- +threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -4,7 +4,7 @@
import { View, Platform } from 'react-native';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import ThreadAvatar from '../../avatars/thread-avatar.react.js';
import Button from '../../components/button.react.js';
@@ -14,7 +14,7 @@
import { useNavigateToThread } from '../message-list-types.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -7,7 +7,7 @@
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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { ThreadSettingsNavigate } from './thread-settings.react.js';
import ColorSplotch from '../../components/color-splotch.react.js';
@@ -39,7 +39,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -19,7 +19,7 @@
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type ChangeThreadSettingsPayload,
type UpdateThreadRequest,
} from 'lib/types/thread-types.js';
@@ -88,7 +88,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -19,7 +19,7 @@
type RelationshipAction,
type RelationshipButton,
} from 'lib/types/relationship-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
useDispatchActionPromise,
useServerCall,
@@ -32,7 +32,7 @@
import Alert from '../../utils/alert.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -12,7 +12,7 @@
SubscriptionUpdateRequest,
SubscriptionUpdateResult,
} from 'lib/types/subscription-types.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { DispatchActionPromise } from 'lib/utils/action-utils.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
@@ -42,7 +42,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -14,7 +14,10 @@
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, LeaveThreadPayload } from 'lib/types/thread-types.js';
+import type {
+ LegacyThreadInfo,
+ LeaveThreadPayload,
+} from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
useDispatchActionPromise,
@@ -49,7 +52,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -6,7 +6,10 @@
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, RelativeMemberInfo } from 'lib/types/thread-types.js';
+import type {
+ LegacyThreadInfo,
+ RelativeMemberInfo,
+} from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import ThreadSettingsMemberTooltipButton from './thread-settings-member-tooltip-button.react.js';
@@ -23,7 +26,7 @@
export type ThreadSettingsMemberTooltipModalParams = TooltipParams<{
+memberInfo: RelativeMemberInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
}>;
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
@@ -21,7 +21,7 @@
import type { LoadingStatus } from 'lib/types/loading-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type RelativeMemberInfo,
} from 'lib/types/thread-types.js';
import { useRolesFromCommunityThreadInfo } from 'lib/utils/role-utils.js';
@@ -91,7 +91,7 @@
type BaseProps = {
+memberInfo: RelativeMemberInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -4,7 +4,7 @@
import { Text, View } from 'react-native';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import ThreadAvatar from '../../avatars/thread-avatar.react.js';
import Button from '../../components/button.react.js';
@@ -13,7 +13,7 @@
import { useNavigateToThread } from '../message-list-types.js';
type ParentButtonProps = {
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
function ParentButton(props: ParentButtonProps): React.Node {
const styles = useStyles(unboundStyles);
@@ -35,8 +35,8 @@
}
type ThreadSettingsParentProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- +parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
};
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
@@ -6,7 +6,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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import Button from '../../components/button.react.js';
import { type Colors, useColors, useStyles } from '../../themes/colors.js';
@@ -31,7 +31,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -14,7 +14,7 @@
SubscriptionUpdateRequest,
SubscriptionUpdateResult,
} from 'lib/types/subscription-types.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { DispatchActionPromise } from 'lib/utils/action-utils.js';
import {
useDispatchActionPromise,
@@ -54,7 +54,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -4,13 +4,13 @@
import { Text, View } from 'react-native';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import ThreadVisibility from '../../components/thread-visibility.react.js';
import { useStyles, useColors } from '../../themes/colors.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -41,7 +41,7 @@
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type ResolvedThreadInfo,
type RelativeMemberInfo,
} from 'lib/types/thread-types.js';
@@ -110,7 +110,7 @@
const itemPageLength = 5;
export type ThreadSettingsParams = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
export type ThreadSettingsNavigate = $PropertyType<
@@ -225,7 +225,7 @@
| {
+itemType: 'mediaGallery',
+key: string,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+limit: number,
+verticalBounds: ?VerticalBounds,
}
@@ -711,7 +711,7 @@
(propsAndState: PropsAndState) => propsAndState.threadInfo,
(propsAndState: PropsAndState) => propsAndState.verticalBounds,
(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
verticalBounds: ?VerticalBounds,
) => {
const listData: ChatSettingsItem[] = [];
@@ -1169,7 +1169,7 @@
);
const threadID = props.route.params.threadInfo.id;
- const reduxThreadInfo: ?ThreadInfo = useSelector(
+ const reduxThreadInfo: ?LegacyThreadInfo = useSelector(
state => threadInfoSelector(state)[threadID],
);
React.useEffect(() => {
@@ -1186,7 +1186,7 @@
setParams({ threadInfo: reduxThreadInfo });
}
}, [reduxThreadInfo, setParams]);
- const threadInfo: ThreadInfo | MinimallyEncodedThreadInfo =
+ const threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo =
reduxThreadInfo ?? props.route.params.threadInfo;
const resolvedThreadInfo = useResolvedThreadInfo(threadInfo);
@@ -1201,7 +1201,7 @@
}, [threadInfo]);
const parentThreadID = threadInfo.parentThreadID;
- const parentThreadInfo: ?ThreadInfo = useSelector(state =>
+ const parentThreadInfo: ?LegacyThreadInfo = useSelector(state =>
parentThreadID ? threadInfoSelector(state)[parentThreadID] : null,
);
const resolvedParentThreadInfo =
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 { ThreadInfo, SidebarInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, SidebarInfo } from 'lib/types/thread-types.js';
import { SidebarItem } from './sidebar-item.react.js';
import ThreadListModal from './thread-list-modal.react.js';
@@ -16,7 +16,7 @@
import Arrow from '../vectors/arrow.react.js';
export type SidebarListModalParams = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
type Props = {
@@ -30,7 +30,7 @@
const numOfSidebarsWithExtendedArrow = listData.length - 1;
const createRenderItem = React.useCallback(
- (onPressItem: (threadInfo: ThreadInfo) => void) =>
+ (onPressItem: (threadInfo: LegacyThreadInfo) => void) =>
// eslint-disable-next-line react/display-name
(row: { +item: SidebarInfo, +index: number, ... }) => {
let extendArrow: boolean = false;
@@ -64,7 +64,7 @@
function Item(props: {
item: SidebarInfo,
- onPressItem: (threadInfo: ThreadInfo) => void,
+ onPressItem: (threadInfo: LegacyThreadInfo) => 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
@@ -12,7 +12,7 @@
} from 'lib/shared/thread-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ChatMentionCandidates,
} from 'lib/types/thread-types.js';
import type { LoggedInUserInfo } from 'lib/types/user-types.js';
@@ -30,7 +30,7 @@
};
function getUnresolvedSidebarThreadInfo(
input: GetUnresolvedSidebarThreadInfoInput,
-): ?ThreadInfo | ?MinimallyEncodedThreadInfo {
+): ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo {
const { sourceMessage, loggedInUserInfo, chatMentionCandidates } = input;
const threadCreatedFromMessage = sourceMessage.threadCreatedFromMessage;
if (threadCreatedFromMessage) {
@@ -57,7 +57,7 @@
};
async function getSidebarThreadInfo(
input: GetSidebarThreadInfoInput,
-): Promise<?ThreadInfo | ?MinimallyEncodedThreadInfo> {
+): Promise<?LegacyThreadInfo | ?MinimallyEncodedThreadInfo> {
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 ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import SubchannelItem from './subchannel-item.react.js';
import ThreadListModal from './thread-list-modal.react.js';
@@ -15,7 +15,7 @@
import { useColors, useStyles } from '../themes/colors.js';
export type SubchannelListModalParams = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
type Props = {
@@ -41,14 +41,14 @@
}
const createRenderItem =
- (onPressItem: (threadInfo: ThreadInfo) => void) =>
+ (onPressItem: (threadInfo: LegacyThreadInfo) => void) =>
// eslint-disable-next-line react/display-name
(row: { +item: ChatThreadItem, +index: number, ... }) => {
return <Item subchannelInfo={row.item} onPressItem={onPressItem} />;
};
function Item(props: {
- onPressItem: (threadInfo: ThreadInfo) => void,
+ onPressItem: (threadInfo: LegacyThreadInfo) => 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,14 +7,14 @@
import SwipeableComponent from 'react-native-gesture-handler/Swipeable';
import useToggleUnreadStatus from 'lib/hooks/toggle-unread-status.js';
-import type { ThreadInfo } from 'lib/types/thread-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: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+mostRecentNonLocalMessage: ?string,
- +onSwipeableWillOpen: (threadInfo: ThreadInfo) => void,
+ +onSwipeableWillOpen: (threadInfo: LegacyThreadInfo) => 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 { ThreadInfo, SidebarInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, SidebarInfo } from 'lib/types/thread-types.js';
import { useNavigateToThread } from './message-list-types.js';
import Modal from '../components/modal.react.js';
@@ -34,8 +34,10 @@
}
type Props<U> = {
- +threadInfo: ThreadInfo,
- +createRenderItem: (onPressItem: (threadInfo: ThreadInfo) => void) => (row: {
+ +threadInfo: LegacyThreadInfo,
+ +createRenderItem: (
+ onPressItem: (threadInfo: LegacyThreadInfo) => void,
+ ) => (row: {
+item: U,
+index: number,
...
@@ -79,7 +81,7 @@
const navigateToThread = useNavigateToThread();
const onPressItem = React.useCallback(
- (threadInfo: ThreadInfo) => {
+ (threadInfo: LegacyThreadInfo) => {
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
@@ -3,7 +3,7 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { ChatNavigationProp } from './chat.react.js';
import Button from '../components/button.react.js';
@@ -19,7 +19,7 @@
};
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+navigate: $PropertyType<ChatNavigationProp<'MessageList'>, '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
@@ -5,12 +5,12 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-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: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
...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 @@
toggleMessagePinActionTypes,
} from 'lib/actions/message-actions.js';
import type { RawMessageInfo } from 'lib/types/message-types.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import MessageResult from './message-result.react.js';
@@ -22,7 +22,7 @@
export type TogglePinModalParams = {
+item: ChatMessageInfoItemWithHeight,
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
type TogglePinModalProps = {
diff --git a/native/chat/utils.js b/native/chat/utils.js
--- a/native/chat/utils.js
+++ b/native/chat/utils.js
@@ -10,7 +10,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { clusterEndHeight } from './chat-constants.js';
import { ChatContext, useHeightMeasurer } from './chat-context.js';
@@ -103,7 +103,7 @@
messageListVerticalBounds: VerticalBounds,
currentInputBarHeight: number,
targetInputBarHeight: number,
- sidebarThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): {
+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
@@ -10,7 +10,7 @@
import { threadHasPermission } from 'lib/shared/thread-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import SWMansionIcon from './swmansion-icon.react.js';
import {
@@ -24,7 +24,7 @@
import { useStyles } from '../themes/colors.js';
type Props = {
- +community: ThreadInfo | MinimallyEncodedThreadInfo,
+ +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -5,7 +5,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import CommIcon from './comm-icon.react.js';
import Pill from './pill.react.js';
@@ -15,7 +15,7 @@
const threadPillRoundCorners = { left: false, right: true };
type Props = {
- +community: ThreadInfo | MinimallyEncodedThreadInfo,
+ +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -6,13 +6,13 @@
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/thread-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: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -7,7 +7,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import Button from './button.react.js';
import CommunityPill from './community-pill.react.js';
@@ -17,7 +17,7 @@
import { useColors, useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
function ThreadAncestors(props: Props): React.Node {
@@ -25,7 +25,7 @@
const styles = useStyles(unboundStyles);
const colors = useColors();
- const ancestorThreads: $ReadOnlyArray<ThreadInfo> = useSelector(
+ const ancestorThreads: $ReadOnlyArray<LegacyThreadInfo> = useSelector(
ancestorThreadInfos(threadInfo.id),
);
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
@@ -3,7 +3,10 @@
import * as React from 'react';
import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo, ResolvedThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ LegacyThreadInfo,
+ ResolvedThreadInfo,
+} from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import Button from './button.react.js';
@@ -34,7 +37,7 @@
};
type BaseProps = {
...SharedProps,
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
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
@@ -7,7 +7,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import Search from './search.react.js';
import ThreadListThread from './thread-list-thread.react.js';
@@ -26,7 +26,7 @@
};
type BaseProps = {
- +threadInfos: $ReadOnlyArray<ThreadInfo>,
+ +threadInfos: $ReadOnlyArray<LegacyThreadInfo>,
+onSelect: (threadID: string) => void,
+itemStyle?: ViewStyle,
+itemTextStyle?: TextStyle,
@@ -50,7 +50,7 @@
};
textInput: ?React.ElementRef<typeof TextInput>;
- listDataSelector: PropsAndState => $ReadOnlyArray<ThreadInfo> =
+ listDataSelector: PropsAndState => $ReadOnlyArray<LegacyThreadInfo> =
createSelector(
(propsAndState: PropsAndState) => propsAndState.threadInfos,
(propsAndState: PropsAndState) => propsAndState.searchText,
@@ -58,10 +58,10 @@
(propsAndState: PropsAndState) => propsAndState.itemStyle,
(propsAndState: PropsAndState) => propsAndState.itemTextStyle,
(
- threadInfos: $ReadOnlyArray<ThreadInfo>,
+ threadInfos: $ReadOnlyArray<LegacyThreadInfo>,
text: string,
searchResults: Set<string>,
- ): $ReadOnlyArray<ThreadInfo> =>
+ ): $ReadOnlyArray<LegacyThreadInfo> =>
text
? threadInfos.filter(threadInfo => searchResults.has(threadInfo.id))
: // We spread to make sure the result of this selector updates when
@@ -69,7 +69,7 @@
[...threadInfos],
);
- get listData(): $ReadOnlyArray<ThreadInfo> {
+ get listData(): $ReadOnlyArray<LegacyThreadInfo> {
return this.listDataSelector({ ...this.props, ...this.state });
}
@@ -103,12 +103,12 @@
}
static keyExtractor = (
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): string => {
return threadInfo.id;
};
- renderItem = (row: { +item: ThreadInfo, ... }): React.Node => {
+ renderItem = (row: { +item: LegacyThreadInfo, ... }): React.Node => {
return (
<ThreadListThread
threadInfo={row.item}
@@ -120,7 +120,7 @@
};
static getItemLayout = (
- data: ?$ReadOnlyArray<ThreadInfo | MinimallyEncodedThreadInfo>,
+ data: ?$ReadOnlyArray<LegacyThreadInfo | MinimallyEncodedThreadInfo>,
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
@@ -3,13 +3,13 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-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: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -82,7 +82,7 @@
import {
type ClientNewThreadRequest,
type NewThreadResult,
- type ThreadInfo,
+ type LegacyThreadInfo,
} from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
@@ -176,7 +176,7 @@
pendingThreadCreations: Map<string, Promise<string>> = new Map();
pendingThreadUpdateHandlers: Map<
string,
- (ThreadInfo | MinimallyEncodedThreadInfo) => mixed,
+ (LegacyThreadInfo | MinimallyEncodedThreadInfo) => mixed,
> = new Map();
// TODO: flip the switch
// Note that this enables Blob service for encrypted media only
@@ -449,8 +449,8 @@
sendTextMessage = async (
messageInfo: RawTextMessageInfo,
- inputThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ inputThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) => {
this.sendCallbacks.forEach(callback => callback());
@@ -547,7 +547,7 @@
};
startThreadCreation(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): Promise<string> {
if (!threadIsPending(threadInfo.id)) {
return Promise.resolve(threadInfo.id);
@@ -570,8 +570,8 @@
async sendTextMessageAction(
messageInfo: RawTextMessageInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): Promise<SendMessagePayload> {
try {
await this.props.textMessageCreationSideEffectsFunc(
@@ -609,14 +609,14 @@
}
shouldEncryptMedia(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): boolean {
return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id);
}
sendMultimediaMessage = async (
selections: $ReadOnlyArray<NativeMediaSelection>,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => {
this.sendCallbacks.forEach(callback => callback());
const localMessageID = this.props.nextLocalID;
@@ -717,7 +717,7 @@
async uploadFiles(
localMessageID: string,
uploadFileInputs: $ReadOnlyArray<UploadFileInput>,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) {
const results = await Promise.all(
uploadFileInputs.map(uploadFileInput =>
@@ -733,7 +733,7 @@
async uploadFile(
localMessageID: string,
uploadFileInput: UploadFileInput,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): Promise<?string> {
const { ids, selection } = uploadFileInput;
const { localMediaID } = ids;
@@ -1343,8 +1343,8 @@
retryTextMessage = async (
rawMessageInfo: RawTextMessageInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) => {
await this.sendTextMessage(
{
@@ -1359,7 +1359,7 @@
retryMultimediaMessage = async (
rawMessageInfo: RawMultimediaMessageInfo,
localMessageID: string,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): Promise<void> => {
const pendingUploads = this.state.pendingUploads[localMessageID] ?? {};
@@ -1573,8 +1573,8 @@
retryMessage = async (
localMessageID: string,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) => {
this.sendCallbacks.forEach(callback => callback());
@@ -1673,7 +1673,7 @@
setPendingThreadUpdateHandler = (
threadID: string,
pendingThreadUpdateHandler: ?(
- ThreadInfo | MinimallyEncodedThreadInfo,
+ LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => mixed,
) => {
if (!pendingThreadUpdateHandler) {
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
@@ -5,7 +5,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/thread-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: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) => Promise<void>,
+sendMultimediaMessage: (
selections: $ReadOnlyArray<NativeMediaSelection>,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => Promise<void>,
+editInputMessage: (params: EditInputBarMessageParameters) => void,
+addEditInputMessageListener: (
@@ -49,8 +49,8 @@
+messageHasUploadFailure: (localMessageID: string) => boolean,
+retryMessage: (
localMessageID: string,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) => Promise<void>,
+registerSendCallback: (() => void) => void,
+unregisterSendCallback: (() => void) => void,
@@ -59,7 +59,7 @@
+setPendingThreadUpdateHandler: (
threadID: string,
pendingThreadUpdateHandler: ?(
- ThreadInfo | MinimallyEncodedThreadInfo,
+ LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => mixed,
) => void,
+scrollToMessage: (messageKey: string) => 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
@@ -11,7 +11,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import Button from '../components/button.react.js';
import TextInput from '../components/text-input.react.js';
@@ -22,7 +22,7 @@
import Alert from '../utils/alert.js';
export type ManagePublicLinkScreenParams = {
- +community: ThreadInfo | MinimallyEncodedThreadInfo,
+ +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -11,7 +11,7 @@
import type { InviteLink } from 'lib/types/link-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import SingleLine from '../components/single-line.react.js';
import SWMansionIcon from '../components/swmansion-icon.react.js';
@@ -25,7 +25,7 @@
import { useStyles, useColors } from '../themes/colors.js';
export type ViewInviteLinksScreenParams = {
- +community: ThreadInfo | MinimallyEncodedThreadInfo,
+ +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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 { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { type KeyboardState, KeyboardContext } from './keyboard-state.js';
import { type InputState, InputStateContext } from '../input/input-state.js';
@@ -75,7 +75,7 @@
keyboardName: string,
result: {
+selections: $ReadOnlyArray<MediaLibrarySelection>,
- +threadInfo: ?ThreadInfo,
+ +threadInfo: ?LegacyThreadInfo,
},
) => {
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
@@ -5,7 +5,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import sleep from 'lib/utils/sleep.js';
import KeyboardInputHost from './keyboard-input-host.react.js';
@@ -24,7 +24,7 @@
type State = {
+systemKeyboardShowing: boolean,
+mediaGalleryOpen: boolean,
- +mediaGalleryThread: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +mediaGalleryThread: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+renderKeyboardInputHost: boolean,
};
class KeyboardStateContainer extends React.PureComponent<Props, State> {
@@ -94,13 +94,14 @@
return systemKeyboardShowing || mediaGalleryOpen;
}
- showMediaGallery: (thread: ThreadInfo | MinimallyEncodedThreadInfo) => void =
- (thread: ThreadInfo | MinimallyEncodedThreadInfo) => {
- this.setState({
- mediaGalleryOpen: true,
- mediaGalleryThread: thread,
- });
- };
+ showMediaGallery: (
+ thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ ) => void = (thread: LegacyThreadInfo | MinimallyEncodedThreadInfo) => {
+ this.setState({
+ mediaGalleryOpen: true,
+ mediaGalleryThread: thread,
+ });
+ };
hideMediaGallery: () => void = () => {
this.setState({
@@ -110,8 +111,8 @@
});
};
- getMediaGalleryThread: () => ?ThreadInfo | ?MinimallyEncodedThreadInfo = () =>
- this.state.mediaGalleryThread;
+ getMediaGalleryThread: () => ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo =
+ () => 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
@@ -3,7 +3,7 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
export type KeyboardState = {
+keyboardShowing: boolean,
@@ -11,9 +11,11 @@
+dismissKeyboardIfShowing: () => boolean,
+systemKeyboardShowing: boolean,
+mediaGalleryOpen: boolean,
- +showMediaGallery: (thread: ThreadInfo | MinimallyEncodedThreadInfo) => void,
+ +showMediaGallery: (
+ thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ ) => void,
+hideMediaGallery: () => void,
- +getMediaGalleryThread: () => ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +getMediaGalleryThread: () => ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
};
const KeyboardContext: React.Context<?KeyboardState> =
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
@@ -9,7 +9,7 @@
import { chatMentionRegex } from 'lib/shared/mention-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ChatMentionCandidates,
RelativeMemberInfo,
} from 'lib/types/thread-types.js';
@@ -360,7 +360,7 @@
});
function useTextMessageRulesFunc(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -5,7 +5,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import CameraModal from './camera-modal.react.js';
import { InputStateContext } from '../input/input-state.js';
@@ -14,7 +14,7 @@
export type ChatCameraModalParams = {
+presentedFrom: string,
- +thread: ThreadInfo | MinimallyEncodedThreadInfo,
+ +thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -23,7 +23,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { getCompatibleMediaURI } from './identifier-utils.js';
import MediaGalleryMedia from './media-gallery-media.react.js';
@@ -103,7 +103,7 @@
};
type BaseProps = {
- +threadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
};
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
@@ -17,7 +17,7 @@
} from 'lib/types/message-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { GlobalTheme } from 'lib/types/theme-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { NavContextType } from './navigation-context.js';
import { NavContext } from './navigation-context.js';
@@ -404,7 +404,7 @@
}
function useCanEditMessageNative(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -6,13 +6,13 @@
import { TouchableOpacity, Text, View } from 'react-native';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-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: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -31,7 +31,7 @@
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';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
useDispatchActionPromise,
type DispatchActionPromise,
@@ -104,7 +104,7 @@
+deviceTokens: {
+[keyserverID: string]: ?string,
},
- +threadInfos: { +[id: string]: ThreadInfo },
+ +threadInfos: { +[id: string]: LegacyThreadInfo },
+notifPermissionAlertInfo: NotifPermissionAlertInfo,
+connection: ConnectionInfo,
+updatesCurrentAsOf: number,
@@ -521,7 +521,7 @@
);
}
- navigateToThread(threadInfo: ThreadInfo, clearChatRoutes: boolean) {
+ navigateToThread(threadInfo: LegacyThreadInfo, clearChatRoutes: boolean) {
if (clearChatRoutes) {
this.props.navigation.dispatch({
type: replaceWithThreadActionType,
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
@@ -13,7 +13,10 @@
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 { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ RelativeMemberInfo,
+ LegacyThreadInfo,
+} from 'lib/types/thread-types.js';
import { values } from 'lib/utils/objects.js';
import ChangeRolesHeaderRightButton from './change-roles-header-right-button.react.js';
@@ -25,7 +28,7 @@
import { useStyles } from '../themes/colors.js';
export type ChangeRolesScreenParams = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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 { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import RolePanelEntry from './role-panel-entry.react.js';
import type { RolesNavigationProp } from './roles-navigator.react.js';
@@ -20,7 +20,7 @@
import { useStyles } from '../themes/colors.js';
export type CommunityRolesScreenParams = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
type CommunityRolesScreenProps = {
@@ -37,7 +37,7 @@
// 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: ?ThreadInfo = useSelector(
+ const reduxThreadInfo: ?LegacyThreadInfo = useSelector(
state => threadInfoSelector(state)[threadID],
);
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
@@ -13,7 +13,7 @@
type UserSurfacedPermission,
userSurfacedPermissionOptions,
} from 'lib/types/thread-permission-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import CreateRolesHeaderRightButton from './create-roles-header-right-button.react.js';
import type { RolesNavigationProp } from './roles-navigator.react.js';
@@ -25,7 +25,7 @@
import { useStyles } from '../themes/colors.js';
export type CreateRolesScreenParams = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -8,7 +8,7 @@
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { UserSurfacedPermission } from 'lib/types/thread-permission-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDisplayDeleteRoleAlert } from './role-utils.react.js';
import type { RolesNavigationProp } from './roles-navigator.react.js';
@@ -20,7 +20,7 @@
type RolePanelEntryProps = {
+navigation: RolesNavigationProp<'CommunityRolesScreen'>,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+roleName: string,
+rolePermissions: $ReadOnlySet<UserSurfacedPermission>,
+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
@@ -7,14 +7,14 @@
deleteCommunityRoleActionTypes,
} from 'lib/actions/thread-actions.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import { constructRoleDeletionMessagePrompt } from 'lib/utils/role-utils.js';
import Alert from '../utils/alert.js';
function useDisplayDeleteRoleAlert(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -13,7 +13,7 @@
} 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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import SearchFooter from './search-footer.react.js';
import { MessageSearchContext } from './search-provider.react.js';
@@ -29,7 +29,7 @@
import type { VerticalBounds } from '../types/layout-types.js';
export type MessageSearchParams = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -3,7 +3,7 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { ChatNavigationProp } from '../chat/chat.react.js';
import Button from '../components/button.react.js';
@@ -12,7 +12,7 @@
import { useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+navigate: $PropertyType<ChatNavigationProp<'MessageList'>, '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 { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { dateString } from 'lib/utils/date-utils.js';
import type { AppState } from '../redux/state-types.js';
@@ -32,7 +32,7 @@
| {
itemType: 'entryInfo',
entryInfo: EntryInfo,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
};
const calendarListData: (state: AppState) => ?(CalendarItem[]) = createSelector(
@@ -42,7 +42,7 @@
(
loggedIn: boolean,
daysToEntries: { +[dayString: string]: EntryInfo[] },
- threadInfos: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
) => {
if (!loggedIn || daysToEntries[dateString(new Date())] === undefined) {
return null;
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
@@ -8,7 +8,7 @@
} 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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { EntityText } from 'lib/utils/entity-text.js';
import type { MessagePendingUploads } from '../input/input-state.js';
@@ -17,12 +17,12 @@
+itemType: 'message',
+messageShapeType: 'robotext',
+messageInfo: RobotextMessageInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+startsConversation: boolean,
+startsCluster: boolean,
+endsCluster: boolean,
+robotext: EntityText,
- +threadCreatedFromMessage: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+contentHeight: number,
+reactions: ReactionInfo,
};
@@ -32,12 +32,12 @@
+messageShapeType: 'text',
+messageInfo: TextMessageInfo,
+localMessageInfo: ?LocalMessageInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+startsConversation: boolean,
+startsCluster: boolean,
+endsCluster: boolean,
+contentHeight: number,
- +threadCreatedFromMessage: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+reactions: ReactionInfo,
+hasBeenEdited: ?boolean,
+isPinned: ?boolean,
@@ -57,11 +57,11 @@
+messageShapeType: 'multimedia',
+messageInfo: MultimediaMessageInfo,
+localMessageInfo: ?LocalMessageInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+startsConversation: boolean,
+startsCluster: boolean,
+endsCluster: boolean,
- +threadCreatedFromMessage: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+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
@@ -8,7 +8,7 @@
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types';
import { userProfileMenuButtonHeight } from './user-profile-constants.js';
@@ -22,7 +22,7 @@
const onMenuButtonLayout = () => {};
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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 { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types';
import { useNavigateToThread } from '../chat/message-list-types.js';
@@ -13,7 +13,7 @@
import { useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+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
@@ -7,7 +7,7 @@
import type { SetState } from 'lib/types/hook-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types';
import { userProfileActionButtonHeight } from './user-profile-constants.js';
@@ -20,7 +20,7 @@
};
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+pendingPersonalThreadUserInfo?: UserInfo,
+setUserProfileRelationshipButtonHeight: SetState<number>,
};
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
@@ -2,13 +2,13 @@
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypeIsCommunityRoot } from 'lib/types/thread-types-enum.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { CommunityDrawerItemData } from 'lib/utils/drawer-utils.react.js';
import type { TextStyle } from '../types/styles.js';
export type CommunityDrawerItemDataFlattened = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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,10 @@
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 { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ RawThreadInfo,
+ LegacyThreadInfo,
+} from 'lib/types/thread-types.js';
import { useUploadAvatarMedia } from './avatar-hooks.react.js';
import css from './edit-avatar-menu.css';
@@ -23,7 +26,7 @@
);
type Props = {
- +threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -7,14 +7,17 @@
import { threadHasPermission } from 'lib/shared/thread-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ RawThreadInfo,
+ LegacyThreadInfo,
+} from 'lib/types/thread-types.js';
import EditThreadAvatarMenu from './edit-thread-avatar-menu.react.js';
import css from './edit-thread-avatar.css';
import ThreadAvatar from './thread-avatar.react.js';
type Props = {
- +threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -10,13 +10,16 @@
import type { AvatarSize } from 'lib/types/avatar-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import type { ThreadInfo, RawThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ LegacyThreadInfo,
+ RawThreadInfo,
+} from 'lib/types/thread-types.js';
import Avatar from './avatar.react.js';
import { useSelector } from '../redux/redux-utils.js';
type Props = {
- +threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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,12 +13,15 @@
ClientEmojiAvatar,
} from 'lib/types/avatar-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ RawThreadInfo,
+ LegacyThreadInfo,
+} from 'lib/types/thread-types.js';
import EmojiAvatarSelectionModal from './emoji-avatar-selection-modal.react.js';
type Props = {
- +threadInfo: ThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | RawThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -18,7 +18,7 @@
import type { EntryInfo } from 'lib/types/entry-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { Dispatch } from 'lib/types/redux-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { dateString, dateFromString } from 'lib/utils/date-utils.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
@@ -39,7 +39,9 @@
};
type Props = {
...BaseProps,
- +onScreenThreadInfos: $ReadOnlyArray<ThreadInfo | MinimallyEncodedThreadInfo>,
+ +onScreenThreadInfos: $ReadOnlyArray<
+ LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ >,
+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
@@ -39,7 +39,7 @@
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type ClientThreadJoinRequest,
type ThreadJoinPayload,
} from 'lib/types/thread-types.js';
@@ -68,7 +68,7 @@
} from '../utils/typeahead-utils.js';
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+inputState: InputState,
};
type Props = {
@@ -84,7 +84,7 @@
+joinThread: (request: ClientThreadJoinRequest) => Promise<ThreadJoinPayload>,
+typeaheadMatchedStrings: ?TypeaheadMatchedStrings,
+suggestions: $ReadOnlyArray<MentionTypeaheadSuggestionItem>,
- +parentThreadInfo: ?ThreadInfo,
+ +parentThreadInfo: ?LegacyThreadInfo,
};
class ChatInputBar extends React.PureComponent<Props> {
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
@@ -28,7 +28,7 @@
import type { FetchMessageInfosPayload } from 'lib/types/message-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
useDispatchActionPromise,
@@ -56,7 +56,7 @@
const editBoxTopMargin = 10;
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -6,14 +6,14 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './chat-thread-list-item-menu.css';
import Button from '../components/button.react.js';
import { useThreadIsActive } from '../selectors/thread-selectors.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -6,13 +6,13 @@
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/thread-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: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -13,7 +13,7 @@
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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { getComposedMessageID } from './chat-constants.js';
import css from './chat-message-list.css';
@@ -51,7 +51,7 @@
type BaseProps = {
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -6,7 +6,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/thread-types';
+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: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -9,7 +9,7 @@
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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { editBoxBottomRowHeight } from './chat-constants.js';
import ChatInputTextArea from './chat-input-text-area.react.js';
@@ -21,7 +21,7 @@
type Props = {
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -12,7 +12,7 @@
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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './chat-message-list.css';
import multimediaMessageSendFailed from './multimedia-message-send-failed.js';
@@ -23,13 +23,13 @@
type BaseProps = {
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
type Props = {
...BaseProps,
+rawMessageInfo: RawComposableMessageInfo,
+inputState: ?InputState,
- +parentThreadInfo: ?ThreadInfo,
+ +parentThreadInfo: ?LegacyThreadInfo,
};
class FailedSend extends React.PureComponent<Props> {
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
@@ -8,7 +8,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './inline-engagement.css';
import ReactionPill from './reaction-pill.react.js';
@@ -17,8 +17,8 @@
type Props = {
+messageInfo: MessageInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- +sidebarThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +sidebarThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+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,14 +7,14 @@
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 ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './chat-thread-list.css';
import { getDefaultTextMessageRules } from '../markdown/rules.react.js';
type Props = {
+messageInfo: ?MessageInfo,
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
function MessagePreview(props: Props): React.Node {
const { messageInfo, threadInfo } = props;
diff --git a/web/chat/message-tooltip.react.js b/web/chat/message-tooltip.react.js
--- a/web/chat/message-tooltip.react.js
+++ b/web/chat/message-tooltip.react.js
@@ -8,7 +8,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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
tooltipButtonStyle,
@@ -33,7 +33,7 @@
+tooltipPositionStyle: TooltipPositionStyle,
+tooltipSize: TooltipSize,
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
function MessageTooltip(props: MessageTooltipProps): React.Node {
const {
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
@@ -6,7 +6,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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { longAbsoluteDate } from 'lib/utils/date-utils.js';
import css from './chat-message-list.css';
@@ -18,7 +18,7 @@
type Props = {
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -10,7 +10,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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './chat-message-list.css';
import ComposedMessage from './composed-message.react.js';
@@ -19,7 +19,7 @@
import Multimedia from '../media/multimedia.react.js';
type BaseProps = {
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+shouldDisplayPinIndicator: boolean,
};
type Props = {
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
@@ -11,13 +11,13 @@
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import RelationshipPromptButtonContainer from './relationship-prompt-button-container.js';
import RelationshipPromptButton from './relationship-prompt-button.js';
import { buttonThemes } from '../../components/button.react.js';
-type Props = { +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo };
+type Props = { +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo };
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
@@ -7,7 +7,7 @@
import { threadInfoSelector } from 'lib/selectors/thread-selectors.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { Dispatch } from 'lib/types/redux-types.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import {
entityTextToReact,
useENSNamesForEntityText,
@@ -35,7 +35,7 @@
type Props = {
+item: RobotextChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
function RobotextMessage(props: Props): React.Node {
let inlineEngagement;
@@ -105,7 +105,7 @@
};
type InnerThreadEntityProps = {
...BaseInnerThreadEntityProps,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+dispatch: Dispatch,
};
class InnerThreadEntity extends React.PureComponent<InnerThreadEntityProps> {
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
@@ -9,7 +9,7 @@
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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './chat-message-list.css';
import ComposedMessage from './composed-message.react.js';
@@ -19,7 +19,7 @@
type Props = {
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -18,7 +18,7 @@
import type { MinimallyEncodedThreadInfo } 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 ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import css from './thread-menu.css';
@@ -36,7 +36,7 @@
import { useSelector } from '../redux/redux-utils.js';
type ThreadMenuProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -7,7 +7,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import ThreadMenu from './thread-menu.react.js';
@@ -19,7 +19,7 @@
import MessageSearchModal from '../modals/search/message-search-modal.react.js';
type ThreadTopBarProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -7,7 +7,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { longAbsoluteDate } from 'lib/utils/date-utils.js';
import css from './message-result.css';
@@ -17,7 +17,7 @@
type MessageResultProps = {
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -80,7 +80,7 @@
import {
type ClientNewThreadRequest,
type NewThreadResult,
- type ThreadInfo,
+ type LegacyThreadInfo,
} from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
@@ -420,7 +420,7 @@
return rawMessageInfo;
}
- shouldEncryptMedia(threadInfo: ThreadInfo): boolean {
+ shouldEncryptMedia(threadInfo: LegacyThreadInfo): boolean {
return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id);
}
@@ -567,7 +567,7 @@
}
startThreadCreation(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): Promise<string> {
if (!threadIsPending(threadInfo.id)) {
return Promise.resolve(threadInfo.id);
@@ -629,20 +629,20 @@
draft: draft ?? '',
textCursorPosition: textCursorPosition ?? 0,
appendFiles: (
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
files: $ReadOnlyArray<File>,
) => this.appendFiles(threadInfo, files),
cancelPendingUpload: (localUploadID: string) =>
this.cancelPendingUpload(threadID, localUploadID),
sendTextMessage: (
messageInfo: RawTextMessageInfo,
- threadInfo: ThreadInfo,
- parentThreadInfo: ?ThreadInfo,
+ threadInfo: LegacyThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo,
) =>
this.sendTextMessage(messageInfo, threadInfo, parentThreadInfo),
createMultimediaMessage: (
localID: number,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
) => this.createMultimediaMessage(localID, threadInfo),
setDraft: (newDraft: string) => this.setDraft(threadID, newDraft),
setTextCursorPosition: (newPosition: number) =>
@@ -651,7 +651,7 @@
this.messageHasUploadFailure(assignedUploads[localMessageID]),
retryMultimediaMessage: (
localMessageID: string,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
) =>
this.retryMultimediaMessage(
localMessageID,
@@ -690,7 +690,7 @@
}
async appendFiles(
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
files: $ReadOnlyArray<File>,
): Promise<boolean> {
const selectionTime = Date.now();
@@ -747,7 +747,7 @@
}
async appendFile(
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
file: File,
selectTime: number,
): Promise<{
@@ -1244,8 +1244,8 @@
async sendTextMessage(
messageInfo: RawTextMessageInfo,
- inputThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ inputThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) {
this.props.sendCallbacks.forEach(callback => callback());
@@ -1342,8 +1342,8 @@
async sendTextMessageAction(
messageInfo: RawTextMessageInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): Promise<SendMessagePayload> {
try {
await this.props.textMessageCreationSideEffectsFunc(
@@ -1382,7 +1382,7 @@
// Creates a MultimediaMessage from the unassigned pending uploads,
// if there are any
- createMultimediaMessage(localID: number, threadInfo: ThreadInfo) {
+ createMultimediaMessage(localID: number, threadInfo: LegacyThreadInfo) {
this.props.sendCallbacks.forEach(callback => callback());
const localMessageID = `${localIDPrefix}${localID}`;
@@ -1503,7 +1503,7 @@
retryMultimediaMessage(
localMessageID: string,
- threadInfo: ThreadInfo,
+ threadInfo: LegacyThreadInfo,
pendingUploads: ?$ReadOnlyArray<PendingMultimediaUpload>,
) {
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
@@ -11,7 +11,7 @@
import type { RawTextMessageInfo } from 'lib/types/messages/text.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ChatMentionCandidates,
RelativeMemberInfo,
} from 'lib/types/thread-types.js';
@@ -64,25 +64,25 @@
+draft: string,
+textCursorPosition: number,
+appendFiles: (
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
files: $ReadOnlyArray<File>,
) => Promise<boolean>,
+cancelPendingUpload: (localUploadID: string) => void,
+sendTextMessage: (
messageInfo: RawTextMessageInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
) => Promise<void>,
+createMultimediaMessage: (
localID: number,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => void,
+setDraft: (draft: string) => void,
+setTextCursorPosition: (newPosition: number) => void,
+messageHasUploadFailure: (localMessageID: string) => boolean,
+retryMultimediaMessage: (
localMessageID: string,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
) => 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
@@ -12,7 +12,7 @@
} 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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './manage-invite-links-modal.css';
import Button from '../../components/button.react.js';
@@ -23,7 +23,7 @@
+inviteLink: ?InviteLink,
+enterViewMode: () => mixed,
+enterDisableMode: () => mixed,
- +community: ThreadInfo | MinimallyEncodedThreadInfo,
+ +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -8,7 +8,7 @@
import { chatMentionRegex } from 'lib/shared/mention-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
ChatMentionCandidates,
RelativeMemberInfo,
} from 'lib/types/thread-types.js';
@@ -166,7 +166,7 @@
});
function useTextMessageRulesFunc(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
chatMentionCandidates: ChatMentionCandidates,
): boolean => MarkdownRules {
const { members } = threadInfo;
diff --git a/web/modals/chat/message-results-modal.react.js b/web/modals/chat/message-results-modal.react.js
--- a/web/modals/chat/message-results-modal.react.js
+++ b/web/modals/chat/message-results-modal.react.js
@@ -19,7 +19,7 @@
} 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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import css from './message-results-modal.css';
@@ -29,7 +29,7 @@
import Modal from '../modal.react.js';
type MessageResultsModalProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+modalName: string,
};
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
@@ -3,7 +3,7 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import css from './sidebar-promote-modal.css';
@@ -13,7 +13,7 @@
type Props = {
+onClose: () => void,
+onConfirm: () => void,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -12,7 +12,7 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import css from './toggle-pin-modal.css';
@@ -22,7 +22,7 @@
type TogglePinModalProps = {
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -5,7 +5,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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import css from './message-search-modal.css';
@@ -19,7 +19,7 @@
import Modal from '../modal.react.js';
type ContentProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -11,12 +11,12 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useSelector } from '../../redux/redux-utils.js';
function useParseSearchResults(
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
searchResults: $ReadOnlyArray<RawMessageInfo>,
): $ReadOnlyArray<ChatMessageInfoItem> {
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
@@ -3,7 +3,7 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import css from './confirm-leave-thread-modal.css';
@@ -11,7 +11,7 @@
import Modal from '../modal.react.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -9,7 +9,7 @@
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
@@ -27,7 +27,7 @@
type Props = {
+onClose: () => void,
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -5,7 +5,10 @@
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 { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types.js';
+import type {
+ RelativeMemberInfo,
+ LegacyThreadInfo,
+} from 'lib/types/thread-types.js';
import type { UserListItem } from 'lib/types/user-types.js';
import { useSelector } from '../../../../redux/redux-utils.js';
@@ -14,8 +17,8 @@
type Props = {
+searchText: string,
+searchResult: $ReadOnlySet<string>,
- +communityThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +communityThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+selectedUsers: $ReadOnlySet<string>,
+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
@@ -5,7 +5,7 @@
import { userStoreSearchIndex } from 'lib/selectors/user-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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import MembersList from './subchannel-members-list.react.js';
import css from './subchannel-members.css';
@@ -13,7 +13,7 @@
import { useSelector } from '../../../../redux/redux-utils.js';
type SubchannelMembersProps = {
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+selectedUsers: $ReadOnlySet<string>,
+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
@@ -11,7 +11,7 @@
} 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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import GalleryItem from './thread-settings-media-gallery-item.react.js';
import css from './thread-settings-media-gallery.css';
@@ -23,7 +23,7 @@
type ThreadSettingsMediaGalleryModalProps = {
+onClose: () => void,
- +parentThreadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -12,7 +12,10 @@
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, RelativeMemberInfo } from 'lib/types/thread-types';
+import type {
+ LegacyThreadInfo,
+ RelativeMemberInfo,
+} from 'lib/types/thread-types';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import { values } from 'lib/utils/objects.js';
@@ -26,7 +29,7 @@
type ChangeMemberRoleModalProps = {
+memberInfo: RelativeMemberInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -12,7 +12,10 @@
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, RelativeMemberInfo } from 'lib/types/thread-types.js';
+import type {
+ LegacyThreadInfo,
+ RelativeMemberInfo,
+} from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import { useRolesFromCommunityThreadInfo } from 'lib/utils/role-utils.js';
@@ -29,7 +32,7 @@
type Props = {
+memberInfo: RelativeMemberInfo,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+setOpenMenu: SetState<?string>,
};
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
@@ -9,7 +9,7 @@
import { stringForUser } from 'lib/shared/user-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
- type ThreadInfo,
+ type LegacyThreadInfo,
type RelativeMemberInfo,
} from 'lib/types/thread-types.js';
@@ -17,7 +17,7 @@
import css from './members-modal.css';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+threadMembers: $ReadOnlyArray<RelativeMemberInfo>,
};
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
@@ -5,14 +5,14 @@
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/thread-types';
+import type { LegacyThreadInfo } from 'lib/types/thread-types';
import css from './thread-settings-delete-confirmation-modal.css';
import Button from '../../../components/button.react.js';
import Modal from '../../modal.react.js';
type BaseProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+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
@@ -11,7 +11,7 @@
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/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import SubmitSection from './submit-section.react.js';
@@ -22,7 +22,7 @@
type ThreadSettingsDeleteTabProps = {
+threadSettingsOperationInProgress: boolean,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+setErrorMessage: SetState<?string>,
+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
@@ -11,7 +11,10 @@
import { type SetState } from 'lib/types/hook-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import { type ThreadInfo, type ThreadChanges } from 'lib/types/thread-types.js';
+import {
+ type LegacyThreadInfo,
+ type ThreadChanges,
+} from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import { firstLine } from 'lib/utils/string-utils.js';
import { chatNameMaxLength } from 'lib/utils/validation-utils.js';
@@ -25,7 +28,7 @@
type ThreadSettingsGeneralTabProps = {
+threadSettingsOperationInProgress: boolean,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+threadNamePlaceholder: string,
+queuedChanges: ThreadChanges,
+setQueuedChanges: SetState<ThreadChanges>,
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
@@ -20,7 +20,10 @@
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';
-import { type ThreadInfo, type ThreadChanges } from 'lib/types/thread-types.js';
+import {
+ type LegacyThreadInfo,
+ type ThreadChanges,
+} from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import ThreadSettingsDeleteTab from './thread-settings-delete-tab.react.js';
@@ -51,7 +54,7 @@
deleteThreadLoadingStatusSelector(state) === 'loading' ||
changeThreadSettingsLoadingStatusSelector(state) === 'loading',
);
- const threadInfo: ?ThreadInfo = useSelector(
+ const threadInfo: ?LegacyThreadInfo = useSelector(
state => threadInfoSelector(state)[props.threadID],
);
const modalContext = useModalContext();
@@ -98,7 +101,7 @@
const hasPermissionForTab = React.useCallback(
// ESLint doesn't recognize that invariant always throws
// eslint-disable-next-line consistent-return
- (thread: ThreadInfo | MinimallyEncodedThreadInfo, tab: TabType) => {
+ (thread: LegacyThreadInfo | MinimallyEncodedThreadInfo, 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
@@ -12,7 +12,10 @@
import { type SetState } from 'lib/types/hook-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import { type ThreadInfo, type ThreadChanges } from 'lib/types/thread-types.js';
+import {
+ type LegacyThreadInfo,
+ type ThreadChanges,
+} from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import SubmitSection from './submit-section.react.js';
@@ -39,7 +42,7 @@
type ThreadSettingsPrivacyTabProps = {
+threadSettingsOperationInProgress: boolean,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+queuedChanges: ThreadChanges,
+setQueuedChanges: SetState<ThreadChanges>,
+setErrorMessage: SetState<?string>,
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 { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import css from './thread-picker-modal.css';
@@ -16,7 +16,7 @@
import Modal, { type ModalOverridableProps } from '../modal.react.js';
type OptionProps = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+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
@@ -5,7 +5,7 @@
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types';
+import type { LegacyThreadInfo } from 'lib/types/thread-types';
import UserProfileMessageButton from './user-profile-message-button.react.js';
import css from './user-profile.css';
@@ -13,7 +13,7 @@
import { buttonThemes } from '../../components/button.react.js';
type Props = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
};
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
@@ -8,7 +8,7 @@
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types';
+import type { LegacyThreadInfo } from 'lib/types/thread-types';
import MenuItem from '../../components/menu-item.react.js';
import Menu from '../../components/menu.react.js';
@@ -22,7 +22,7 @@
const unblockIcon = <FontAwesomeIcon icon={faUserShield} />;
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -5,14 +5,14 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './user-profile.css';
import Button from '../../components/button.react.js';
import { useOnClickThread } from '../../selectors/thread-selectors.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -6,13 +6,13 @@
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/thread-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: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -4,14 +4,14 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import ThreadAncestors from './chat-thread-ancestors.react.js';
import css from './nav-state-info-bar.css';
import ThreadAvatar from '../avatars/thread-avatar.react.js';
type NavStateInfoBarProps = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
function NavStateInfoBar(props: NavStateInfoBarProps): React.Node {
const { threadInfo } = props;
@@ -27,7 +27,7 @@
}
type PossiblyEmptyNavStateInfoBarProps = {
- +threadInfoInput: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfoInput: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
};
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
@@ -6,7 +6,7 @@
import { threadInfoSelector } from 'lib/selectors/thread-selectors.js';
import { useRoleMemberCountsForCommunity } from 'lib/shared/thread-utils.js';
import type { UserSurfacedPermission } from 'lib/types/thread-permission-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './community-roles-modal.css';
import CreateRolesModal from './create-roles-modal.react.js';
@@ -16,16 +16,17 @@
import { useSelector } from '../redux/redux-utils.js';
type CommunityRolesModalProps = {
- +community: ThreadInfo,
+ +community: LegacyThreadInfo,
};
function CommunityRolesModal(props: CommunityRolesModalProps): React.Node {
const { popModal, pushModal } = useModalContext();
const { community } = props;
- const [threadInfo, setThreadInfo] = React.useState<ThreadInfo>(community);
+ const [threadInfo, setThreadInfo] =
+ React.useState<LegacyThreadInfo>(community);
const threadID = threadInfo.id;
- const reduxThreadInfo: ?ThreadInfo = useSelector(
+ const reduxThreadInfo: ?LegacyThreadInfo = useSelector(
state => threadInfoSelector(state)[threadID],
);
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
@@ -17,7 +17,7 @@
userSurfacedPermissionOptions,
} from 'lib/types/thread-permission-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
RoleModificationRequest,
} from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
@@ -37,7 +37,7 @@
);
type CreateRolesModalProps = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+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 { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import { constructRoleDeletionMessagePrompt } from 'lib/utils/role-utils.js';
@@ -24,7 +24,7 @@
);
type DeleteRoleModalProps = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+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 { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useRoleDeletableAndEditableStatus } from 'lib/utils/role-utils.js';
import CreateRolesModal from './create-roles-modal.react.js';
@@ -18,7 +18,7 @@
const menuIcon = <SWMansionIcon icon="menu-horizontal" size={20} />;
type RoleActionsMenuProps = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+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,14 +2,14 @@
import * as React from 'react';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import RoleActionsMenu from './role-actions-menu.react.js';
import css from './role-panel-entry.css';
import CommIcon from '../CommIcon.react.js';
type RolePanelEntryProps = {
- +threadInfo: ThreadInfo,
+ +threadInfo: LegacyThreadInfo,
+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 { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { filterThreadIDsBelongingToCommunity } from 'lib/utils/drawer-utils.react.js';
import type { AppState } from '../redux/redux-setup.js';
@@ -32,7 +32,7 @@
threadInfoSelector,
(
calendarPickedCommunityID: ?string,
- threadInfos: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
) => {
if (!calendarPickedCommunityID) {
return null;
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 { MessageStore, MessageInfo } from 'lib/types/message-types.js';
-import type { ThreadInfo, SidebarInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, SidebarInfo } from 'lib/types/thread-types.js';
import type { AppState } from '../redux/redux-setup.js';
import { useSelector } from '../redux/redux-utils.js';
@@ -28,11 +28,11 @@
(state: AppState) => state.navInfo.pendingThread,
sidebarInfoSelector,
(
- threadInfos: { +[id: string]: ThreadInfo },
+ threadInfos: { +[id: string]: LegacyThreadInfo },
messageStore: MessageStore,
messageInfos: { +[id: string]: ?MessageInfo },
activeChatThreadID: ?string,
- pendingThreadInfo: ?ThreadInfo,
+ pendingThreadInfo: ?LegacyThreadInfo,
sidebarInfos: { +[id: string]: $ReadOnlyArray<SidebarInfo> },
): ?ChatThreadItem => {
if (!activeChatThreadID) {
@@ -55,7 +55,7 @@
},
);
-function useChatThreadItem(threadInfo: ?ThreadInfo): ?ChatThreadItem {
+function useChatThreadItem(threadInfo: ?LegacyThreadInfo): ?ChatThreadItem {
const messageInfos = useSelector(messageInfoSelector);
const sidebarInfos = useSelector(sidebarInfoSelector);
const messageStore = useSelector(state => state.messageStore);
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
@@ -17,7 +17,7 @@
} from 'lib/types/message-types.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- ThreadInfo,
+ LegacyThreadInfo,
LegacyRawThreadInfos,
} from 'lib/types/thread-types.js';
import { values } from 'lib/utils/objects.js';
@@ -29,7 +29,7 @@
import { useSelector } from '../redux/redux-utils.js';
function useOnClickThread(
- thread: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
+ thread: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
): (event: SyntheticEvent<HTMLElement>) => void {
const dispatch = useDispatch();
return React.useCallback(
@@ -69,7 +69,7 @@
function useOnClickPendingSidebar(
messageInfo: ComposableMessageInfo | RobotextMessageInfo,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): (event: SyntheticEvent<HTMLElement>) => 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
@@ -8,7 +8,7 @@
clearChatCommunityFilter,
} from 'lib/actions/community-actions.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { useDispatch } from 'lib/utils/redux-utils.js';
import type { CommunityDrawerItemCommunityHandler } from './community-drawer-item-handler.react.js';
@@ -22,7 +22,7 @@
export type HandlerProps = {
+setHandler: (handler: CommunityDrawerItemCommunityHandler) => void,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -3,7 +3,7 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { CommunityDrawerItemHandler } from './community-drawer-item-handler.react.js';
import { useCommunityIsPickedCalendar } from '../selectors/calendar-selectors.js';
@@ -15,7 +15,7 @@
export type HandlerProps = {
+setHandler: (handler: CommunityDrawerItemHandler) => void,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
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
@@ -3,7 +3,7 @@
import * as React from 'react';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types';
+import type { LegacyThreadInfo } from 'lib/types/thread-types';
import type { CommunityDrawerItemData } from 'lib/utils/drawer-utils.react';
import css from './community-drawer-item.css';
@@ -28,7 +28,7 @@
hasSubchannelsButton: boolean,
itemChildren: $ReadOnlyArray<CommunityDrawerItemData<string>>,
paddingLeft: number,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -5,14 +5,14 @@
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/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import css from './subchannels-button.css';
import Button from '../components/button.react.js';
import SubchannelsModal from '../modals/threads/subchannels/subchannels-modal.react.js';
type Props = {
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
function SubchannelsButton(props: Props): React.Node {
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
@@ -4,8 +4,8 @@
import { type BaseNavInfo } from 'lib/types/nav-types.js';
import {
- type ThreadInfo,
- threadInfoValidator,
+ type LegacyThreadInfo,
+ legacyThreadInfoValidator,
} from 'lib/types/thread-types.js';
import {
type AccountUserInfo,
@@ -35,7 +35,7 @@
...$Exact<BaseNavInfo>,
+tab: NavigationTab,
+activeChatThreadID: ?string,
- +pendingThread?: ThreadInfo,
+ +pendingThread?: LegacyThreadInfo,
+settingsSection?: NavigationSettingsSection,
+selectedUserList?: $ReadOnlyArray<AccountUserInfo>,
+chatMode?: NavigationChatMode,
@@ -48,7 +48,7 @@
endDate: t.String,
tab: navigationTabValidator,
activeChatThreadID: t.maybe(tID),
- pendingThread: t.maybe(threadInfoValidator),
+ pendingThread: t.maybe(legacyThreadInfoValidator),
settingsSection: t.maybe(navigationSettingsSectionValidator),
selectedUserList: t.maybe(t.list(accountUserInfoValidator)),
chatMode: t.maybe(navigationChatModeValidator),
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
@@ -12,7 +12,7 @@
} from 'lib/shared/thread-utils.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import { type ThreadInfo } from 'lib/types/thread-types.js';
+import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
import type { AccountUserInfo } from 'lib/types/user-types.js';
import { useSelector } from '../redux/redux-utils.js';
@@ -40,7 +40,7 @@
function useThreadInfoForPossiblyPendingThread(
activeChatThreadID: ?string,
-): ?ThreadInfo | ?MinimallyEncodedThreadInfo {
+): ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo {
const { isChatCreation, selectedUserInfos } = useInfosForPendingThread();
const loggedInUserInfo = useLoggedInUserInfo();
diff --git a/web/utils/tooltip-action-utils.js b/web/utils/tooltip-action-utils.js
--- a/web/utils/tooltip-action-utils.js
+++ b/web/utils/tooltip-action-utils.js
@@ -19,7 +19,7 @@
import { messageTypes } from 'lib/types/message-types-enum.js';
import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import type { ThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
import { longAbsoluteDate } from 'lib/utils/date-utils.js';
import { canToggleMessagePin } from 'lib/utils/toggle-pin-utils.js';
@@ -128,7 +128,7 @@
function useMessageTooltipSidebarAction(
item: ChatMessageInfoItem,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): ?MessageTooltipAction {
const { threadCreatedFromMessage, messageInfo } = item;
const { popModal } = useModalContext();
@@ -170,7 +170,7 @@
function useMessageTooltipReplyAction(
item: ChatMessageInfoItem,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): ?MessageTooltipAction {
const { messageInfo } = item;
const { popModal } = useModalContext();
@@ -235,7 +235,7 @@
function useMessageReactAction(
item: ChatMessageInfoItem,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): ?MessageTooltipAction {
const { messageInfo } = item;
@@ -270,7 +270,7 @@
function useMessageTogglePinAction(
item: ChatMessageInfoItem,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): ?MessageTooltipAction {
const { pushModal } = useModalContext();
const { messageInfo, isPinned } = item;
@@ -306,7 +306,7 @@
function useMessageEditAction(
item: ChatMessageInfoItem,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): ?MessageTooltipAction {
const { messageInfo } = item;
@@ -349,7 +349,7 @@
function useMessageTooltipActions(
item: ChatMessageInfoItem,
- threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
): $ReadOnlyArray<MessageTooltipAction> {
const sidebarAction = useMessageTooltipSidebarAction(item, threadInfo);
const replyAction = useMessageTooltipReplyAction(item, threadInfo);
@@ -386,7 +386,7 @@
type UseMessageTooltipArgs = {
+availablePositions: $ReadOnlyArray<TooltipPosition>,
+item: ChatMessageInfoItem,
- +threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
};
function useMessageTooltip({

File Metadata

Mime Type
text/plain
Expires
Fri, Nov 29, 11:47 PM (20 h, 7 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2598657
Default Alt Text
D10095.diff (258 KB)

Event Timeline