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 =>