mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-04-20 22:23:37 +00:00
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:
parent
d252fde289
commit
fd90aa3b7a
2 changed files with 12 additions and 11 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue