mirror of
https://github.com/meshtastic/Meshtastic-Android.git
synced 2026-03-15 04:16:47 -04:00
admin channel not case-sensitive
This commit is contained in:
@@ -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) {
|
||||
try {
|
||||
|
||||
@@ -930,7 +930,7 @@ class MeshService : Service(), Logging {
|
||||
}
|
||||
|
||||
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 {
|
||||
channelSetRepository.addSettings(ch)
|
||||
}
|
||||
@@ -1354,7 +1354,7 @@ class MeshService : Service(), Logging {
|
||||
}
|
||||
|
||||
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) {
|
||||
setChannel = ch
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user