Page MenuHomePhabricator

D9839.id33151.diff
No OneTemporary

D9839.id33151.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
@@ -943,7 +943,7 @@
}
function threadIsWithBlockedUserOnly(
- threadInfo: RawThreadInfo | ThreadInfo,
+ threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedRawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
checkOnlyViewerBlock?: boolean,
@@ -975,7 +975,7 @@
}
function threadFrozenDueToBlock(
- threadInfo: RawThreadInfo | ThreadInfo,
+ threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedRawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
@@ -983,7 +983,7 @@
}
function threadFrozenDueToViewerBlock(
- threadInfo: RawThreadInfo | ThreadInfo,
+ threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedRawThreadInfo,
viewerID: ?string,
userInfos: UserInfos,
): boolean {
@@ -1009,8 +1009,15 @@
// 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: RelativeMemberInfo | MemberInfo | ServerMemberInfo,
+ memberInfo:
+ | RelativeMemberInfo
+ | MemberInfo
+ | ServerMemberInfo
+ | MinimallyEncodedMemberInfo,
): boolean {
+ if (memberInfo.minimallyEncoded) {
+ return hasPermission(memberInfo.permissions, threadPermissions.CHANGE_ROLE);
+ }
return !!memberInfo.permissions[threadPermissions.CHANGE_ROLE]?.value;
}
@@ -1035,7 +1042,7 @@
}
function threadOrParentThreadHasAdminRole(
- threadInfo: RawThreadInfo | ThreadInfo,
+ threadInfo: RawThreadInfo | ThreadInfo | MinimallyEncodedRawThreadInfo,
) {
return (
threadMembersWithoutAddedAshoat(threadInfo).filter(member =>

File Metadata

Mime Type
text/plain
Expires
Tue, Dec 24, 10:21 AM (17 h, 20 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2698505
Default Alt Text
D9839.id33151.diff (1 KB)

Event Timeline