Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3386090
D10074.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
29 KB
Referenced Files
None
Subscribers
None
D10074.diff
View Options
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
@@ -39,10 +39,7 @@
import type { ClientAvatar, ClientEmojiAvatar } from '../types/avatar-types';
import type { EntryInfo } from '../types/entry-types.js';
import type { MessageStore, RawMessageInfo } from '../types/message-types.js';
-import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from '../types/minimally-encoded-thread-permissions-types.js';
+import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import type { BaseAppState } from '../types/redux-types.js';
import { threadPermissions } from '../types/thread-permission-types.js';
import {
@@ -53,9 +50,9 @@
import {
type ThreadInfo,
type RawThreadInfo,
- type LegacyRelativeMemberInfo,
type SidebarInfo,
type RawThreadInfos,
+ type RelativeMemberInfo,
} from '../types/thread-types.js';
import { dateString, dateFromString } from '../utils/date-utils.js';
import { values } from '../utils/objects.js';
@@ -327,9 +324,7 @@
relativeMemberInfoSelectorForMembersOfThread(threadID),
(
threadInfo: ?RawThreadInfo,
- members: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ members: $ReadOnlyArray<RelativeMemberInfo>,
): boolean => {
if (!threadInfo) {
return false;
diff --git a/lib/selectors/user-selectors.js b/lib/selectors/user-selectors.js
--- a/lib/selectors/user-selectors.js
+++ b/lib/selectors/user-selectors.js
@@ -11,7 +11,6 @@
import SentencePrefixSearchIndex from '../shared/sentence-prefix-search-index.js';
import { getSingleOtherUser } from '../shared/thread-utils.js';
import type { ClientEmojiAvatar } from '../types/avatar-types';
-import type { MinimallyEncodedRelativeMemberInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import type { BaseAppState } from '../types/redux-types.js';
import { userRelationshipStatus } from '../types/relationship-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
@@ -19,6 +18,7 @@
type RawThreadInfo,
type LegacyRelativeMemberInfo,
type RawThreadInfos,
+ type RelativeMemberInfo,
} from '../types/thread-types.js';
import type {
UserInfos,
@@ -116,11 +116,9 @@
const relativeMemberInfoSelectorForMembersOfThread: (
threadID: ?string,
-) => (
- state: BaseAppState<>,
-) => $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
-> = _memoize(baseRelativeMemberInfoSelectorForMembersOfThread);
+) => (state: BaseAppState<>) => $ReadOnlyArray<RelativeMemberInfo> = _memoize(
+ baseRelativeMemberInfoSelectorForMembersOfThread,
+);
const userInfoSelectorForPotentialMembers: (state: BaseAppState<>) => {
[id: string]: AccountUserInfo,
diff --git a/lib/shared/markdown.js b/lib/shared/markdown.js
--- a/lib/shared/markdown.js
+++ b/lib/shared/markdown.js
@@ -6,14 +6,11 @@
markdownUserMentionRegex,
decodeChatMentionText,
} from './mention-utils.js';
+import type { MinimallyEncodedResolvedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedResolvedThreadInfo,
-} from '../types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyRelativeMemberInfo,
ResolvedThreadInfo,
ChatMentionCandidates,
+ RelativeMemberInfo,
} from '../types/thread-types.js';
// simple-markdown types
@@ -202,9 +199,7 @@
}
function createMemberMapForUserMentions(
- members: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ members: $ReadOnlyArray<RelativeMemberInfo>,
): $ReadOnlyMap<string, string> {
const membersMap = new Map<string, string>();
members.forEach(member => {
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
@@ -5,16 +5,15 @@
import { threadOtherMembers } from './thread-utils.js';
import { stringForUserExplicit } from './user-utils.js';
import type {
- MinimallyEncodedRelativeMemberInfo,
MinimallyEncodedResolvedThreadInfo,
MinimallyEncodedThreadInfo,
} from '../types/minimally-encoded-thread-permissions-types.js';
import { threadTypes } from '../types/thread-types-enum.js';
import type {
ThreadInfo,
- LegacyRelativeMemberInfo,
ResolvedThreadInfo,
ChatMentionCandidates,
+ RelativeMemberInfo,
} from '../types/thread-types.js';
import { idSchemaRegex, chatNameMaxLength } from '../utils/validation-utils.js';
@@ -30,7 +29,7 @@
type MentionTypeaheadUserSuggestionItem = {
+type: 'user',
- +userInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ +userInfo: RelativeMemberInfo,
};
type MentionTypeaheadChatSuggestionItem = {
@@ -109,9 +108,7 @@
function getMentionTypeaheadUserSuggestions(
userSearchIndex: SentencePrefixSearchIndex,
- threadMembers: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ threadMembers: $ReadOnlyArray<RelativeMemberInfo>,
viewerID: ?string,
usernamePrefix: string,
): $ReadOnlyArray<MentionTypeaheadUserSuggestionItem> {
@@ -169,9 +166,7 @@
function getUserMentionsCandidates(
threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
parentThreadInfo: ?ThreadInfo | ?MinimallyEncodedThreadInfo,
-): $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
-> {
+): $ReadOnlyArray<RelativeMemberInfo> {
if (threadInfo.type !== threadTypes.SIDEBAR) {
return threadInfo.members;
}
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
@@ -59,7 +59,6 @@
} from '../types/message-types.js';
import type {
MinimallyEncodedRawThreadInfo,
- MinimallyEncodedRelativeMemberInfo,
MinimallyEncodedThreadCurrentUserInfo,
MinimallyEncodedThreadInfo,
} from '../types/minimally-encoded-thread-permissions-types.js';
@@ -85,7 +84,6 @@
type ThreadInfo,
type MemberInfo,
type ServerThreadInfo,
- type LegacyRelativeMemberInfo,
type ThreadCurrentUserInfo,
type RoleInfo,
type ServerMemberInfo,
@@ -93,6 +91,7 @@
type NewThreadResult,
type ChangeThreadSettingsPayload,
type UserProfileThreadInfo,
+ type RelativeMemberInfo,
} from '../types/thread-types.js';
import { updateTypes } from '../types/update-types-enum.js';
import { type ClientUpdateInfo } from '../types/update-types.js';
@@ -276,18 +275,17 @@
}
function threadActualMembers(
- memberInfos: $ReadOnlyArray<
- MemberInfo | LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ memberInfos: $ReadOnlyArray<MemberInfo | RelativeMemberInfo>,
): $ReadOnlyArray<string> {
return memberInfos
.filter(memberInfo => memberInfo.role)
.map(memberInfo => memberInfo.id);
}
-function threadOtherMembers<
- T: MemberInfo | LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
->(memberInfos: $ReadOnlyArray<T>, viewerID: ?string): $ReadOnlyArray<T> {
+function threadOtherMembers<T: MemberInfo | RelativeMemberInfo>(
+ memberInfos: $ReadOnlyArray<T>,
+ viewerID: ?string,
+): $ReadOnlyArray<T> {
return memberInfos.filter(
memberInfo => memberInfo.role && memberInfo.id !== viewerID,
);
@@ -528,9 +526,7 @@
// Returns map from lowercase username to AccountUserInfo
function memberLowercaseUsernameMap(
- members: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ members: $ReadOnlyArray<RelativeMemberInfo>,
): Map<string, AccountUserInfo> {
const memberMap = new Map<string, AccountUserInfo>();
for (const member of members) {
@@ -946,9 +942,7 @@
return firstLine(threadInfo.name);
}
- let threadMembers:
- | $ReadOnlyArray<MinimallyEncodedRelativeMemberInfo>
- | $ReadOnlyArray<LegacyRelativeMemberInfo>;
+ let threadMembers: $ReadOnlyArray<RelativeMemberInfo>;
let memberEntities: $ReadOnlyArray<UserEntity>;
// Branching below is to appease flow
if (threadInfo.minimallyEncoded) {
@@ -1129,10 +1123,7 @@
};
function memberIsAdmin(
- memberInfo:
- | LegacyRelativeMemberInfo
- | MemberInfo
- | MinimallyEncodedRelativeMemberInfo,
+ memberInfo: RelativeMemberInfo | MemberInfo,
threadInfo:
| ThreadInfo
| RawThreadInfo
@@ -1147,11 +1138,7 @@
// Since we don't have access to all of the ancestor ThreadInfos, we approximate
// "parent admin" as anybody with CHANGE_ROLE permissions.
function memberHasAdminPowers(
- memberInfo:
- | LegacyRelativeMemberInfo
- | MemberInfo
- | ServerMemberInfo
- | MinimallyEncodedRelativeMemberInfo,
+ memberInfo: RelativeMemberInfo | MemberInfo | ServerMemberInfo,
): boolean {
if (memberInfo.minimallyEncoded) {
return hasPermission(memberInfo.permissions, threadPermissions.CHANGE_ROLE);
@@ -1651,7 +1638,7 @@
function removeMemberFromThread(
threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ memberInfo: RelativeMemberInfo,
dispatchActionPromise: DispatchActionPromise,
removeUserFromThreadServerCall: (
input: RemoveUsersFromThreadInput,
@@ -1670,7 +1657,7 @@
function switchMemberAdminRoleInThread(
threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ memberInfo: RelativeMemberInfo,
isCurrentlyAdmin: boolean,
dispatchActionPromise: DispatchActionPromise,
changeUserRoleServerCall: (
@@ -1701,7 +1688,7 @@
}
function getAvailableThreadMemberActions(
- memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ memberInfo: RelativeMemberInfo,
threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
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
@@ -16,6 +16,7 @@
} from './message-types.js';
import type {
MinimallyEncodedMemberInfo,
+ MinimallyEncodedRelativeMemberInfo,
MinimallyEncodedResolvedThreadInfo,
MinimallyEncodedRoleInfo,
} from './minimally-encoded-thread-permissions-types.js';
@@ -66,6 +67,10 @@
isViewer: t.Boolean,
});
+export type RelativeMemberInfo =
+ | LegacyRelativeMemberInfo
+ | MinimallyEncodedRelativeMemberInfo;
+
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
@@ -4,10 +4,7 @@
import { useSelector } from './redux-utils.js';
import { threadInfoSelector } from '../selectors/thread-selectors.js';
-import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from '../types/minimally-encoded-thread-permissions-types.js';
+import type { MinimallyEncodedThreadInfo } from '../types/minimally-encoded-thread-permissions-types.js';
import {
configurableCommunityPermissions,
type ThreadRolePermissionsBlob,
@@ -15,8 +12,8 @@
} from '../types/thread-permission-types.js';
import type {
ThreadInfo,
- LegacyRelativeMemberInfo,
RoleInfo,
+ RelativeMemberInfo,
} from '../types/thread-types';
import { threadTypes } from '../types/thread-types-enum.js';
@@ -61,9 +58,7 @@
function useRolesFromCommunityThreadInfo(
threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- memberInfos: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ memberInfos: $ReadOnlyArray<RelativeMemberInfo>,
): $ReadOnlyMap<string, ?RoleInfo> {
// Our in-code system has chat-specific roles, while the
// user-surfaced system has roles only for communities. We retrieve roles
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,18 +71,15 @@
SendEditMessageResponse,
MessageInfo,
} from 'lib/types/message-types.js';
-import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-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 {
ThreadInfo,
ClientThreadJoinRequest,
ThreadJoinPayload,
- LegacyRelativeMemberInfo,
ChatMentionCandidates,
+ RelativeMemberInfo,
} from 'lib/types/thread-types.js';
import { type UserInfos } from 'lib/types/user-types.js';
import {
@@ -299,9 +296,7 @@
+joinThread: (request: ClientThreadJoinRequest) => Promise<ThreadJoinPayload>,
+inputState: ?InputState,
+userSearchIndex: SentencePrefixSearchIndex,
- +userMentionsCandidates: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ +userMentionsCandidates: $ReadOnlyArray<RelativeMemberInfo>,
+chatMentionSearchIndex: SentencePrefixSearchIndex,
+chatMentionCandidates: ChatMentionCandidates,
+parentThreadInfo: ?ThreadInfo,
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,14 +5,8 @@
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 {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- ThreadInfo,
- LegacyRelativeMemberInfo,
-} from 'lib/types/thread-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 { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import ThreadSettingsMemberTooltipButton from './thread-settings-member-tooltip-button.react.js';
@@ -28,7 +22,7 @@
import Alert from '../../utils/alert.js';
export type ThreadSettingsMemberTooltipModalParams = TooltipParams<{
- +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ +memberInfo: RelativeMemberInfo,
+threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
}>;
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,13 +19,10 @@
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 {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
type ThreadInfo,
- type LegacyRelativeMemberInfo,
+ type RelativeMemberInfo,
} from 'lib/types/thread-types.js';
import { useRolesFromCommunityThreadInfo } from 'lib/utils/role-utils.js';
@@ -93,7 +90,7 @@
};
type BaseProps = {
- +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ +memberInfo: RelativeMemberInfo,
+threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
+canEdit: boolean,
+navigate: ThreadSettingsNavigate,
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
@@ -34,7 +34,6 @@
} from 'lib/shared/thread-utils.js';
import threadWatcher from 'lib/shared/thread-watcher.js';
import type {
- MinimallyEncodedRelativeMemberInfo,
MinimallyEncodedResolvedThreadInfo,
MinimallyEncodedThreadInfo,
} from 'lib/types/minimally-encoded-thread-permissions-types.js';
@@ -44,7 +43,7 @@
import {
type ThreadInfo,
type ResolvedThreadInfo,
- type LegacyRelativeMemberInfo,
+ type RelativeMemberInfo,
} from 'lib/types/thread-types.js';
import type { UserInfos } from 'lib/types/user-types.js';
import {
@@ -210,9 +209,7 @@
| {
+itemType: 'member',
+key: string,
- +memberInfo:
- | LegacyRelativeMemberInfo
- | MinimallyEncodedRelativeMemberInfo,
+ +memberInfo: RelativeMemberInfo,
+threadInfo: ResolvedThreadInfo | MinimallyEncodedResolvedThreadInfo,
+canEdit: boolean,
+navigate: ThreadSettingsNavigate,
@@ -1143,9 +1140,7 @@
const threadMembersChangeIsSaving = (
state: AppState,
- threadMembers: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ threadMembers: $ReadOnlyArray<RelativeMemberInfo>,
) => {
for (const threadMember of threadMembers) {
const removeUserLoadingStatus = createLoadingStatusSelector(
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,14 +7,11 @@
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 {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyRelativeMemberInfo,
ThreadInfo,
ChatMentionCandidates,
+ RelativeMemberInfo,
} from 'lib/types/thread-types.js';
import MarkdownChatMention from './markdown-chat-mention.react.js';
@@ -377,9 +374,7 @@
}
function textMessageRules(
- members: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ members: $ReadOnlyArray<RelativeMemberInfo>,
chatMentionCandidates: ChatMentionCandidates,
useDarkStyle: boolean,
): MarkdownRules {
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,14 +12,8 @@
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 {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyRelativeMemberInfo,
- ThreadInfo,
-} from 'lib/types/thread-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 { values } from 'lib/utils/objects.js';
import ChangeRolesHeaderRightButton from './change-roles-header-right-button.react.js';
@@ -32,7 +26,7 @@
export type ChangeRolesScreenParams = {
+threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ +memberInfo: RelativeMemberInfo,
+role: ?string,
};
diff --git a/web/input/input-state.js b/web/input/input-state.js
--- a/web/input/input-state.js
+++ b/web/input/input-state.js
@@ -9,14 +9,11 @@
type MediaMissionStep,
} from 'lib/types/media-types.js';
import type { RawTextMessageInfo } from 'lib/types/messages/text.js';
-import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import type {
ThreadInfo,
- LegacyRelativeMemberInfo,
ChatMentionCandidates,
+ RelativeMemberInfo,
} from 'lib/types/thread-types.js';
export type PendingMultimediaUpload = {
@@ -51,9 +48,7 @@
export type TypeaheadState = {
+canBeVisible: boolean,
+keepUpdatingThreadMembers: boolean,
- +frozenUserMentionsCandidates: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ +frozenUserMentionsCandidates: $ReadOnlyArray<RelativeMemberInfo>,
+frozenChatMentionsCandidates: ChatMentionCandidates,
+moveChoiceUp: ?() => void,
+moveChoiceDown: ?() => void,
diff --git a/web/markdown/rules.react.js b/web/markdown/rules.react.js
--- a/web/markdown/rules.react.js
+++ b/web/markdown/rules.react.js
@@ -6,14 +6,11 @@
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 {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyRelativeMemberInfo,
ThreadInfo,
ChatMentionCandidates,
+ RelativeMemberInfo,
} from 'lib/types/thread-types.js';
import MarkdownChatMention from './markdown-chat-mention.react.js';
@@ -183,9 +180,7 @@
}
function textMessageRules(
- members: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ members: $ReadOnlyArray<RelativeMemberInfo>,
chatMentionCandidates: ChatMentionCandidates,
useDarkStyle: boolean,
): MarkdownRules {
diff --git a/web/modals/threads/create/steps/subchannel-members-list.react.js b/web/modals/threads/create/steps/subchannel-members-list.react.js
--- a/web/modals/threads/create/steps/subchannel-members-list.react.js
+++ b/web/modals/threads/create/steps/subchannel-members-list.react.js
@@ -4,14 +4,8 @@
import { useENSNames } from 'lib/hooks/ens-cache.js';
import { stringForUser } from 'lib/shared/user-utils.js';
-import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyRelativeMemberInfo,
- ThreadInfo,
-} from 'lib/types/thread-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 { UserListItem } from 'lib/types/user-types.js';
import { useSelector } from '../../../../redux/redux-utils.js';
@@ -46,11 +40,7 @@
);
const filterOutParentMembersWithENSNames = React.useCallback(
- (
- members: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
- ) =>
+ (members: $ReadOnlyArray<RelativeMemberInfo>) =>
members
.filter(
user =>
@@ -71,11 +61,7 @@
);
const filterOutOtherMembersWithENSNames = React.useCallback(
- (
- members: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
- ) =>
+ (members: $ReadOnlyArray<RelativeMemberInfo>) =>
members
.filter(
user =>
diff --git a/web/modals/threads/members/change-member-role-modal.react.js b/web/modals/threads/members/change-member-role-modal.react.js
--- a/web/modals/threads/members/change-member-role-modal.react.js
+++ b/web/modals/threads/members/change-member-role-modal.react.js
@@ -11,14 +11,8 @@
import SWMansionIcon from 'lib/components/SWMansionIcon.react.js';
import { otherUsersButNoOtherAdmins } from 'lib/selectors/thread-selectors.js';
import { roleIsAdminRole } from 'lib/shared/thread-utils.js';
-import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import type {
- LegacyRelativeMemberInfo,
- ThreadInfo,
-} from 'lib/types/thread-types';
+import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import type { ThreadInfo, RelativeMemberInfo } from 'lib/types/thread-types';
import { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import { values } from 'lib/utils/objects.js';
@@ -31,7 +25,7 @@
import UnsavedChangesModal from '../../unsaved-changes-modal.react.js';
type ChangeMemberRoleModalProps = {
- +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ +memberInfo: RelativeMemberInfo,
+threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
};
diff --git a/web/modals/threads/members/member.react.js b/web/modals/threads/members/member.react.js
--- a/web/modals/threads/members/member.react.js
+++ b/web/modals/threads/members/member.react.js
@@ -11,14 +11,8 @@
} from 'lib/shared/thread-utils.js';
import { stringForUser } from 'lib/shared/user-utils.js';
import type { SetState } from 'lib/types/hook-types.js';
-import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
-import {
- type LegacyRelativeMemberInfo,
- type ThreadInfo,
-} from 'lib/types/thread-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 { useDispatchActionPromise } from 'lib/utils/action-utils.js';
import { useRolesFromCommunityThreadInfo } from 'lib/utils/role-utils.js';
@@ -34,7 +28,7 @@
const commIconComponent = <CommIcon size={18} icon="user-edit" />;
type Props = {
- +memberInfo: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
+ +memberInfo: RelativeMemberInfo,
+threadInfo: ThreadInfo | 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
@@ -7,13 +7,10 @@
import { useENSNames } from 'lib/hooks/ens-cache.js';
import { stringForUser } from 'lib/shared/user-utils.js';
-import type {
- MinimallyEncodedRelativeMemberInfo,
- MinimallyEncodedThreadInfo,
-} from 'lib/types/minimally-encoded-thread-permissions-types.js';
+import type { MinimallyEncodedThreadInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import {
type ThreadInfo,
- type LegacyRelativeMemberInfo,
+ type RelativeMemberInfo,
} from 'lib/types/thread-types.js';
import ThreadMember from './member.react.js';
@@ -21,9 +18,7 @@
type Props = {
+threadInfo: ThreadInfo | MinimallyEncodedThreadInfo,
- +threadMembers: $ReadOnlyArray<
- LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- >,
+ +threadMembers: $ReadOnlyArray<RelativeMemberInfo>,
};
function ThreadMembersList(props: Props): React.Node {
@@ -48,20 +43,14 @@
.map(([letter, users]) => {
const userList = users
.sort((a, b) => stringForUser(a).localeCompare(stringForUser(b)))
- .map(
- (
- user:
- | LegacyRelativeMemberInfo
- | MinimallyEncodedRelativeMemberInfo,
- ) => (
- <ThreadMember
- key={user.id}
- memberInfo={user}
- threadInfo={threadInfo}
- setOpenMenu={setOpenMenu}
- />
- ),
- );
+ .map((user: RelativeMemberInfo) => (
+ <ThreadMember
+ key={user.id}
+ memberInfo={user}
+ threadInfo={threadInfo}
+ setOpenMenu={setOpenMenu}
+ />
+ ));
const letterHeader = (
<h5 className={css.memberletterHeader} key={letter}>
{letter.toUpperCase()}
diff --git a/web/modals/threads/members/members-modal.react.js b/web/modals/threads/members/members-modal.react.js
--- a/web/modals/threads/members/members-modal.react.js
+++ b/web/modals/threads/members/members-modal.react.js
@@ -9,9 +9,8 @@
roleIsAdminRole,
threadHasPermission,
} from 'lib/shared/thread-utils.js';
-import type { MinimallyEncodedRelativeMemberInfo } from 'lib/types/minimally-encoded-thread-permissions-types.js';
import { threadPermissions } from 'lib/types/thread-permission-types.js';
-import { type LegacyRelativeMemberInfo } from 'lib/types/thread-types.js';
+import { type RelativeMemberInfo } from 'lib/types/thread-types.js';
import { useRolesFromCommunityThreadInfo } from 'lib/utils/role-utils.js';
import { AddMembersModal } from './add-members-modal.react.js';
@@ -43,9 +42,8 @@
const allMembers = React.useMemo(
() =>
threadMembersNotFiltered.filter(
- (
- member: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- ) => searchText.length === 0 || userIDs.includes(member.id),
+ (member: RelativeMemberInfo) =>
+ searchText.length === 0 || userIDs.includes(member.id),
),
[searchText.length, threadMembersNotFiltered, userIDs],
);
@@ -53,10 +51,8 @@
const roles = useRolesFromCommunityThreadInfo(threadInfo, allMembers);
const adminMembers = React.useMemo(
() =>
- allMembers.filter(
- (
- member: LegacyRelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
- ) => roleIsAdminRole(roles.get(member.id)),
+ allMembers.filter((member: RelativeMemberInfo) =>
+ roleIsAdminRole(roles.get(member.id)),
),
[allMembers, roles],
);
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 30, 3:13 AM (19 h, 38 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2599310
Default Alt Text
D10074.diff (29 KB)
Attached To
Mode
D10074: [lib] Re-introduce `RelativeMemberInfo` (`[Legacy/MinimallyEncoded]RelativeMemberInfo`)
Attached
Detach File
Event Timeline
Log In to Comment