mirror of
https://github.com/meshtastic/firmware.git
synced 2025-04-28 18:47:40 +00:00
Remove setOwner's business logic for licensed operation
This commit is contained in:
parent
b1677e0312
commit
4375a0101e
@ -212,7 +212,6 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
|||||||
void AdminModule::handleSetOwner(const meshtastic_User &o)
|
void AdminModule::handleSetOwner(const meshtastic_User &o)
|
||||||
{
|
{
|
||||||
int changed = 0;
|
int changed = 0;
|
||||||
bool licensed_changed = false;
|
|
||||||
|
|
||||||
if (*o.long_name) {
|
if (*o.long_name) {
|
||||||
changed |= strcmp(owner.long_name, o.long_name);
|
changed |= strcmp(owner.long_name, o.long_name);
|
||||||
@ -227,15 +226,12 @@ void AdminModule::handleSetOwner(const meshtastic_User &o)
|
|||||||
strncpy(owner.id, o.id, sizeof(owner.id));
|
strncpy(owner.id, o.id, sizeof(owner.id));
|
||||||
}
|
}
|
||||||
if (owner.is_licensed != o.is_licensed) {
|
if (owner.is_licensed != o.is_licensed) {
|
||||||
changed = 1;
|
|
||||||
licensed_changed = true;
|
|
||||||
owner.is_licensed = o.is_licensed;
|
owner.is_licensed = o.is_licensed;
|
||||||
config.lora.override_duty_cycle = owner.is_licensed; // override duty cycle for licensed operators
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changed) { // If nothing really changed, don't broadcast on the network or write to flash
|
if (changed) { // If nothing really changed, don't broadcast on the network or write to flash
|
||||||
service.reloadOwner(!hasOpenEditTransaction);
|
service.reloadOwner(!hasOpenEditTransaction);
|
||||||
licensed_changed ? saveChanges(SEGMENT_CONFIG | SEGMENT_DEVICESTATE) : saveChanges(SEGMENT_DEVICESTATE);
|
saveChanges(SEGMENT_DEVICESTATE);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user