Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3528276
D10729.id36296.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
4 KB
Referenced Files
None
Subscribers
None
D10729.id36296.diff
View Options
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
@@ -19,7 +19,6 @@
} 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 { LegacyRelativeMemberInfo } from '../types/thread-types';
import type { UserInfo } from '../types/user-types.js';
import { getConfig } from '../utils/config.js';
import { values } from '../utils/objects.js';
@@ -84,16 +83,14 @@
const useENSNamesOptions = { allAtOnce: true };
function useUserSearchIndex(
- userInfos: $ReadOnlyArray<
- UserInfo | LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ userInfos: $ReadOnlyArray<UserInfo | MinimallyEncodedRelativeMemberInfo>,
): SearchIndex {
const membersWithENSNames = useENSNames(userInfos, useENSNamesOptions);
const memberMap = React.useMemo(() => {
const result = new Map<
string,
- UserInfo | LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ UserInfo | MinimallyEncodedRelativeMemberInfo,
>();
for (const userInfo of membersWithENSNames) {
result.set(userInfo.id, userInfo);
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
@@ -13,10 +13,7 @@
ThreadInfo,
} from '../types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
-import type {
- ChatMentionCandidates,
- LegacyRelativeMemberInfo,
-} from '../types/thread-types.js';
+import type { ChatMentionCandidates } from '../types/thread-types.js';
import { chatNameMaxLength, idSchemaRegex } from '../utils/validation-utils.js';
export type TypeaheadMatchedStrings = {
@@ -31,7 +28,7 @@
type MentionTypeaheadUserSuggestionItem = {
+type: 'user',
- +userInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ +userInfo: MinimallyEncodedRelativeMemberInfo,
};
type MentionTypeaheadChatSuggestionItem = {
@@ -108,9 +105,7 @@
const useENSNamesOptions = { allAtOnce: true };
function useMentionTypeaheadUserSuggestions(
- threadMembers: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ threadMembers: $ReadOnlyArray<MinimallyEncodedRelativeMemberInfo>,
typeaheadMatchedStrings: ?TypeaheadMatchedStrings,
): $ReadOnlyArray<MentionTypeaheadUserSuggestionItem> {
const userSearchIndex = useUserSearchIndex(threadMembers);
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
@@ -90,7 +90,6 @@
} from '../types/thread-types-enum.js';
import type {
LegacyRawThreadInfo,
- LegacyRelativeMemberInfo,
MemberInfo,
ServerThreadInfo,
RoleInfo,
@@ -1515,7 +1514,7 @@
function removeMemberFromThread(
threadInfo: ThreadInfo,
- memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ memberInfo: MinimallyEncodedRelativeMemberInfo,
dispatchActionPromise: DispatchActionPromise,
removeUserFromThreadServerCall: (
input: RemoveUsersFromThreadInput,
@@ -1533,7 +1532,7 @@
}
function getAvailableThreadMemberActions(
- memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ memberInfo: MinimallyEncodedRelativeMemberInfo,
threadInfo: ThreadInfo,
canEdit: ?boolean = true,
): $ReadOnlyArray<'change_role' | 'remove_user'> {
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
@@ -54,12 +54,6 @@
export type MemberInfo = LegacyMemberInfo | MinimallyEncodedMemberInfo;
-export type LegacyRelativeMemberInfo = $ReadOnly<{
- ...LegacyMemberInfo,
- +username: ?string,
- +isViewer: boolean,
-}>;
-
export type LegacyRoleInfo = {
+id: string,
+name: string,
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
@@ -13,7 +13,7 @@
type ThreadRolePermissionsBlob,
type UserSurfacedPermission,
} from '../types/thread-permission-types.js';
-import type { LegacyRelativeMemberInfo, RoleInfo } from '../types/thread-types';
+import type { RoleInfo } from '../types/thread-types';
import { threadTypes } from '../types/thread-types-enum.js';
function constructRoleDeletionMessagePrompt(
@@ -57,9 +57,7 @@
function useRolesFromCommunityThreadInfo(
threadInfo: ThreadInfo,
- memberInfos: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ memberInfos: $ReadOnlyArray<MinimallyEncodedRelativeMemberInfo>,
): $ReadOnlyMap<string, ?RoleInfo> {
// Our in-code system has chat-specific roles, while the
// user-surfaced system has roles only for communities. We retrieve roles
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Dec 25, 8:52 AM (10 h, 35 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2699309
Default Alt Text
D10729.id36296.diff (4 KB)
Attached To
Mode
D10729: [lib] Remove all remaining instances of `LegacyRelativeMemberInfo` from codebase
Attached
Detach File
Event Timeline
Log In to Comment