Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3367645
D10072.id33949.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D10072.id33949.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D10072: [lib] Re-introduce `MemberInfo` (`[Legacy/MinimallyEncoded]MemberInfo`)
Attached
Detach File
Event Timeline
Log In to Comment