Merge pull request #914 from a-f-G-U-C/admin-set-team

set Team field via Admin plugin
This commit is contained in:
Sacha Weatherstone 2021-11-03 06:53:11 +11:00 committed by GitHub
commit 334e14ea4d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,10 +137,15 @@ void AdminPlugin::handleSetOwner(const User &o)
strcpy(owner.id, o.id); strcpy(owner.id, o.id);
} }
if (owner.is_licensed != o.is_licensed) { if (owner.is_licensed != o.is_licensed) {
changed = true; changed = 1;
owner.is_licensed = o.is_licensed; owner.is_licensed = o.is_licensed;
} }
if ((!changed || o.team) && (owner.team != o.team)) {
changed = 1;
owner.team = o.team;
}
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(); service.reloadOwner();
} }