core: prohibit image previews when images are prohibited (#7296)

This commit is contained in:
Evgeny
2026-07-24 10:50:46 +01:00
committed by GitHub
parent dc3c106bda
commit 8320730440
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -343,7 +343,7 @@ prohibitedGroupContent :: GroupInfo -> GroupMember -> Maybe GroupChatScopeInfo -
prohibitedGroupContent gInfo@GroupInfo {membership = mem@GroupMember {memberRole = userRole}} m scopeInfo mc ft file_ sent
| not supportAllowed = Just GFSupport
| isVoice mc && not (groupFeatureMemberAllowed SGFVoice m gInfo) && not hostApprovalVoice = Just GFVoice
| isNothing scopeInfo && not (isVoice mc) && isJust file_ && not (groupFeatureMemberAllowed SGFFiles m gInfo) = Just GFFiles
| isNothing scopeInfo && not (isVoice mc) && (isJust file_ || isMedia mc) && not (groupFeatureMemberAllowed SGFFiles m gInfo) = Just GFFiles
| isNothing scopeInfo && isReport mc && (badReportUser || not (groupFeatureAllowed SGFReports gInfo)) = Just GFReports
| isNothing scopeInfo && prohibitedSimplexLinks gInfo m mc ft = Just GFSimplexLinks
| otherwise = Nothing
+7
View File
@@ -815,6 +815,13 @@ isVoice = \case
MCVoice {} -> True
_ -> False
isMedia :: MsgContent -> Bool
isMedia = \case
MCImage {} -> True
MCVideo {} -> True
MCFile {} -> True
_ -> False
isReport :: MsgContent -> Bool
isReport = \case
MCReport {} -> True