Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3155814
D10725.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
3 KB
Referenced Files
None
Subscribers
None
D10725.diff
View Options
diff --git a/lib/permissions/minimally-encoded-thread-permissions-validators.js b/lib/permissions/minimally-encoded-thread-permissions-validators.js
--- a/lib/permissions/minimally-encoded-thread-permissions-validators.js
+++ b/lib/permissions/minimally-encoded-thread-permissions-validators.js
@@ -11,7 +11,6 @@
MinimallyEncodedMemberInfo,
RawThreadInfo,
MinimallyEncodedRelativeMemberInfo,
- ResolvedThreadInfo,
MinimallyEncodedRoleInfo,
MinimallyEncodedThreadCurrentUserInfo,
ThreadInfo,
@@ -77,12 +76,6 @@
pinnedCount: t.maybe(t.Number),
});
-const resolvedThreadInfoValidator: TInterface<ResolvedThreadInfo> =
- tShape<ResolvedThreadInfo>({
- ...minimallyEncodedThreadInfoValidator.meta.props,
- uiName: t.String,
- });
-
const minimallyEncodedRawThreadInfoValidator: TInterface<RawThreadInfo> =
tShape<RawThreadInfo>({
...legacyRawThreadInfoValidator.meta.props,
@@ -105,6 +98,5 @@
minimallyEncodedMemberInfoValidator,
minimallyEncodedRelativeMemberInfoValidator,
minimallyEncodedThreadInfoValidator,
- resolvedThreadInfoValidator,
minimallyEncodedRawThreadInfoValidator,
};
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
@@ -1027,15 +1027,6 @@
'Only visible to its members and admins of ancestor channels.',
};
-function memberIsAdmin(
- memberInfo: RelativeMemberInfo | MemberInfo,
- threadInfo: RawThreadInfo | ThreadInfo,
-): boolean {
- return !!(
- memberInfo.role && roleIsAdminRole(threadInfo.roles[memberInfo.role])
- );
-}
-
// Since we don't have access to all of the ancestor ThreadInfos, we approximate
// "parent admin" as anybody with CHANGE_ROLE permissions.
function memberHasAdminPowers(
@@ -1808,7 +1799,6 @@
threadUIName,
threadInfoFromRawThreadInfo,
threadTypeDescriptions,
- memberIsAdmin,
memberHasAdminPowers,
roleIsAdminRole,
threadHasAdminRole,
diff --git a/lib/types/minimally-encoded-thread-permissions-types.js b/lib/types/minimally-encoded-thread-permissions-types.js
--- a/lib/types/minimally-encoded-thread-permissions-types.js
+++ b/lib/types/minimally-encoded-thread-permissions-types.js
@@ -8,7 +8,6 @@
import type {
LegacyMemberInfo,
LegacyRawThreadInfo,
- LegacyRelativeMemberInfo,
LegacyRoleInfo,
ThreadCurrentUserInfo,
} from './thread-types.js';
@@ -122,32 +121,6 @@
+isViewer: boolean,
}>;
-const minimallyEncodeRelativeMemberInfo = (
- relativeMemberInfo: LegacyRelativeMemberInfo,
-): MinimallyEncodedRelativeMemberInfo => {
- invariant(
- !('minimallyEncoded' in relativeMemberInfo),
- 'relativeMemberInfo is already minimally encoded.',
- );
- return {
- ...relativeMemberInfo,
- minimallyEncoded: true,
- permissions: permissionsToBitmaskHex(relativeMemberInfo.permissions),
- };
-};
-
-const decodeMinimallyEncodedRelativeMemberInfo = (
- minimallyEncodedRelativeMemberInfo: MinimallyEncodedRelativeMemberInfo,
-): LegacyRelativeMemberInfo => {
- const { minimallyEncoded, ...rest } = minimallyEncodedRelativeMemberInfo;
- return {
- ...rest,
- permissions: threadPermissionsFromBitmaskHex(
- minimallyEncodedRelativeMemberInfo.permissions,
- ),
- };
-};
-
export type RawThreadInfo = $ReadOnly<{
...LegacyRawThreadInfo,
+minimallyEncoded: true,
@@ -221,6 +194,4 @@
decodeMinimallyEncodedMemberInfo,
minimallyEncodeRawThreadInfo,
decodeMinimallyEncodedRawThreadInfo,
- minimallyEncodeRelativeMemberInfo,
- decodeMinimallyEncodedRelativeMemberInfo,
};
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Wed, Nov 6, 11:39 AM (20 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2430791
Default Alt Text
D10725.diff (3 KB)
Attached To
Mode
D10725: [lib] Remove unused utilities and validators
Attached
Detach File
Event Timeline
Log In to Comment