This commit is contained in:
DaneEvans 2025-07-20 10:00:23 +10:00 committed by GitHub
parent 162f9e4492
commit f5d9c361fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 133 additions and 1 deletions

View file

@ -51,7 +51,8 @@ data class PacketEntity(
routingError = routingError,
packetId = packetId,
emojis = reactions.toReaction(getNode),
replyId = data.replyId
replyId = data.replyId,
viaMqtt = node.viaMqtt
)
}
}

View file

@ -62,6 +62,7 @@ data class Message(
val hopsAway: Int,
val replyId: Int?,
val originalMessage: Message? = null,
val viaMqtt: Boolean = false,
) {
fun getStatusStringRes(): Pair<Int, Int> {
val title = if (routingError > 0) R.string.error else R.string.message_delivery_status

View file

@ -27,7 +27,9 @@ import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.filled.Cloud
import androidx.compose.material.icons.filled.FormatQuote
import androidx.compose.material3.Card
import androidx.compose.material3.CardColors
@ -140,6 +142,13 @@ internal fun MessageItem(
style = MaterialTheme.typography.labelMedium,
modifier = Modifier.weight(1f, fill = true)
)
if (message.viaMqtt) {
Icon(
Icons.Default.Cloud,
contentDescription = stringResource(R.string.via_mqtt),
modifier = Modifier.size(16.dp)
)
}
MessageActions(
isLocal = message.fromLocal,
status = message.status,
@ -275,6 +284,7 @@ private fun MessageItemPreview() {
packetId = 4545,
emojis = listOf(),
replyId = null,
viaMqtt = false,
)
val received = Message(
text = "This is a received message",
@ -292,6 +302,7 @@ private fun MessageItemPreview() {
packetId = 4545,
emojis = listOf(),
replyId = null,
viaMqtt = false,
)
val receivedWithOriginalMessage = Message(
text = "This is a received message w/ original, this is a longer message to test next-lining.",
@ -310,6 +321,7 @@ private fun MessageItemPreview() {
emojis = listOf(),
replyId = null,
originalMessage = received,
viaMqtt = true,
)
AppTheme {
Column(