( threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo, viewerID: ?string, userInfos: UserInfos, checkOnlyViewerBlock: boolean, )
| 977 | } |
| 978 | |
| 979 | function baseThreadIsWithBlockedUserOnly( |
| 980 | threadInfo: LegacyRawThreadInfo | RawThreadInfo | ThreadInfo, |
| 981 | viewerID: ?string, |
| 982 | userInfos: UserInfos, |
| 983 | checkOnlyViewerBlock: boolean, |
| 984 | ) { |
| 985 | const otherUserID = getSingleOtherUser(threadInfo, viewerID); |
| 986 | if (!otherUserID) { |
| 987 | return false; |
| 988 | } |
| 989 | const otherUserRelationshipStatus = |
| 990 | userInfos[otherUserID]?.relationshipStatus; |
| 991 | |
| 992 | if (checkOnlyViewerBlock) { |
| 993 | return ( |
| 994 | otherUserRelationshipStatus === userRelationshipStatus.BLOCKED_BY_VIEWER |
| 995 | ); |
| 996 | } |
| 997 | |
| 998 | return ( |
| 999 | !!otherUserRelationshipStatus && |
| 1000 | relationshipBlockedInEitherDirection(otherUserRelationshipStatus) |
| 1001 | ); |
| 1002 | } |
| 1003 | |
| 1004 | function threadIsWithBlockedUserOnlyWithoutAdminRoleCheck( |
| 1005 | threadInfo: ThreadInfo | RawThreadInfo | LegacyRawThreadInfo, |
no test coverage detected