mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
feat: auto retry text message send on max retransmit (#4124)
This commit is contained in:
parent
c9259c793f
commit
6bb40e4d20
7 changed files with 64 additions and 8 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
* Copyright (c) 2025-2026 Meshtastic LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,6 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.meshtastic.feature.messaging
|
||||
|
||||
import androidx.compose.foundation.layout.Column
|
||||
|
|
@ -34,6 +33,7 @@ import org.jetbrains.compose.resources.pluralStringResource
|
|||
import org.jetbrains.compose.resources.stringResource
|
||||
import org.meshtastic.core.strings.Res
|
||||
import org.meshtastic.core.strings.close
|
||||
import org.meshtastic.core.strings.message_retry_count
|
||||
import org.meshtastic.core.strings.relays
|
||||
import org.meshtastic.core.strings.resend
|
||||
|
||||
|
|
@ -45,6 +45,8 @@ fun DeliveryInfo(
|
|||
text: StringResource? = null,
|
||||
relayNodeName: String? = null,
|
||||
relays: Int = 0,
|
||||
retryCount: Int = 0,
|
||||
maxRetries: Int = 0,
|
||||
onConfirm: (() -> Unit) = {},
|
||||
onDismiss: () -> Unit = {},
|
||||
) = AlertDialog(
|
||||
|
|
@ -78,6 +80,14 @@ fun DeliveryInfo(
|
|||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
if (maxRetries > 0) {
|
||||
Text(
|
||||
text = stringResource(Res.string.message_retry_count, retryCount, maxRetries),
|
||||
modifier = Modifier.padding(top = 8.dp),
|
||||
textAlign = TextAlign.Center,
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
)
|
||||
}
|
||||
if (relays != 0) {
|
||||
Text(
|
||||
text = pluralStringResource(Res.plurals.relays, relays, relays),
|
||||
|
|
|
|||
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright (c) 2025 Meshtastic LLC
|
||||
* Copyright (c) 2025-2026 Meshtastic LLC
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
|
|
@ -14,7 +14,6 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package org.meshtastic.feature.messaging
|
||||
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
|
|
@ -118,6 +117,8 @@ internal fun MessageListPaged(
|
|||
nodes = state.nodes,
|
||||
ourNode = state.ourNode,
|
||||
resendOption = message.status?.equals(MessageStatus.ERROR) ?: false,
|
||||
retryCount = message.retryCount,
|
||||
maxRetries = 5,
|
||||
onResend = {
|
||||
handlers.onDeleteMessages(listOf(message.uuid))
|
||||
handlers.onSendMessage(message.text, state.contactKey)
|
||||
|
|
@ -436,6 +437,8 @@ internal fun MessageStatusDialog(
|
|||
nodes: List<Node>,
|
||||
ourNode: Node?,
|
||||
resendOption: Boolean,
|
||||
retryCount: Int,
|
||||
maxRetries: Int,
|
||||
onResend: () -> Unit,
|
||||
onDismiss: () -> Unit,
|
||||
) {
|
||||
|
|
@ -454,6 +457,8 @@ internal fun MessageStatusDialog(
|
|||
text = text,
|
||||
relayNodeName = relayNodeName,
|
||||
relays = message.relays,
|
||||
retryCount = retryCount,
|
||||
maxRetries = maxRetries,
|
||||
onConfirm = onResend,
|
||||
onDismiss = onDismiss,
|
||||
)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue