This commit is contained in:
spaced4ndy
2026-07-08 19:34:47 +04:00
parent daceaac86f
commit d7db7a7c3b
3 changed files with 15 additions and 9 deletions
@@ -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
}
@@ -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) {
@@ -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
}