diff --git a/apps/ios/Shared/Views/Chat/ChatItem/CIMetaView.swift b/apps/ios/Shared/Views/Chat/ChatItem/CIMetaView.swift index 2e3bf617fb..028dd14cfb 100644 --- a/apps/ios/Shared/Views/Chat/ChatItem/CIMetaView.swift +++ b/apps/ios/Shared/Views/Chat/ChatItem/CIMetaView.swift @@ -41,7 +41,8 @@ struct CIMetaView: View { showStatus: showStatus, showEdited: showEdited, showViaProxy: showSentViaProxy, - showTimesamp: showTimestamp + showTimesamp: showTimestamp, + signedFileVerified: chatItem.file?.loaded ?? true ).invertedForegroundStyle(enabled: invertedMaterial) if invertedMaterial { ciMetaText( @@ -53,7 +54,8 @@ struct CIMetaView: View { showStatus: showStatus, showEdited: showEdited, showViaProxy: showSentViaProxy, - showTimesamp: showTimestamp + showTimesamp: showTimestamp, + signedFileVerified: chatItem.file?.loaded ?? true ) } } @@ -102,7 +104,8 @@ func ciMetaText( showStatus: Bool = true, showEdited: Bool = true, showViaProxy: Bool, - showTimesamp: Bool + showTimesamp: Bool, + signedFileVerified: Bool = true ) -> Text { var r = Text("") var space: Text? = nil @@ -147,7 +150,7 @@ func ciMetaText( r = r + statusIconText(enc ? "lock" : "lock.open", resolved) space = textSpace } - if meta.msgSigned == .verified { + if meta.msgSigned == .verified && signedFileVerified { r = r + colored(Text(Image("signature.plain")), resolved) space = textSpace } diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIFileView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIFileView.kt index b2b89ca041..965bd27d3f 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIFileView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIFileView.kt @@ -211,7 +211,7 @@ fun CIFileView( val encrypted = if (file?.fileSource == null) null else file.fileSource.cryptoArgs != null val metaReserve = buildAnnotatedString { withStyle(reserveTimestampStyle) { - append(reserveSpaceForMeta(meta, chatTTL, encrypted, secondaryColor = secondaryColor, showViaProxy = showViaProxy, showTimestamp = showTimestamp)) + append(reserveSpaceForMeta(meta, chatTTL, encrypted, secondaryColor = secondaryColor, showViaProxy = showViaProxy, showTimestamp = showTimestamp, signedFileVerified = file?.loaded != false)) } } if (file != null) { diff --git a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIMetaView.kt b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIMetaView.kt index 3bf5582378..2d10f7ca8a 100644 --- a/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIMetaView.kt +++ b/apps/multiplatform/common/src/commonMain/kotlin/chat/simplex/common/views/chat/item/CIMetaView.kt @@ -56,7 +56,8 @@ fun CIMetaView( showStatus = showStatus, showEdited = showEdited, showViaProxy = showViaProxy, - showTimestamp = showTimestamp + showTimestamp = showTimestamp, + signedFileVerified = chatItem.file?.loaded != false ) } } @@ -74,6 +75,7 @@ private fun CIMetaText( showEdited: Boolean = true, showTimestamp: Boolean, showViaProxy: Boolean, + signedFileVerified: Boolean, ) { if (showEdited && meta.itemEdited) { StatusIconText(painterResource(MR.images.ic_edit), color) @@ -107,7 +109,7 @@ private fun CIMetaText( Spacer(Modifier.width(4.dp)) StatusIconText(painterResource(if (encrypted) MR.images.ic_lock else MR.images.ic_lock_open_right), color) } - if (meta.msgSigned == MsgSigStatus.Verified) { + if (meta.msgSigned == MsgSigStatus.Verified && signedFileVerified) { StatusIconText(painterResource(MR.images.ic_signature), color) } @@ -126,7 +128,8 @@ fun reserveSpaceForMeta( showStatus: Boolean = true, showEdited: Boolean = true, showViaProxy: Boolean = false, - showTimestamp: Boolean + showTimestamp: Boolean, + signedFileVerified: Boolean = true ): String { val iconSpace = " \u00A0\u00A0\u00A0" val whiteSpace = "\u00A0" @@ -170,7 +173,7 @@ fun reserveSpaceForMeta( res += iconSpace space = whiteSpace } - if (meta.msgSigned == MsgSigStatus.Verified) { + if (meta.msgSigned == MsgSigStatus.Verified && signedFileVerified) { res += iconSpace space = whiteSpace }