mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
refactor: ensure backward compatibility for PKC encryption
This commit is contained in:
parent
6e2848a54a
commit
587c6c91f4
4 changed files with 13 additions and 6 deletions
|
|
@ -75,7 +75,6 @@ fun NodeItem(
|
|||
expanded: Boolean = false,
|
||||
currentTimeMillis: Long,
|
||||
) {
|
||||
val hasPublicKey = !thatNode.user.publicKey.isEmpty
|
||||
val isUnknownUser = thatNode.user.hwModel == MeshProtos.HardwareModel.UNSET
|
||||
val unknownShortName = stringResource(id = R.string.unknown_node_short_name)
|
||||
val longName = thatNode.user.longName.ifEmpty { stringResource(id = R.string.unknown_username) }
|
||||
|
|
@ -163,7 +162,7 @@ fun NodeItem(
|
|||
)
|
||||
Text(
|
||||
modifier = Modifier.weight(1f),
|
||||
text = if (hasPublicKey) "🔒 $longName" else longName,
|
||||
text = if (thatNode.hasPKC) "🔒 $longName" else longName,
|
||||
style = style,
|
||||
textDecoration = TextDecoration.LineThrough.takeIf { isIgnored },
|
||||
softWrap = true,
|
||||
|
|
|
|||
|
|
@ -90,7 +90,8 @@ class UsersFragment : ScreenFragment("Users"), Logging {
|
|||
}
|
||||
|
||||
private fun navigateToMessages(node: NodeEntity) = node.user.let { user ->
|
||||
val channel = if (user.publicKey.isEmpty) node.channel else DataPacket.PKC_CHANNEL_INDEX
|
||||
val hasPKC = model.ourNodeInfo.value?.hasPKC == true && node.hasPKC // TODO use meta.hasPKC
|
||||
val channel = if (hasPKC) DataPacket.PKC_CHANNEL_INDEX else node.channel
|
||||
val contactKey = "$channel${user.id}"
|
||||
info("calling MessagesFragment filter: $contactKey")
|
||||
parentFragmentManager.navigateToMessages(contactKey, user.longName)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue