kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
admin channel not case-sensitive
rodzic
f310bb2019
commit
d29c86ee74
|
@ -383,7 +383,8 @@ class UIViewModel @Inject constructor(
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
val adminChannelIndex: Int get() = channelSet.settingsList.map { it.name }.indexOf("admin")
|
val adminChannelIndex: Int
|
||||||
|
get() = channelSet.settingsList.map { it.name.lowercase() }.indexOf("admin")
|
||||||
|
|
||||||
fun requestShutdown(idNum: Int) {
|
fun requestShutdown(idNum: Int) {
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -930,7 +930,7 @@ class MeshService : Service(), Logging {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun addChannelSettings(ch: ChannelProtos.Channel) {
|
private fun addChannelSettings(ch: ChannelProtos.Channel) {
|
||||||
if (ch.index == 0 || ch.settings.name == "admin") adminChannelIndex = ch.index
|
if (ch.index == 0 || ch.settings.name.lowercase() == "admin") adminChannelIndex = ch.index
|
||||||
serviceScope.handledLaunch {
|
serviceScope.handledLaunch {
|
||||||
channelSetRepository.addSettings(ch)
|
channelSetRepository.addSettings(ch)
|
||||||
}
|
}
|
||||||
|
@ -1354,7 +1354,7 @@ class MeshService : Service(), Logging {
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun setChannel(ch: ChannelProtos.Channel) {
|
private fun setChannel(ch: ChannelProtos.Channel) {
|
||||||
if (ch.index == 0 || ch.settings.name == "admin") adminChannelIndex = ch.index
|
if (ch.index == 0 || ch.settings.name.lowercase() == "admin") adminChannelIndex = ch.index
|
||||||
sendToRadio(newMeshPacketTo(myNodeNum).buildAdminPacket(wantResponse = true) {
|
sendToRadio(newMeshPacketTo(myNodeNum).buildAdminPacket(wantResponse = true) {
|
||||||
setChannel = ch
|
setChannel = ch
|
||||||
})
|
})
|
||||||
|
|
Ładowanie…
Reference in New Issue