mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-09-27 20:08:34 +00:00
remove proof from cards, send owner public key for channel to relay
This commit is contained in:
@@ -56,7 +56,7 @@ struct CIChatLinkHeader: View {
|
||||
)
|
||||
.padding(.trailing, 4)
|
||||
VStack(alignment: .leading) {
|
||||
NameWithBadge(Text(chatLink.displayName).font(.headline), linkBadge, .headline).lineLimit(2)
|
||||
Text(chatLink.displayName).font(.headline).lineLimit(2)
|
||||
let fn = chatLink.fullName
|
||||
if fn != "" && fn != chatLink.displayName {
|
||||
Text(fn).font(.subheadline).lineLimit(2)
|
||||
@@ -65,11 +65,4 @@ struct CIChatLinkHeader: View {
|
||||
.frame(minHeight: 44)
|
||||
}
|
||||
}
|
||||
|
||||
private var linkBadge: LocalBadge? {
|
||||
guard case let .contact(_, profile, _) = chatLink, let b = profile.badge else { return nil }
|
||||
let expired = Date.now.timeIntervalSince(b.badgeInfo.badgeExpiry)
|
||||
let status: BadgeStatus = expired > BADGE_OLD_INTERVAL ? .expiredOld : expired > BADGE_GRACE_INTERVAL ? .expired : .active
|
||||
return LocalBadge(badge: b.badgeInfo, status: status)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -36,9 +36,6 @@ public let MAX_FILE_SIZE_XFTP_LEGEND: Int64 = 5_368_709_120 // 5GB
|
||||
// a badge raises the limit at send for this long after its expiry, shorter than the receiver's grace
|
||||
public let BADGE_SND_GRACE_INTERVAL = TimeInterval(86400)
|
||||
|
||||
public let BADGE_GRACE_INTERVAL = TimeInterval(7 * 86400)
|
||||
public let BADGE_OLD_INTERVAL = TimeInterval(38 * 86400)
|
||||
|
||||
public let MAX_FILE_SIZE_LOCAL: Int64 = Int64.max
|
||||
|
||||
public let MAX_FILE_SIZE_SMP: Int64 = 8000000
|
||||
|
||||
+1
-17
@@ -10,13 +10,9 @@ import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import chat.simplex.common.model.*
|
||||
import chat.simplex.common.ui.theme.*
|
||||
import chat.simplex.common.views.helpers.BADGE_GRACE_INTERVAL
|
||||
import chat.simplex.common.views.helpers.BADGE_OLD_INTERVAL
|
||||
import chat.simplex.common.views.helpers.NameWithBadge
|
||||
import chat.simplex.common.views.helpers.ProfileImage
|
||||
import chat.simplex.res.MR
|
||||
import dev.icerock.moko.resources.compose.stringResource
|
||||
import kotlinx.datetime.Clock
|
||||
|
||||
@Composable
|
||||
fun CIChatLinkHeader(
|
||||
@@ -43,9 +39,8 @@ fun CIChatLinkHeader(
|
||||
Modifier.defaultMinSize(minHeight = 54.dp),
|
||||
verticalArrangement = Arrangement.Center
|
||||
) {
|
||||
NameWithBadge(
|
||||
Text(
|
||||
chatLink.displayName,
|
||||
linkBadge(chatLink),
|
||||
style = MaterialTheme.typography.caption,
|
||||
fontWeight = FontWeight.Medium,
|
||||
maxLines = 2,
|
||||
@@ -82,14 +77,3 @@ fun CIChatLinkHeader(
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun linkBadge(chatLink: MsgChatLink): LocalBadge? {
|
||||
val b = (chatLink as? MsgChatLink.Contact)?.profile?.badge ?: return null
|
||||
val expired = Clock.System.now() - b.badgeInfo.badgeExpiry
|
||||
val status = when {
|
||||
expired > BADGE_OLD_INTERVAL -> BadgeStatus.ExpiredOld
|
||||
expired > BADGE_GRACE_INTERVAL -> BadgeStatus.Expired
|
||||
else -> BadgeStatus.Active
|
||||
}
|
||||
return LocalBadge(b.badgeInfo, status)
|
||||
}
|
||||
|
||||
-3
@@ -133,9 +133,6 @@ const val MAX_FILE_SIZE_XFTP_LEGEND: Long = 5_368_709_120 // 5GB
|
||||
// a badge raises the limit at send for this long after its expiry, shorter than the receiver's grace
|
||||
val BADGE_SND_GRACE_INTERVAL: Duration = 1.days
|
||||
|
||||
val BADGE_GRACE_INTERVAL: Duration = 7.days
|
||||
val BADGE_OLD_INTERVAL: Duration = 38.days
|
||||
|
||||
const val MAX_FILE_SIZE_LOCAL: Long = Long.MAX_VALUE
|
||||
|
||||
expect fun getAppFileUri(fileName: String): URI
|
||||
|
||||
Reference in New Issue
Block a user