Page MenuHomePhabricator

D10072.diff
No OneTemporary

D10072.diff

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
@@ -58,7 +58,6 @@
type ComposableMessageInfo,
} from '../types/message-types.js';
import type {
- MinimallyEncodedMemberInfo,
MinimallyEncodedRawThreadInfo,
MinimallyEncodedRelativeMemberInfo,
MinimallyEncodedThreadCurrentUserInfo,
@@ -84,7 +83,7 @@
import {
type RawThreadInfo,
type ThreadInfo,
- type LegacyMemberInfo,
+ type MemberInfo,
type ServerThreadInfo,
type RelativeMemberInfo,
type ThreadCurrentUserInfo,
@@ -278,10 +277,7 @@
function threadActualMembers(
memberInfos: $ReadOnlyArray<
- | LegacyMemberInfo
- | RelativeMemberInfo
- | MinimallyEncodedMemberInfo
- | MinimallyEncodedRelativeMemberInfo,
+ MemberInfo | RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
>,
): $ReadOnlyArray<string> {
return memberInfos
@@ -290,11 +286,7 @@
}
function threadOtherMembers<
- T:
- | LegacyMemberInfo
- | RelativeMemberInfo
- | MinimallyEncodedMemberInfo
- | MinimallyEncodedRelativeMemberInfo,
+ T: MemberInfo | RelativeMemberInfo | MinimallyEncodedRelativeMemberInfo,
>(memberInfos: $ReadOnlyArray<T>, viewerID: ?string): $ReadOnlyArray<T> {
return memberInfos.filter(
memberInfo => memberInfo.role && memberInfo.id !== viewerID,
@@ -1139,8 +1131,7 @@
function memberIsAdmin(
memberInfo:
| RelativeMemberInfo
- | LegacyMemberInfo
- | MinimallyEncodedMemberInfo
+ | MemberInfo
| MinimallyEncodedRelativeMemberInfo,
threadInfo:
| ThreadInfo
@@ -1158,9 +1149,8 @@
function memberHasAdminPowers(
memberInfo:
| RelativeMemberInfo
- | LegacyMemberInfo
+ | MemberInfo
| ServerMemberInfo
- | MinimallyEncodedMemberInfo
| MinimallyEncodedRelativeMemberInfo,
): boolean {
if (memberInfo.minimallyEncoded) {
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
@@ -15,6 +15,7 @@
RawMessageInfo,
} from './message-types.js';
import type {
+ MinimallyEncodedMemberInfo,
MinimallyEncodedResolvedThreadInfo,
MinimallyEncodedRoleInfo,
} from './minimally-encoded-thread-permissions-types.js';
@@ -52,6 +53,8 @@
isSender: t.Boolean,
});
+export type MemberInfo = LegacyMemberInfo | MinimallyEncodedMemberInfo;
+
export type RelativeMemberInfo = $ReadOnly<{
...LegacyMemberInfo,
+username: ?string,

File Metadata

Mime Type
text/plain
Expires
Sat, Nov 30, 2:13 AM (19 h, 30 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2599033
Default Alt Text
D10072.diff (2 KB)

Event Timeline