fix: don't broadcast public keys if the user is licensed (#5190)

Co-authored-by: Ben Meadors <benmmeadors@gmail.com>
Co-authored-by: Jonathan Bennett <jbennett@incomsystems.biz>
This commit is contained in:
Andre K 2024-10-30 14:05:09 -03:00 committed by GitHub
parent 5f6e19d971
commit 28b469dbf0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -81,6 +81,12 @@ meshtastic_MeshPacket *NodeInfoModule::allocReply()
ignoreRequest = false; // Don't ignore requests anymore
meshtastic_User &u = owner;
// Strip the public key if the user is licensed
if (u.is_licensed && u.public_key.size > 0) {
u.public_key.bytes[0] = 0;
u.public_key.size = 0;
}
LOG_INFO("sending owner %s/%s/%s", u.id, u.long_name, u.short_name);
lastSentToMesh = millis();
return allocDataProtobuf(u);