fix: use truthy value for emoji field on Reaction packets (#4524)

Signed-off-by: James Rich <2199651+jamesarich@users.noreply.github.com>
This commit is contained in:
James Rich 2026-02-10 17:14:21 -06:00 committed by GitHub
parent d252fde289
commit fd90aa3b7a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 12 additions and 11 deletions

View file

@ -68,6 +68,7 @@ constructor(
companion object {
private const val DEFAULT_REBOOT_DELAY = 5
private const val EMOJI_INDICATOR = 1
}
fun onServiceAction(action: ServiceAction) {
@ -127,16 +128,15 @@ constructor(
val channel = action.contactKey[0].digitToInt()
val destId = action.contactKey.substring(1)
val dataPacket =
org.meshtastic.core.model
.DataPacket(
to = destId,
dataType = PortNum.TEXT_MESSAGE_APP.value,
bytes = action.emoji.encodeToByteArray().toByteString(),
channel = channel,
replyId = action.replyId,
wantAck = true,
emoji = action.emoji.codePointAt(0),
)
DataPacket(
to = destId,
dataType = PortNum.TEXT_MESSAGE_APP.value,
bytes = action.emoji.encodeToByteArray().toByteString(),
channel = channel,
replyId = action.replyId,
wantAck = true,
emoji = EMOJI_INDICATOR,
)
.apply { from = nodeManager.getMyId().takeIf { it.isNotEmpty() } ?: DataPacket.ID_LOCAL }
commandSender.sendData(dataPacket)
rememberReaction(action, dataPacket.id, myNodeNum)

View file

@ -52,6 +52,7 @@ class ReactionReceiver : BroadcastReceiver() {
const val EXTRA_CONTACT_KEY = "contactKey"
const val EXTRA_TO_ID = "toId"
const val EXTRA_CHANNEL_INDEX = "channelIndex"
private const val EMOJI_INDICATOR = 1
}
override fun onReceive(context: Context, intent: Intent) {
@ -80,7 +81,7 @@ class ReactionReceiver : BroadcastReceiver() {
dataType = PortNum.TEXT_MESSAGE_APP.value,
replyId = packetId,
wantAck = true,
emoji = emoji.codePointAt(0),
emoji = EMOJI_INDICATOR,
)
commandSender.sendData(reactionPacket)