Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3385214
D10123.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
80 KB
Referenced Files
None
Subscribers
None
D10123.diff
View Options
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
@@ -6,11 +6,7 @@
import { ActivityIndicator, TouchableOpacity, View } from 'react-native';
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,
- LegacyThreadInfo,
-} from 'lib/types/thread-types.js';
+import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
import {
useNativeSetThreadAvatar,
@@ -26,7 +22,7 @@
import { useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: RawThreadInfo | ThreadInfo,
+disabled?: boolean,
};
function EditThreadAvatar(props: Props): React.Node {
diff --git a/native/avatars/thread-avatar.react.js b/native/avatars/thread-avatar.react.js
--- a/native/avatars/thread-avatar.react.js
+++ b/native/avatars/thread-avatar.react.js
@@ -8,15 +8,12 @@
} from 'lib/shared/avatar-utils.js';
import { getSingleOtherUser } from 'lib/shared/thread-utils.js';
import type { AvatarSize } from 'lib/types/avatar-types.js';
-import type {
- MinimallyEncodedResolvedThreadInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
import type {
- LegacyThreadInfo,
ResolvedThreadInfo,
RawThreadInfo,
+ ThreadInfo,
} from 'lib/types/thread-types.js';
import Avatar from './avatar.react.js';
@@ -25,9 +22,8 @@
type Props = {
+threadInfo:
| RawThreadInfo
- | LegacyThreadInfo
+ | ThreadInfo
| ResolvedThreadInfo
- | MinimallyEncodedThreadInfo
| MinimallyEncodedResolvedThreadInfo,
+size: AvatarSize,
};
diff --git a/native/chat/chat-context-provider.react.js b/native/chat/chat-context-provider.react.js
--- a/native/chat/chat-context-provider.react.js
+++ b/native/chat/chat-context-provider.react.js
@@ -2,8 +2,7 @@
import * as React from 'react';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { ChatContext } from './chat-context.js';
import type { SidebarAnimationType } from './chat-context.js';
@@ -17,7 +16,7 @@
export type MeasurementTask = {
+messages: $ReadOnlyArray<NativeChatMessageItem>,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+onMessagesMeasured: (
messagesWithHeight: $ReadOnlyArray<ChatMessageItemWithHeight>,
measuredHeights: $ReadOnlyMap<string, number>,
@@ -38,7 +37,7 @@
const measureMessages = React.useCallback(
(
messages: ?$ReadOnlyArray<NativeChatMessageItem>,
- threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ?ThreadInfo,
onMessagesMeasured: ($ReadOnlyArray<ChatMessageItemWithHeight>) => mixed,
measurerID: number,
) => {
@@ -94,7 +93,7 @@
return {
measure: (
messages: ?$ReadOnlyArray<NativeChatMessageItem>,
- threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ?ThreadInfo,
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
@@ -4,15 +4,14 @@
import * as React from 'react';
import type { SetState } from 'lib/types/hook-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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>,
- ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ ?ThreadInfo,
($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
@@ -71,7 +71,6 @@
SendEditMessageResponse,
MessageInfo,
} from 'lib/types/message-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { Dispatch } from 'lib/types/redux-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import type {
@@ -80,6 +79,7 @@
ThreadJoinPayload,
ChatMentionCandidates,
RelativeMemberInfo,
+ ThreadInfo,
} from 'lib/types/thread-types.js';
import { type UserInfos } from 'lib/types/user-types.js';
import {
@@ -274,7 +274,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
type Props = {
...BaseProps,
diff --git a/native/chat/chat-router.js b/native/chat/chat-router.js
--- a/native/chat/chat-router.js
+++ b/native/chat/chat-router.js
@@ -11,8 +11,7 @@
} from '@react-navigation/core';
import { StackRouter, CommonActions } from '@react-navigation/native';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
import { createNavigateToThreadAction } from './message-list-types.js';
import {
@@ -64,13 +63,9 @@
export type ChatRouterNavigationHelpers = {
+clearScreens: (routeNames: $ReadOnlyArray<string>) => void,
- +replaceWithThread: (
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ) => void,
+ +replaceWithThread: (threadInfo: ThreadInfo) => void,
+clearThreads: (threadIDs: $ReadOnlyArray<string>) => void,
- +pushNewThread: (
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ) => void,
+ +pushNewThread: (threadInfo: ThreadInfo) => void,
};
function ChatRouter(
diff --git a/native/chat/chat-thread-list.react.js b/native/chat/chat-thread-list.react.js
--- a/native/chat/chat-thread-list.react.js
+++ b/native/chat/chat-thread-list.react.js
@@ -31,9 +31,8 @@
getThreadListSearchResults,
useThreadListSearch,
} 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 { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types.js';
import { ChatThreadListItem } from './chat-thread-list-item.react.js';
@@ -77,9 +76,7 @@
+route:
| NavigationRoute<'HomeChatThreadList'>
| NavigationRoute<'BackgroundChatThreadList'>,
- +filterThreads: (
- threadItem: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ) => boolean,
+ +filterThreads: (threadItem: ThreadInfo) => boolean,
+emptyItem?: React.ComponentType<{}>,
};
export type SearchStatus = 'inactive' | 'activating' | 'active';
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
@@ -19,9 +19,8 @@
} from 'lib/selectors/user-selectors.js';
import { getPotentialMemberItems } from 'lib/shared/search-utils.js';
import { threadInFilterList, userIsMember } from 'lib/shared/thread-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { type ThreadType, threadTypes } from 'lib/types/thread-types-enum.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo, 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 +52,7 @@
export type ComposeSubchannelParams = {
+threadType: ThreadType,
- +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: ThreadInfo,
};
type Props = {
diff --git a/native/chat/fullscreen-thread-media-gallery.react.js b/native/chat/fullscreen-thread-media-gallery.react.js
--- a/native/chat/fullscreen-thread-media-gallery.react.js
+++ b/native/chat/fullscreen-thread-media-gallery.react.js
@@ -3,8 +3,7 @@
import * as React from 'react';
import { Text, View, TouchableOpacity } from 'react-native';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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 +12,7 @@
import type { VerticalBounds } from '../types/layout-types.js';
export type FullScreenThreadMediaGalleryParams = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
const Tabs = {
diff --git a/native/chat/image-paste-modal.react.js b/native/chat/image-paste-modal.react.js
--- a/native/chat/image-paste-modal.react.js
+++ b/native/chat/image-paste-modal.react.js
@@ -6,8 +6,7 @@
import filesystem from 'react-native-fs';
import type { PhotoPaste } from 'lib/types/media-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import sleep from 'lib/utils/sleep.js';
import Modal from '../components/modal.react.js';
@@ -18,7 +17,7 @@
export type ImagePasteModalParams = {
+imagePasteStagingInfo: PhotoPaste,
- +thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +thread: ThreadInfo,
};
const safeAreaEdges = ['top'];
diff --git a/native/chat/inline-engagement.react.js b/native/chat/inline-engagement.react.js
--- a/native/chat/inline-engagement.react.js
+++ b/native/chat/inline-engagement.react.js
@@ -13,8 +13,7 @@
import { getInlineEngagementSidebarText } from 'lib/shared/inline-engagement-utils.js';
import { useNextLocalID } from 'lib/shared/message-utils.js';
import type { MessageInfo } from 'lib/types/message-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import {
inlineEngagementLabelStyle,
@@ -33,7 +32,7 @@
import type { ChatMessageInfoItemWithHeight } from '../types/chat-types.js';
function dummyNodeForInlineEngagementHeightMeasurement(
- sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarInfo: ?ThreadInfo,
reactions: ReactionInfo,
): React.Element<typeof View> {
return (
@@ -49,7 +48,7 @@
type DummyInlineEngagementNodeProps = {
...React.ElementConfig<typeof View>,
+editedLabel?: ?string,
- +sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +sidebarInfo: ?ThreadInfo,
+reactions: ReactionInfo,
};
function DummyInlineEngagementNode(
@@ -129,8 +128,8 @@
type Props = {
+messageInfo: MessageInfo,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- +sidebarThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+ +sidebarThreadInfo: ?ThreadInfo,
+reactions: ReactionInfo,
+disabled?: boolean,
+positioning?: 'left' | 'right' | 'center',
diff --git a/native/chat/inner-robotext-message.react.js b/native/chat/inner-robotext-message.react.js
--- a/native/chat/inner-robotext-message.react.js
+++ b/native/chat/inner-robotext-message.react.js
@@ -6,8 +6,7 @@
import type { ReactionInfo } from 'lib/selectors/chat-selectors.js';
import { threadInfoSelector } from 'lib/selectors/thread-selectors.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import {
entityTextToReact,
entityTextToRawString,
@@ -27,7 +26,7 @@
function dummyNodeForRobotextMessageHeightMeasurement(
robotext: EntityText,
threadID: string,
- sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarInfo: ?ThreadInfo,
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
@@ -6,8 +6,7 @@
import type { ReactionInfo } from 'lib/selectors/chat-selectors.js';
import { colorIsDark } from 'lib/shared/color-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { useComposedMessageMaxWidth } from './composed-message-width.js';
import { DummyInlineEngagementNode } from './inline-engagement.react.js';
@@ -34,7 +33,7 @@
function dummyNodeForTextMessageHeightMeasurement(
text: string,
editedLabel?: ?string,
- sidebarInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarInfo: ?ThreadInfo,
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
@@ -20,8 +20,7 @@
useExistingThreadInfoFinder,
pendingThreadType,
} from 'lib/shared/thread-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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 +88,8 @@
+updateTagInput: (items: $ReadOnlyArray<AccountUserInfo>) => void,
+resolveToUser: (user: AccountUserInfo) => void,
+userSearchResults: $ReadOnlyArray<UserListItem>,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- +genesisThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+ +genesisThreadInfo: ?ThreadInfo,
+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
@@ -5,8 +5,7 @@
import * as React from 'react';
import { View } from 'react-native';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import { firstLine } from 'lib/utils/string-utils.js';
@@ -31,7 +30,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+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
@@ -6,8 +6,7 @@
import * as React from 'react';
import { useThreadChatMentionCandidates } from 'lib/hooks/chat-mention-hooks.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
import { type UserInfo } from 'lib/types/user-types.js';
import { ChatContext } from './chat-context.js';
@@ -20,7 +19,7 @@
} from '../navigation/route-names.js';
export type MessageListParams = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+pendingPersonalThreadUserInfo?: UserInfo,
+searching?: boolean,
+removeEditMode?: ?RemoveEditMode,
@@ -37,9 +36,7 @@
const MessageListContext: React.Context<?MessageListContextType> =
React.createContext<?MessageListContextType>();
-function useMessageListContext(
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
-) {
+function useMessageListContext(threadInfo: ThreadInfo) {
const chatMentionCandidates = useThreadChatMentionCandidates(threadInfo);
const getTextMessageMarkdownRules = useTextMessageRulesFunc(
threadInfo,
@@ -55,7 +52,7 @@
type Props = {
+children: React.Node,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
function MessageListContextProvider(props: Props): React.Node {
const context = useMessageListContext(props.threadInfo);
diff --git a/native/chat/message-list.react.js b/native/chat/message-list.react.js
--- a/native/chat/message-list.react.js
+++ b/native/chat/message-list.react.js
@@ -19,9 +19,8 @@
import { messageKey } from 'lib/shared/message-utils.js';
import { useWatchThread } from 'lib/shared/thread-utils.js';
import type { FetchMessageInfosPayload } from 'lib/types/message-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
useDispatchActionPromise,
@@ -69,7 +68,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+messageListData: $ReadOnlyArray<ChatMessageItemWithHeight>,
+navigation: ChatNavigationProp<'MessageList'>,
+route: NavigationRoute<'MessageList'>,
diff --git a/native/chat/message-result.react.js b/native/chat/message-result.react.js
--- a/native/chat/message-result.react.js
+++ b/native/chat/message-result.react.js
@@ -4,8 +4,7 @@
import { Text, View } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { longAbsoluteDate } from 'lib/utils/date-utils.js';
import { type ChatNavigationProp } from './chat.react.js';
@@ -20,7 +19,7 @@
type MessageResultProps = {
+item: ChatMessageInfoItemWithHeight,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+navigation:
| AppNavigationProp<'TogglePinModal'>
| ChatNavigationProp<'MessageResultsScreen'>
diff --git a/native/chat/message-results-screen.react.js b/native/chat/message-results-screen.react.js
--- a/native/chat/message-results-screen.react.js
+++ b/native/chat/message-results-screen.react.js
@@ -15,8 +15,7 @@
isInvalidPinSourceForThread,
} from 'lib/shared/message-utils.js';
import type { RawMessageInfo } from 'lib/types/message-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { useHeightMeasurer } from './chat-context.js';
import type { ChatNavigationProp } from './chat.react';
@@ -29,7 +28,7 @@
import type { VerticalBounds } from '../types/layout-types.js';
export type MessageResultsScreenParams = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
type MessageResultsScreenProps = {
diff --git a/native/chat/parent-thread-header.react.js b/native/chat/parent-thread-header.react.js
--- a/native/chat/parent-thread-header.react.js
+++ b/native/chat/parent-thread-header.react.js
@@ -4,9 +4,8 @@
import { View, Text } from 'react-native';
import { ScrollView } from 'react-native-gesture-handler';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { ThreadType } from 'lib/types/thread-types-enum.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { useNavigateToThread } from './message-list-types.js';
import Button from '../components/button.react.js';
@@ -15,7 +14,7 @@
import { useColors, useStyles } from '../themes/colors.js';
type Props = {
- +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: ThreadInfo,
+childThreadType: ThreadType,
};
function ParentThreadHeader(props: Props): React.Node {
diff --git a/native/chat/relationship-prompt.react.js b/native/chat/relationship-prompt.react.js
--- a/native/chat/relationship-prompt.react.js
+++ b/native/chat/relationship-prompt.react.js
@@ -5,9 +5,8 @@
import { Text, View } from 'react-native';
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types.js';
import Button from '../components/button.react.js';
@@ -16,7 +15,7 @@
type Props = {
+pendingPersonalThreadUserInfo: ?UserInfo,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
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
@@ -16,8 +16,7 @@
} from 'lib/selectors/user-selectors.js';
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 LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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 +45,7 @@
export type AddUsersModalParams = {
+presentedFrom: string,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
type Props = {
diff --git a/native/chat/settings/color-selector-modal.react.js b/native/chat/settings/color-selector-modal.react.js
--- a/native/chat/settings/color-selector-modal.react.js
+++ b/native/chat/settings/color-selector-modal.react.js
@@ -8,11 +8,10 @@
changeThreadSettingsActionTypes,
useChangeThreadSettings,
} from 'lib/actions/thread-actions.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
- type LegacyThreadInfo,
type ChangeThreadSettingsPayload,
type UpdateThreadRequest,
+ type ThreadInfo,
} from 'lib/types/thread-types.js';
import type { DispatchActionPromise } from 'lib/utils/action-utils.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
@@ -28,7 +27,7 @@
export type ColorSelectorModalParams = {
+presentedFrom: string,
+color: string,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+setColor: (color: string) => void,
};
diff --git a/native/chat/settings/compose-subchannel-modal.react.js b/native/chat/settings/compose-subchannel-modal.react.js
--- a/native/chat/settings/compose-subchannel-modal.react.js
+++ b/native/chat/settings/compose-subchannel-modal.react.js
@@ -5,9 +5,8 @@
import { Text } from 'react-native';
import { threadTypeDescriptions } from 'lib/shared/thread-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import Button from '../../components/button.react.js';
import Modal from '../../components/modal.react.js';
@@ -19,7 +18,7 @@
export type ComposeSubchannelModalParams = {
+presentedFrom: string,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
const unboundStyles = {
diff --git a/native/chat/settings/delete-thread.react.js b/native/chat/settings/delete-thread.react.js
--- a/native/chat/settings/delete-thread.react.js
+++ b/native/chat/settings/delete-thread.react.js
@@ -25,14 +25,11 @@
getThreadsToDeleteText,
} from 'lib/shared/thread-utils.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
+import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- MinimallyEncodedResolvedThreadInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyThreadInfo,
ResolvedThreadInfo,
LeaveThreadPayload,
+ ThreadInfo,
} from 'lib/types/thread-types.js';
import {
useDispatchActionPromise,
@@ -53,7 +50,7 @@
import type { ChatNavigationProp } from '../chat.react.js';
export type DeleteThreadParams = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
const unboundStyles = {
diff --git a/native/chat/settings/emoji-thread-avatar-creation.react.js b/native/chat/settings/emoji-thread-avatar-creation.react.js
--- a/native/chat/settings/emoji-thread-avatar-creation.react.js
+++ b/native/chat/settings/emoji-thread-avatar-creation.react.js
@@ -6,11 +6,7 @@
import { EditThreadAvatarContext } from 'lib/components/base-edit-thread-avatar-provider.react.js';
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,
- LegacyThreadInfo,
-} from 'lib/types/thread-types.js';
+import type { RawThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
import { useNativeSetThreadAvatar } from '../../avatars/avatar-hooks.js';
import EmojiAvatarCreation from '../../avatars/emoji-avatar-creation.react.js';
@@ -20,7 +16,7 @@
import { useSelector } from '../../redux/redux-utils.js';
export type EmojiThreadAvatarCreationParams = {
- +threadInfo: RawThreadInfo | LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: RawThreadInfo | ThreadInfo,
};
type Props = {
diff --git a/native/chat/settings/thread-settings-child-thread.react.js b/native/chat/settings/thread-settings-child-thread.react.js
--- a/native/chat/settings/thread-settings-child-thread.react.js
+++ b/native/chat/settings/thread-settings-child-thread.react.js
@@ -3,8 +3,7 @@
import * as React from 'react';
import { View, Platform } from 'react-native';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import ThreadAvatar from '../../avatars/thread-avatar.react.js';
import Button from '../../components/button.react.js';
@@ -14,7 +13,7 @@
import { useNavigateToThread } from '../message-list-types.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+firstListItem: boolean,
+lastListItem: boolean,
};
diff --git a/native/chat/settings/thread-settings-color.react.js b/native/chat/settings/thread-settings-color.react.js
--- a/native/chat/settings/thread-settings-color.react.js
+++ b/native/chat/settings/thread-settings-color.react.js
@@ -6,8 +6,7 @@
import { changeThreadSettingsActionTypes } from 'lib/actions/thread-actions.js';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { ThreadSettingsNavigate } from './thread-settings.react.js';
import ColorSplotch from '../../components/color-splotch.react.js';
@@ -39,7 +38,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+colorEditValue: string,
+setColorEditValue: (color: string) => void,
+canChangeSettings: boolean,
diff --git a/native/chat/settings/thread-settings-description.react.js b/native/chat/settings/thread-settings-description.react.js
--- a/native/chat/settings/thread-settings-description.react.js
+++ b/native/chat/settings/thread-settings-description.react.js
@@ -16,12 +16,11 @@
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
import { threadHasPermission } from 'lib/shared/thread-utils.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import {
- type LegacyThreadInfo,
type ChangeThreadSettingsPayload,
type UpdateThreadRequest,
+ type ThreadInfo,
} from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
@@ -88,7 +87,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+descriptionEditValue: ?string,
+setDescriptionEditValue: (value: ?string, callback?: () => void) => void,
+descriptionTextHeight: ?number,
diff --git a/native/chat/settings/thread-settings-edit-relationship.react.js b/native/chat/settings/thread-settings-edit-relationship.react.js
--- a/native/chat/settings/thread-settings-edit-relationship.react.js
+++ b/native/chat/settings/thread-settings-edit-relationship.react.js
@@ -14,12 +14,11 @@
getRelationshipDispatchAction,
} from 'lib/shared/relationship-utils.js';
import { getSingleOtherUser } from 'lib/shared/thread-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
type RelationshipAction,
type RelationshipButton,
} from 'lib/types/relationship-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import {
useDispatchActionPromise,
useServerCall,
@@ -32,7 +31,7 @@
import Alert from '../../utils/alert.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+buttonStyle: ViewStyle,
+relationshipButton: RelationshipButton,
};
diff --git a/native/chat/settings/thread-settings-home-notifs.react.js b/native/chat/settings/thread-settings-home-notifs.react.js
--- a/native/chat/settings/thread-settings-home-notifs.react.js
+++ b/native/chat/settings/thread-settings-home-notifs.react.js
@@ -7,12 +7,11 @@
updateSubscriptionActionTypes,
useUpdateSubscription,
} from 'lib/actions/user-actions.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
SubscriptionUpdateRequest,
SubscriptionUpdateResult,
} from 'lib/types/subscription-types.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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 +41,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
type Props = {
...BaseProps,
diff --git a/native/chat/settings/thread-settings-leave-thread.react.js b/native/chat/settings/thread-settings-leave-thread.react.js
--- a/native/chat/settings/thread-settings-leave-thread.react.js
+++ b/native/chat/settings/thread-settings-leave-thread.react.js
@@ -13,11 +13,7 @@
import { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors.js';
import { identifyInvalidatedThreads } from 'lib/shared/thread-utils.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyThreadInfo,
- LeaveThreadPayload,
-} from 'lib/types/thread-types.js';
+import type { LeaveThreadPayload, ThreadInfo } from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
useDispatchActionPromise,
@@ -52,7 +48,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+buttonStyle: ViewStyle,
};
type Props = {
diff --git a/native/chat/settings/thread-settings-member-tooltip-modal.react.js b/native/chat/settings/thread-settings-member-tooltip-modal.react.js
--- a/native/chat/settings/thread-settings-member-tooltip-modal.react.js
+++ b/native/chat/settings/thread-settings-member-tooltip-modal.react.js
@@ -5,11 +5,7 @@
import { useRemoveUsersFromThread } from 'lib/actions/thread-actions.js';
import { removeMemberFromThread } from 'lib/shared/thread-utils.js';
import { stringForUser } from 'lib/shared/user-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyThreadInfo,
- RelativeMemberInfo,
-} from 'lib/types/thread-types.js';
+import type { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types.js';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import ThreadSettingsMemberTooltipButton from './thread-settings-member-tooltip-button.react.js';
@@ -26,7 +22,7 @@
export type ThreadSettingsMemberTooltipModalParams = TooltipParams<{
+memberInfo: RelativeMemberInfo,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
}>;
function useOnRemoveUser(
diff --git a/native/chat/settings/thread-settings-member.react.js b/native/chat/settings/thread-settings-member.react.js
--- a/native/chat/settings/thread-settings-member.react.js
+++ b/native/chat/settings/thread-settings-member.react.js
@@ -19,11 +19,7 @@
import { getAvailableThreadMemberActions } from 'lib/shared/thread-utils.js';
import { stringForUser } from 'lib/shared/user-utils.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import {
- type LegacyThreadInfo,
- type RelativeMemberInfo,
-} from 'lib/types/thread-types.js';
+import type { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types.js';
import { useRolesFromCommunityThreadInfo } from 'lib/utils/role-utils.js';
import type { ThreadSettingsNavigate } from './thread-settings.react.js';
@@ -91,7 +87,7 @@
type BaseProps = {
+memberInfo: RelativeMemberInfo,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+canEdit: boolean,
+navigate: ThreadSettingsNavigate,
+firstListItem: boolean,
diff --git a/native/chat/settings/thread-settings-parent.react.js b/native/chat/settings/thread-settings-parent.react.js
--- a/native/chat/settings/thread-settings-parent.react.js
+++ b/native/chat/settings/thread-settings-parent.react.js
@@ -3,8 +3,7 @@
import * as React from 'react';
import { Text, View } from 'react-native';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import ThreadAvatar from '../../avatars/thread-avatar.react.js';
import Button from '../../components/button.react.js';
@@ -13,7 +12,7 @@
import { useNavigateToThread } from '../message-list-types.js';
type ParentButtonProps = {
- +parentThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +parentThreadInfo: ThreadInfo,
};
function ParentButton(props: ParentButtonProps): React.Node {
const styles = useStyles(unboundStyles);
@@ -35,8 +34,8 @@
}
type ThreadSettingsParentProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- +parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+ +parentThreadInfo: ?ThreadInfo,
};
function ThreadSettingsParent(props: ThreadSettingsParentProps): React.Node {
const { threadInfo, parentThreadInfo } = props;
diff --git a/native/chat/settings/thread-settings-promote-sidebar.react.js b/native/chat/settings/thread-settings-promote-sidebar.react.js
--- a/native/chat/settings/thread-settings-promote-sidebar.react.js
+++ b/native/chat/settings/thread-settings-promote-sidebar.react.js
@@ -5,8 +5,7 @@
import { usePromoteSidebar } from 'lib/hooks/promote-sidebar.react.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import Button from '../../components/button.react.js';
import { type Colors, useColors, useStyles } from '../../themes/colors.js';
@@ -31,7 +30,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+buttonStyle: ViewStyle,
};
type Props = {
diff --git a/native/chat/settings/thread-settings-push-notifs.react.js b/native/chat/settings/thread-settings-push-notifs.react.js
--- a/native/chat/settings/thread-settings-push-notifs.react.js
+++ b/native/chat/settings/thread-settings-push-notifs.react.js
@@ -9,12 +9,11 @@
useUpdateSubscription,
} from 'lib/actions/user-actions.js';
import { deviceTokenSelector } from 'lib/selectors/keyserver-selectors.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
SubscriptionUpdateRequest,
SubscriptionUpdateResult,
} from 'lib/types/subscription-types.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { DispatchActionPromise } from 'lib/utils/action-utils.js';
import {
useDispatchActionPromise,
@@ -54,7 +53,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
type Props = {
...BaseProps,
diff --git a/native/chat/settings/thread-settings-visibility.react.js b/native/chat/settings/thread-settings-visibility.react.js
--- a/native/chat/settings/thread-settings-visibility.react.js
+++ b/native/chat/settings/thread-settings-visibility.react.js
@@ -3,14 +3,13 @@
import * as React from 'react';
import { Text, View } from 'react-native';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import ThreadVisibility from '../../components/thread-visibility.react.js';
import { useStyles, useColors } from '../../themes/colors.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
function ThreadSettingsVisibility(props: Props): React.Node {
const styles = useStyles(unboundStyles);
diff --git a/native/chat/settings/thread-settings.react.js b/native/chat/settings/thread-settings.react.js
--- a/native/chat/settings/thread-settings.react.js
+++ b/native/chat/settings/thread-settings.react.js
@@ -33,10 +33,7 @@
threadIsChannel,
} from 'lib/shared/thread-utils.js';
import threadWatcher from 'lib/shared/thread-watcher.js';
-import type {
- MinimallyEncodedResolvedThreadInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import type { MinimallyEncodedResolvedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { RelationshipButton } from 'lib/types/relationship-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
import { threadTypes } from 'lib/types/thread-types-enum.js';
@@ -44,6 +41,7 @@
type LegacyThreadInfo,
type ResolvedThreadInfo,
type RelativeMemberInfo,
+ type ThreadInfo,
} from 'lib/types/thread-types.js';
import type { UserInfos } from 'lib/types/user-types.js';
import {
@@ -110,7 +108,7 @@
const itemPageLength = 5;
export type ThreadSettingsParams = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
export type ThreadSettingsNavigate = $PropertyType<
@@ -225,7 +223,7 @@
| {
+itemType: 'mediaGallery',
+key: string,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+limit: number,
+verticalBounds: ?VerticalBounds,
}
@@ -710,10 +708,7 @@
createSelector(
(propsAndState: PropsAndState) => propsAndState.threadInfo,
(propsAndState: PropsAndState) => propsAndState.verticalBounds,
- (
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- verticalBounds: ?VerticalBounds,
- ) => {
+ (threadInfo: ThreadInfo, verticalBounds: ?VerticalBounds) => {
const listData: ChatSettingsItem[] = [];
const limit = 6;
@@ -1186,7 +1181,7 @@
setParams({ threadInfo: reduxThreadInfo });
}
}, [reduxThreadInfo, setParams]);
- const threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo =
+ const threadInfo: ThreadInfo =
reduxThreadInfo ?? props.route.params.threadInfo;
const resolvedThreadInfo = useResolvedThreadInfo(threadInfo);
diff --git a/native/chat/sidebar-navigation.js b/native/chat/sidebar-navigation.js
--- a/native/chat/sidebar-navigation.js
+++ b/native/chat/sidebar-navigation.js
@@ -10,10 +10,9 @@
createPendingSidebar,
createUnresolvedPendingSidebar,
} from 'lib/shared/thread-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- LegacyThreadInfo,
ChatMentionCandidates,
+ ThreadInfo,
} from 'lib/types/thread-types.js';
import type { LoggedInUserInfo } from 'lib/types/user-types.js';
import type { GetENSNames } from 'lib/utils/ens-helpers.js';
@@ -30,7 +29,7 @@
};
function getUnresolvedSidebarThreadInfo(
input: GetUnresolvedSidebarThreadInfoInput,
-): ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo {
+): ?ThreadInfo {
const { sourceMessage, loggedInUserInfo, chatMentionCandidates } = input;
const threadCreatedFromMessage = sourceMessage.threadCreatedFromMessage;
if (threadCreatedFromMessage) {
@@ -57,7 +56,7 @@
};
async function getSidebarThreadInfo(
input: GetSidebarThreadInfoInput,
-): Promise<?LegacyThreadInfo | ?MinimallyEncodedThreadInfo> {
+): Promise<?ThreadInfo> {
const {
sourceMessage,
loggedInUserInfo,
diff --git a/native/chat/thread-settings-button.react.js b/native/chat/thread-settings-button.react.js
--- a/native/chat/thread-settings-button.react.js
+++ b/native/chat/thread-settings-button.react.js
@@ -2,8 +2,7 @@
import * as React from 'react';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { ChatNavigationProp } from './chat.react.js';
import Button from '../components/button.react.js';
@@ -19,7 +18,7 @@
};
type BaseProps = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+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
@@ -4,13 +4,12 @@
import { HeaderTitle } from '@react-navigation/elements';
import * as React from 'react';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import { firstLine } from 'lib/utils/string-utils.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
...HeaderTitleInputProps,
};
function ThreadSettingsHeaderTitle(props: Props): React.Node {
diff --git a/native/chat/utils.js b/native/chat/utils.js
--- a/native/chat/utils.js
+++ b/native/chat/utils.js
@@ -9,8 +9,7 @@
import { colorIsDark } from 'lib/shared/color-utils.js';
import { messageKey } from 'lib/shared/message-utils.js';
import { viewerIsMember } from 'lib/shared/thread-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { clusterEndHeight } from './chat-constants.js';
import { ChatContext, useHeightMeasurer } from './chat-context.js';
@@ -103,7 +102,7 @@
messageListVerticalBounds: VerticalBounds,
currentInputBarHeight: number,
targetInputBarHeight: number,
- sidebarThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ sidebarThreadInfo: ?ThreadInfo,
): {
+position: number,
+color: string,
diff --git a/native/components/community-actions-button.react.js b/native/components/community-actions-button.react.js
--- a/native/components/community-actions-button.react.js
+++ b/native/components/community-actions-button.react.js
@@ -8,9 +8,8 @@
import { primaryInviteLinksSelector } from 'lib/selectors/invite-links-selectors.js';
import { threadHasPermission } from 'lib/shared/thread-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import SWMansionIcon from './swmansion-icon.react.js';
import {
@@ -24,7 +23,7 @@
import { useStyles } from '../themes/colors.js';
type Props = {
- +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +community: ThreadInfo,
};
function CommunityActionsButton(props: Props): React.Node {
diff --git a/native/components/community-pill.react.js b/native/components/community-pill.react.js
--- a/native/components/community-pill.react.js
+++ b/native/components/community-pill.react.js
@@ -4,8 +4,7 @@
import { View, StyleSheet } from 'react-native';
import { useKeyserverAdmin } from 'lib/shared/user-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import CommIcon from './comm-icon.react.js';
import Pill from './pill.react.js';
@@ -15,7 +14,7 @@
const threadPillRoundCorners = { left: false, right: true };
type Props = {
- +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +community: ThreadInfo,
};
function CommunityPill(props: Props): React.Node {
const { community } = props;
diff --git a/native/components/thread-ancestors-label.react.js b/native/components/thread-ancestors-label.react.js
--- a/native/components/thread-ancestors-label.react.js
+++ b/native/components/thread-ancestors-label.react.js
@@ -5,14 +5,13 @@
import { Text, View } from 'react-native';
import { useAncestorThreads } from 'lib/shared/ancestor-threads.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfos } from 'lib/utils/entity-helpers.js';
import { useColors, useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
function ThreadAncestorsLabel(props: Props): React.Node {
const { threadInfo } = props;
diff --git a/native/components/thread-ancestors.react.js b/native/components/thread-ancestors.react.js
--- a/native/components/thread-ancestors.react.js
+++ b/native/components/thread-ancestors.react.js
@@ -6,8 +6,7 @@
import { ScrollView } from 'react-native-gesture-handler';
import { ancestorThreadInfos } from 'lib/selectors/thread-selectors.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
import Button from './button.react.js';
import CommunityPill from './community-pill.react.js';
@@ -17,7 +16,7 @@
import { useColors, useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
function ThreadAncestors(props: Props): React.Node {
diff --git a/native/components/thread-list.react.js b/native/components/thread-list.react.js
--- a/native/components/thread-list.react.js
+++ b/native/components/thread-list.react.js
@@ -6,8 +6,7 @@
import { createSelector } from 'reselect';
import SearchIndex from 'lib/shared/search-index.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { LegacyThreadInfo, ThreadInfo } from 'lib/types/thread-types.js';
import Search from './search.react.js';
import ThreadListThread from './thread-list-thread.react.js';
@@ -102,9 +101,7 @@
);
}
- static keyExtractor = (
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ): string => {
+ static keyExtractor = (threadInfo: ThreadInfo): string => {
return threadInfo.id;
};
@@ -120,7 +117,7 @@
};
static getItemLayout = (
- data: ?$ReadOnlyArray<LegacyThreadInfo | MinimallyEncodedThreadInfo>,
+ data: ?$ReadOnlyArray<ThreadInfo>,
index: number,
): { length: number, offset: number, index: number } => {
return { length: 24, offset: 24 * index, index };
diff --git a/native/components/thread-pill.react.js b/native/components/thread-pill.react.js
--- a/native/components/thread-pill.react.js
+++ b/native/components/thread-pill.react.js
@@ -2,14 +2,13 @@
import * as React from 'react';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { useResolvedThreadInfo } from 'lib/utils/entity-helpers.js';
import Pill from './pill.react.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+roundCorners?: { +left: boolean, +right: boolean },
+fontSize?: number,
};
diff --git a/native/input/input-state-container.react.js b/native/input/input-state-container.react.js
--- a/native/input/input-state-container.react.js
+++ b/native/input/input-state-container.react.js
@@ -72,7 +72,6 @@
import type { RawMediaMessageInfo } from 'lib/types/messages/media.js';
import { getMediaMessageServerDBContentsFromMedia } from 'lib/types/messages/media.js';
import type { RawTextMessageInfo } from 'lib/types/messages/text.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { Dispatch } from 'lib/types/redux-types.js';
import {
type ClientMediaMissionReportCreationRequest,
@@ -82,7 +81,7 @@
import {
type ClientNewThreadRequest,
type NewThreadResult,
- type LegacyThreadInfo,
+ type ThreadInfo,
} from 'lib/types/thread-types.js';
import {
type DispatchActionPromise,
@@ -174,10 +173,7 @@
> = [];
scrollToMessageCallbacks: Array<(messageID: string) => void> = [];
pendingThreadCreations: Map<string, Promise<string>> = new Map();
- pendingThreadUpdateHandlers: Map<
- string,
- (LegacyThreadInfo | MinimallyEncodedThreadInfo) => mixed,
- > = new Map();
+ pendingThreadUpdateHandlers: Map<string, (ThreadInfo) => mixed> = new Map();
// TODO: flip the switch
// Note that this enables Blob service for encrypted media only
useBlobServiceUploads = false;
@@ -449,8 +445,8 @@
sendTextMessage = async (
messageInfo: RawTextMessageInfo,
- inputThreadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ inputThreadInfo: ThreadInfo,
+ parentThreadInfo: ?ThreadInfo,
) => {
this.sendCallbacks.forEach(callback => callback());
@@ -546,9 +542,7 @@
);
};
- startThreadCreation(
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ): Promise<string> {
+ startThreadCreation(threadInfo: ThreadInfo): Promise<string> {
if (!threadIsPending(threadInfo.id)) {
return Promise.resolve(threadInfo.id);
}
@@ -570,8 +564,8 @@
async sendTextMessageAction(
messageInfo: RawTextMessageInfo,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
+ parentThreadInfo: ?ThreadInfo,
): Promise<SendMessagePayload> {
try {
await this.props.textMessageCreationSideEffectsFunc(
@@ -608,15 +602,13 @@
}
}
- shouldEncryptMedia(
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ): boolean {
+ shouldEncryptMedia(threadInfo: ThreadInfo): boolean {
return threadInfoInsideCommunity(threadInfo, commStaffCommunity.id);
}
sendMultimediaMessage = async (
selections: $ReadOnlyArray<NativeMediaSelection>,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
) => {
this.sendCallbacks.forEach(callback => callback());
const localMessageID = this.props.nextLocalID;
@@ -717,7 +709,7 @@
async uploadFiles(
localMessageID: string,
uploadFileInputs: $ReadOnlyArray<UploadFileInput>,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
) {
const results = await Promise.all(
uploadFileInputs.map(uploadFileInput =>
@@ -733,7 +725,7 @@
async uploadFile(
localMessageID: string,
uploadFileInput: UploadFileInput,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
): Promise<?string> {
const { ids, selection } = uploadFileInput;
const { localMediaID } = ids;
@@ -1343,8 +1335,8 @@
retryTextMessage = async (
rawMessageInfo: RawTextMessageInfo,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
+ parentThreadInfo: ?ThreadInfo,
) => {
await this.sendTextMessage(
{
@@ -1359,7 +1351,7 @@
retryMultimediaMessage = async (
rawMessageInfo: RawMultimediaMessageInfo,
localMessageID: string,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
): Promise<void> => {
const pendingUploads = this.state.pendingUploads[localMessageID] ?? {};
@@ -1573,8 +1565,8 @@
retryMessage = async (
localMessageID: string,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
+ parentThreadInfo: ?ThreadInfo,
) => {
this.sendCallbacks.forEach(callback => callback());
@@ -1672,9 +1664,7 @@
setPendingThreadUpdateHandler = (
threadID: string,
- pendingThreadUpdateHandler: ?(
- LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ) => mixed,
+ pendingThreadUpdateHandler: ?(ThreadInfo) => mixed,
) => {
if (!pendingThreadUpdateHandler) {
this.pendingThreadUpdateHandlers.delete(threadID);
diff --git a/native/input/input-state.js b/native/input/input-state.js
--- a/native/input/input-state.js
+++ b/native/input/input-state.js
@@ -4,8 +4,7 @@
import type { NativeMediaSelection } from 'lib/types/media-types.js';
import type { RawTextMessageInfo } from 'lib/types/messages/text.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
export type MultimediaProcessingStep = 'transcoding' | 'uploading';
@@ -32,12 +31,12 @@
+pendingUploads: PendingMultimediaUploads,
+sendTextMessage: (
messageInfo: RawTextMessageInfo,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
+ parentThreadInfo: ?ThreadInfo,
) => Promise<void>,
+sendMultimediaMessage: (
selections: $ReadOnlyArray<NativeMediaSelection>,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
) => Promise<void>,
+editInputMessage: (params: EditInputBarMessageParameters) => void,
+addEditInputMessageListener: (
@@ -49,8 +48,8 @@
+messageHasUploadFailure: (localMessageID: string) => boolean,
+retryMessage: (
localMessageID: string,
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- parentThreadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
+ parentThreadInfo: ?ThreadInfo,
) => Promise<void>,
+registerSendCallback: (() => void) => void,
+unregisterSendCallback: (() => void) => void,
@@ -58,9 +57,7 @@
+reportURIDisplayed: (uri: string, loaded: boolean) => void,
+setPendingThreadUpdateHandler: (
threadID: string,
- pendingThreadUpdateHandler: ?(
- LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ) => mixed,
+ pendingThreadUpdateHandler: ?(ThreadInfo) => mixed,
) => void,
+scrollToMessage: (messageKey: string) => void,
+addScrollToMessageListener: ((messageKey: string) => void) => void,
diff --git a/native/invite-links/manage-public-link-screen.react.js b/native/invite-links/manage-public-link-screen.react.js
--- a/native/invite-links/manage-public-link-screen.react.js
+++ b/native/invite-links/manage-public-link-screen.react.js
@@ -10,8 +10,7 @@
defaultErrorMessage,
inviteLinkErrorMessages,
} from 'lib/shared/invite-links.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import Button from '../components/button.react.js';
import TextInput from '../components/text-input.react.js';
@@ -22,7 +21,7 @@
import Alert from '../utils/alert.js';
export type ManagePublicLinkScreenParams = {
- +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +community: ThreadInfo,
};
type Props = {
diff --git a/native/invite-links/view-invite-links-screen.react.js b/native/invite-links/view-invite-links-screen.react.js
--- a/native/invite-links/view-invite-links-screen.react.js
+++ b/native/invite-links/view-invite-links-screen.react.js
@@ -9,9 +9,8 @@
import { primaryInviteLinksSelector } from 'lib/selectors/invite-links-selectors.js';
import { threadHasPermission } from 'lib/shared/thread-utils.js';
import type { InviteLink } from 'lib/types/link-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import SingleLine from '../components/single-line.react.js';
import SWMansionIcon from '../components/swmansion-icon.react.js';
@@ -25,7 +24,7 @@
import { useStyles, useColors } from '../themes/colors.js';
export type ViewInviteLinksScreenParams = {
- +community: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +community: ThreadInfo,
};
type Props = {
diff --git a/native/keyboard/keyboard-state-container.react.js b/native/keyboard/keyboard-state-container.react.js
--- a/native/keyboard/keyboard-state-container.react.js
+++ b/native/keyboard/keyboard-state-container.react.js
@@ -4,8 +4,7 @@
import { Platform } from 'react-native';
import { KeyboardUtils } from 'react-native-keyboard-input';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import sleep from 'lib/utils/sleep.js';
import KeyboardInputHost from './keyboard-input-host.react.js';
@@ -24,7 +23,7 @@
type State = {
+systemKeyboardShowing: boolean,
+mediaGalleryOpen: boolean,
- +mediaGalleryThread: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +mediaGalleryThread: ?ThreadInfo,
+renderKeyboardInputHost: boolean,
};
class KeyboardStateContainer extends React.PureComponent<Props, State> {
@@ -94,9 +93,7 @@
return systemKeyboardShowing || mediaGalleryOpen;
}
- showMediaGallery: (
- thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ) => void = (thread: LegacyThreadInfo | MinimallyEncodedThreadInfo) => {
+ showMediaGallery: (thread: ThreadInfo) => void = (thread: ThreadInfo) => {
this.setState({
mediaGalleryOpen: true,
mediaGalleryThread: thread,
@@ -111,8 +108,8 @@
});
};
- getMediaGalleryThread: () => ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo =
- () => this.state.mediaGalleryThread;
+ getMediaGalleryThread: () => ?ThreadInfo = () =>
+ this.state.mediaGalleryThread;
render(): React.Node {
const { systemKeyboardShowing, mediaGalleryOpen, renderKeyboardInputHost } =
diff --git a/native/keyboard/keyboard-state.js b/native/keyboard/keyboard-state.js
--- a/native/keyboard/keyboard-state.js
+++ b/native/keyboard/keyboard-state.js
@@ -2,8 +2,7 @@
import * as React from 'react';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
export type KeyboardState = {
+keyboardShowing: boolean,
@@ -11,11 +10,9 @@
+dismissKeyboardIfShowing: () => boolean,
+systemKeyboardShowing: boolean,
+mediaGalleryOpen: boolean,
- +showMediaGallery: (
- thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
- ) => void,
+ +showMediaGallery: (thread: ThreadInfo) => void,
+hideMediaGallery: () => void,
- +getMediaGalleryThread: () => ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +getMediaGalleryThread: () => ?ThreadInfo,
};
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
@@ -7,11 +7,10 @@
import * as SharedMarkdown from 'lib/shared/markdown.js';
import { chatMentionRegex } from 'lib/shared/mention-utils.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
- LegacyThreadInfo,
ChatMentionCandidates,
RelativeMemberInfo,
+ ThreadInfo,
} from 'lib/types/thread-types.js';
import MarkdownChatMention from './markdown-chat-mention.react.js';
@@ -360,7 +359,7 @@
});
function useTextMessageRulesFunc(
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
chatMentionCandidates: ChatMentionCandidates,
): (useDarkStyle: boolean) => MarkdownRules {
const { members } = threadInfo;
diff --git a/native/media/chat-camera-modal.react.js b/native/media/chat-camera-modal.react.js
--- a/native/media/chat-camera-modal.react.js
+++ b/native/media/chat-camera-modal.react.js
@@ -4,8 +4,7 @@
import * as React from 'react';
import type { PhotoCapture } from 'lib/types/media-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import CameraModal from './camera-modal.react.js';
import { InputStateContext } from '../input/input-state.js';
@@ -14,7 +13,7 @@
export type ChatCameraModalParams = {
+presentedFrom: string,
- +thread: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +thread: ThreadInfo,
};
type Props = {
diff --git a/native/media/media-gallery-keyboard.react.js b/native/media/media-gallery-keyboard.react.js
--- a/native/media/media-gallery-keyboard.react.js
+++ b/native/media/media-gallery-keyboard.react.js
@@ -22,8 +22,7 @@
} from 'lib/media/file-utils.js';
import { useIsAppForegrounded } from 'lib/shared/lifecycle-utils.js';
import type { MediaLibrarySelection } from 'lib/types/media-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { getCompatibleMediaURI } from './identifier-utils.js';
import MediaGalleryMedia from './media-gallery-media.react.js';
@@ -103,7 +102,7 @@
};
type BaseProps = {
- +threadInfo: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadInfo: ?ThreadInfo,
};
type Props = {
...BaseProps,
diff --git a/native/navigation/nav-selectors.js b/native/navigation/nav-selectors.js
--- a/native/navigation/nav-selectors.js
+++ b/native/navigation/nav-selectors.js
@@ -15,9 +15,8 @@
ComposableMessageInfo,
RobotextMessageInfo,
} 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 { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { NavContextType } from './navigation-context.js';
import { NavContext } from './navigation-context.js';
@@ -404,7 +403,7 @@
}
function useCanEditMessageNative(
- threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
targetMessageInfo: ComposableMessageInfo | RobotextMessageInfo,
): boolean {
const route = useRoute();
diff --git a/native/navigation/subchannels-button.react.js b/native/navigation/subchannels-button.react.js
--- a/native/navigation/subchannels-button.react.js
+++ b/native/navigation/subchannels-button.react.js
@@ -5,14 +5,13 @@
import * as React from 'react';
import { TouchableOpacity, Text, View } from 'react-native';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { SubchannelsListModalRouteName } from './route-names.js';
import { useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
function SubchnnelsButton(props: Props): React.Node {
diff --git a/native/roles/change-roles-screen.react.js b/native/roles/change-roles-screen.react.js
--- a/native/roles/change-roles-screen.react.js
+++ b/native/roles/change-roles-screen.react.js
@@ -12,11 +12,7 @@
import { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors.js';
import { roleIsAdminRole } from 'lib/shared/thread-utils.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- RelativeMemberInfo,
- LegacyThreadInfo,
-} from 'lib/types/thread-types.js';
+import type { RelativeMemberInfo, ThreadInfo } from 'lib/types/thread-types.js';
import { values } from 'lib/utils/objects.js';
import ChangeRolesHeaderRightButton from './change-roles-header-right-button.react.js';
@@ -28,7 +24,7 @@
import { useStyles } from '../themes/colors.js';
export type ChangeRolesScreenParams = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+memberInfo: RelativeMemberInfo,
+role: ?string,
};
diff --git a/native/roles/create-roles-screen.react.js b/native/roles/create-roles-screen.react.js
--- a/native/roles/create-roles-screen.react.js
+++ b/native/roles/create-roles-screen.react.js
@@ -7,13 +7,12 @@
import { modifyCommunityRoleActionTypes } from 'lib/actions/thread-actions.js';
import { createLoadingStatusSelector } from 'lib/selectors/loading-selectors.js';
import type { LoadingStatus } from 'lib/types/loading-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
type UserSurfacedPermissionOption,
type UserSurfacedPermission,
userSurfacedPermissionOptions,
} from 'lib/types/thread-permission-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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 +24,7 @@
import { useStyles } from '../themes/colors.js';
export type CreateRolesScreenParams = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+action: 'create_role' | 'edit_role',
+existingRoleID?: string,
+roleName: string,
diff --git a/native/roles/role-panel-entry.react.js b/native/roles/role-panel-entry.react.js
--- a/native/roles/role-panel-entry.react.js
+++ b/native/roles/role-panel-entry.react.js
@@ -6,9 +6,8 @@
import { View, Text, TouchableOpacity, Platform } from 'react-native';
import { useSafeAreaInsets } from 'react-native-safe-area-context';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type { UserSurfacedPermission } from 'lib/types/thread-permission-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import { useDisplayDeleteRoleAlert } from './role-utils.react.js';
import type { RolesNavigationProp } from './roles-navigator.react.js';
@@ -20,7 +19,7 @@
type RolePanelEntryProps = {
+navigation: RolesNavigationProp<'CommunityRolesScreen'>,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+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
@@ -6,15 +6,14 @@
useDeleteCommunityRole,
deleteCommunityRoleActionTypes,
} from 'lib/actions/thread-actions.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ threadInfo: ThreadInfo,
existingRoleID: string,
defaultRoleID: string,
memberCount: number,
diff --git a/native/search/message-search.react.js b/native/search/message-search.react.js
--- a/native/search/message-search.react.js
+++ b/native/search/message-search.react.js
@@ -12,8 +12,7 @@
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 { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import SearchFooter from './search-footer.react.js';
import { MessageSearchContext } from './search-provider.react.js';
@@ -29,7 +28,7 @@
import type { VerticalBounds } from '../types/layout-types.js';
export type MessageSearchParams = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
};
export type MessageSearchProps = {
diff --git a/native/search/search-messages-button.react.js b/native/search/search-messages-button.react.js
--- a/native/search/search-messages-button.react.js
+++ b/native/search/search-messages-button.react.js
@@ -2,8 +2,7 @@
import * as React from 'react';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import { type LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { ChatNavigationProp } from '../chat/chat.react.js';
import Button from '../components/button.react.js';
@@ -12,7 +11,7 @@
import { useStyles } from '../themes/colors.js';
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+navigate: $PropertyType<ChatNavigationProp<'MessageList'>, 'navigate'>,
};
diff --git a/native/types/chat-types.js b/native/types/chat-types.js
--- a/native/types/chat-types.js
+++ b/native/types/chat-types.js
@@ -7,8 +7,7 @@
RobotextMessageInfo,
} from 'lib/types/message-types.js';
import type { TextMessageInfo } from 'lib/types/messages/text.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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 +16,12 @@
+itemType: 'message',
+messageShapeType: 'robotext',
+messageInfo: RobotextMessageInfo,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+startsConversation: boolean,
+startsCluster: boolean,
+endsCluster: boolean,
+robotext: EntityText,
- +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadCreatedFromMessage: ?ThreadInfo,
+contentHeight: number,
+reactions: ReactionInfo,
};
@@ -32,12 +31,12 @@
+messageShapeType: 'text',
+messageInfo: TextMessageInfo,
+localMessageInfo: ?LocalMessageInfo,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+startsConversation: boolean,
+startsCluster: boolean,
+endsCluster: boolean,
+contentHeight: number,
- +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadCreatedFromMessage: ?ThreadInfo,
+reactions: ReactionInfo,
+hasBeenEdited: ?boolean,
+isPinned: ?boolean,
@@ -57,11 +56,11 @@
+messageShapeType: 'multimedia',
+messageInfo: MultimediaMessageInfo,
+localMessageInfo: ?LocalMessageInfo,
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+startsConversation: boolean,
+startsCluster: boolean,
+endsCluster: boolean,
- +threadCreatedFromMessage: ?LegacyThreadInfo | ?MinimallyEncodedThreadInfo,
+ +threadCreatedFromMessage: ?ThreadInfo,
+pendingUploads: ?MessagePendingUploads,
+reactions: ReactionInfo,
+hasBeenEdited: ?boolean,
diff --git a/native/user-profile/user-profile-menu-button.react.js b/native/user-profile/user-profile-menu-button.react.js
--- a/native/user-profile/user-profile-menu-button.react.js
+++ b/native/user-profile/user-profile-menu-button.react.js
@@ -6,9 +6,8 @@
import { View, TouchableOpacity } from 'react-native';
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 { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types';
import { userProfileMenuButtonHeight } from './user-profile-constants.js';
@@ -22,7 +21,7 @@
const onMenuButtonLayout = () => {};
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+pendingPersonalThreadUserInfo: ?UserInfo,
};
diff --git a/native/user-profile/user-profile-relationship-button.react.js b/native/user-profile/user-profile-relationship-button.react.js
--- a/native/user-profile/user-profile-relationship-button.react.js
+++ b/native/user-profile/user-profile-relationship-button.react.js
@@ -5,9 +5,8 @@
import { useRelationshipPrompt } from 'lib/hooks/relationship-prompt.js';
import type { SetState } from 'lib/types/hook-types.js';
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { userRelationshipStatus } from 'lib/types/relationship-types.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } from 'lib/types/thread-types.js';
import type { UserInfo } from 'lib/types/user-types';
import { userProfileActionButtonHeight } from './user-profile-constants.js';
@@ -20,7 +19,7 @@
};
type Props = {
- +threadInfo: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+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
@@ -1,14 +1,13 @@
// @flow
-import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadTypeIsCommunityRoot } from 'lib/types/thread-types-enum.js';
-import type { LegacyThreadInfo } from 'lib/types/thread-types.js';
+import type { ThreadInfo } 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: LegacyThreadInfo | MinimallyEncodedThreadInfo,
+ +threadInfo: ThreadInfo,
+hasSubchannelsButton: boolean,
+labelStyle: TextStyle,
+hasChildren: boolean,
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Fri, Nov 29, 11:45 PM (21 h, 15 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2598655
Default Alt Text
D10123.diff (80 KB)
Attached To
Mode
D10123: [native] Re-introduce `ThreadInfo` (`[Legacy/MinimallyEncoded]ThreadInfo`)
Attached
Detach File
Event Timeline
Log In to Comment