Page MenuHomePhabricator

D10072.id33949.diff
No OneTemporary

D10072.id33949.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
@@ -16,6 +16,7 @@
RawMessageInfo,
} from './message-types.js';
import type {
+ MinimallyEncodedMemberInfo,
MinimallyEncodedResolvedThreadInfo,
MinimallyEncodedRoleInfo,
} from './minimally-encoded-thread-permissions-types.js';
@@ -53,6 +54,8 @@
isSender: t.Boolean,
});
+export type MemberInfo = LegacyMemberInfo | MinimallyEncodedMemberInfo;
+
export type RelativeMemberInfo = $ReadOnly<{
...LegacyMemberInfo,
+username: ?string,

File Metadata

Mime Type
text/plain
Expires
Tue, Nov 26, 3:24 PM (20 h, 51 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2585345
Default Alt Text
D10072.id33949.diff (2 KB)

Event Timeline