mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat(wire): migrate from protobuf -> wire (#4401)
Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
parent
9dbc8b7fbf
commit
25657e8f8f
239 changed files with 7149 additions and 6144 deletions
|
|
@ -147,7 +147,7 @@ class MessageItemTest {
|
|||
|
||||
// Verify that the node containing the message text exists and matches the text
|
||||
composeTestRule
|
||||
.onNodeWithContentDescription("Message from ${testNode.user?.longName}: Hello World")
|
||||
.onNodeWithContentDescription("Message from ${testNode.user.long_name}: Hello World")
|
||||
.assertIsDisplayed()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -141,7 +141,7 @@ import org.meshtastic.core.ui.component.SharedContactDialog
|
|||
import org.meshtastic.core.ui.component.smartScrollToIndex
|
||||
import org.meshtastic.core.ui.theme.AppTheme
|
||||
import org.meshtastic.feature.messaging.component.RetryConfirmationDialog
|
||||
import org.meshtastic.proto.AppOnlyProtos
|
||||
import org.meshtastic.proto.ChannelSet
|
||||
import java.nio.charset.StandardCharsets
|
||||
|
||||
private const val MESSAGE_CHARACTER_LIMIT_BYTES = 200
|
||||
|
|
@ -227,7 +227,7 @@ fun MessageScreen(
|
|||
remember(nodeId, channelName, viewModel) {
|
||||
when (nodeId) {
|
||||
DataPacket.ID_BROADCAST -> channelName
|
||||
else -> viewModel.getUser(nodeId).longName
|
||||
else -> viewModel.getUser(nodeId).long_name
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -535,7 +535,7 @@ private fun ReplySnippet(originalMessage: Message?, onClearReply: () -> Unit, ou
|
|||
tint = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
)
|
||||
Text(
|
||||
text = stringResource(Res.string.replying_to, replyingToNodeUser?.shortName ?: unknownUserText),
|
||||
text = stringResource(Res.string.replying_to, replyingToNodeUser?.short_name ?: unknownUserText),
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
)
|
||||
Text(
|
||||
|
|
@ -711,7 +711,7 @@ private fun MessageTopBar(
|
|||
channelIndex: Int?,
|
||||
mismatchKey: Boolean,
|
||||
onNavigateBack: () -> Unit,
|
||||
channels: AppOnlyProtos.ChannelSet?,
|
||||
channels: ChannelSet?,
|
||||
channelIndexParam: Int?,
|
||||
showQuickChat: Boolean,
|
||||
onToggleQuickChat: () -> Unit,
|
||||
|
|
|
|||
|
|
@ -520,7 +520,7 @@ internal fun MessageStatusDialog(
|
|||
remember(message.relayNode, nodes, ourNode) {
|
||||
derivedStateOf {
|
||||
message.relayNode?.let { relayNodeId ->
|
||||
Packet.getRelayNode(relayNodeId, nodes, ourNode?.num)?.user?.longName
|
||||
Packet.getRelayNode(relayNodeId, nodes, ourNode?.num)?.user?.long_name
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,9 +49,9 @@ import org.meshtastic.core.service.MeshServiceNotifications
|
|||
import org.meshtastic.core.service.ServiceAction
|
||||
import org.meshtastic.core.service.ServiceRepository
|
||||
import org.meshtastic.core.ui.viewmodel.stateInWhileSubscribed
|
||||
import org.meshtastic.proto.ConfigProtos.Config.DeviceConfig.Role
|
||||
import org.meshtastic.proto.channelSet
|
||||
import org.meshtastic.proto.sharedContact
|
||||
import org.meshtastic.proto.ChannelSet
|
||||
import org.meshtastic.proto.Config.DeviceConfig.Role
|
||||
import org.meshtastic.proto.SharedContact
|
||||
import javax.inject.Inject
|
||||
|
||||
@Suppress("LongParameterList", "TooManyFunctions")
|
||||
|
|
@ -78,7 +78,7 @@ constructor(
|
|||
|
||||
val nodeList: StateFlow<List<Node>> = nodeRepository.getNodes().stateInWhileSubscribed(initialValue = emptyList())
|
||||
|
||||
val channels = radioConfigRepository.channelSetFlow.stateInWhileSubscribed(channelSet {})
|
||||
val channels = radioConfigRepository.channelSetFlow.stateInWhileSubscribed(ChannelSet())
|
||||
|
||||
private val _showQuickChat = MutableStateFlow(uiPrefs.showQuickChat)
|
||||
val showQuickChat: StateFlow<Boolean> = _showQuickChat
|
||||
|
|
@ -190,7 +190,7 @@ constructor(
|
|||
// if the destination is a node, we need to ensure it's a
|
||||
// favorite so it does not get removed from the on-device node database.
|
||||
if (channel == null) { // no channel specified, so we assume it's a direct message
|
||||
val fwVersion = ourNodeInfo.value?.metadata?.firmwareVersion
|
||||
val fwVersion = ourNodeInfo.value?.metadata?.firmware_version
|
||||
val destNode = nodeRepository.getNode(dest)
|
||||
val isClientBase = ourNodeInfo.value?.user?.role == Role.CLIENT_BASE
|
||||
|
||||
|
|
@ -239,11 +239,8 @@ constructor(
|
|||
|
||||
private fun sendSharedContact(node: Node) = viewModelScope.launch {
|
||||
try {
|
||||
val contact = sharedContact {
|
||||
nodeNum = node.num
|
||||
user = node.user
|
||||
manuallyVerified = node.manuallyVerified
|
||||
}
|
||||
val contact =
|
||||
SharedContact(node_num = node.num, user = node.user, manually_verified = node.manuallyVerified)
|
||||
serviceRepository.onServiceAction(ServiceAction.SendContact(contact = contact))
|
||||
} catch (ex: RemoteException) {
|
||||
Logger.e(ex) { "Send shared contact error" }
|
||||
|
|
|
|||
|
|
@ -234,7 +234,7 @@ internal fun MessageItem(
|
|||
) {
|
||||
NodeChip(node = node, onClick = onClickChip, modifier = Modifier.height(28.dp))
|
||||
Text(
|
||||
text = node.user.longName,
|
||||
text = node.user.long_name,
|
||||
overflow = TextOverflow.Ellipsis,
|
||||
maxLines = 1,
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
|
|
@ -267,7 +267,7 @@ internal fun MessageItem(
|
|||
)
|
||||
.then(messageModifier)
|
||||
.semantics(mergeDescendants = true) {
|
||||
val senderName = if (message.fromLocal) ourNode.user.longName else node.user.longName
|
||||
val senderName = if (message.fromLocal) ourNode.user.long_name else node.user.long_name
|
||||
contentDescription = "Message from $senderName: ${message.text}"
|
||||
},
|
||||
color = containerColor,
|
||||
|
|
@ -427,7 +427,7 @@ private fun OriginalMessageSnippet(
|
|||
modifier = Modifier.size(16.dp),
|
||||
)
|
||||
Text(
|
||||
text = originalMessageNode.user.shortName,
|
||||
text = originalMessageNode.user.short_name,
|
||||
style = MaterialTheme.typography.labelMedium,
|
||||
fontWeight = FontWeight.Bold,
|
||||
maxLines = 1,
|
||||
|
|
|
|||
|
|
@ -80,7 +80,7 @@ import org.meshtastic.core.ui.icon.Hops
|
|||
import org.meshtastic.core.ui.icon.MeshtasticIcons
|
||||
import org.meshtastic.core.ui.theme.AppTheme
|
||||
import org.meshtastic.feature.messaging.DeliveryInfo
|
||||
import org.meshtastic.proto.MeshProtos
|
||||
import org.meshtastic.proto.User
|
||||
|
||||
@Composable
|
||||
private fun ReactionItem(
|
||||
|
|
@ -218,7 +218,7 @@ internal fun ReactionDialog(
|
|||
|
||||
val relayNodeName =
|
||||
reaction.relayNode?.let { relayNodeId ->
|
||||
Packet.getRelayNode(relayNodeId, nodes, ourNode?.num)?.user?.longName
|
||||
Packet.getRelayNode(relayNodeId, nodes, ourNode?.num)?.user?.long_name
|
||||
}
|
||||
|
||||
DeliveryInfo(
|
||||
|
|
@ -268,9 +268,9 @@ internal fun ReactionDialog(
|
|||
val isLocal = reaction.user.id == myId || reaction.user.id == DataPacket.ID_LOCAL
|
||||
val displayName =
|
||||
if (isLocal) {
|
||||
"${reaction.user.longName} (${stringResource(Res.string.you)})"
|
||||
"${reaction.user.long_name} (${stringResource(Res.string.you)})"
|
||||
} else {
|
||||
reaction.user.longName
|
||||
reaction.user.long_name
|
||||
}
|
||||
Text(text = displayName, style = MaterialTheme.typography.titleMedium)
|
||||
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||
|
|
@ -343,7 +343,7 @@ private fun ReactionRowPreview() {
|
|||
listOf(
|
||||
Reaction(
|
||||
replyId = 1,
|
||||
user = MeshProtos.User.getDefaultInstance(),
|
||||
user = User(),
|
||||
emoji = "\uD83D\uDE42",
|
||||
timestamp = 1L,
|
||||
snr = -1.0f,
|
||||
|
|
@ -352,7 +352,7 @@ private fun ReactionRowPreview() {
|
|||
),
|
||||
Reaction(
|
||||
replyId = 1,
|
||||
user = MeshProtos.User.getDefaultInstance(),
|
||||
user = User(),
|
||||
emoji = "\uD83D\uDE42",
|
||||
timestamp = 1L,
|
||||
snr = -1.0f,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue