mirror of
https://github.com/pablorevilla-meshtastic/meshview.git
synced 2026-10-31 03:01:58 +01:00
* Include the node's public key in the contact QR code #184 The contact QR code and import URL never set user.public_key. Current Meshtastic apps refuse to import a keyless contact. On 2.7.x firmware, an older app's add_contact also overwrites the key the radio already holds, so direct messages to that node fail. Read the key from the node's latest stored NODEINFO_APP packet. Share the contact only when a 32-byte key is known. Otherwise the node page hides the QR buttons and says why. The QR API response now also returns public_key. Also drop the stray blank line that fails ruff format --check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Do not share a contact when a node has reported more than one key #184 A forged NODEINFO uplinked over MQTT could otherwise become the newest packet, and the shared contact would then replace the key a scanning radio already trusts. The QR endpoint now reads every stored NODEINFO from the node and refuses to share when their 32-byte keys disagree. It reports that in public_key_conflict, and the node page says why. Add an index on packet (from_node_id, portnum, import_time_us DESC) so the lookup reads only the node's NODEINFO packets. Order with NULLS LAST so PostgreSQL does not treat old rows without import_time_us as newest. Carry is_licensed and is_unmessagable into the contact. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> * Skip NODEINFO rows with no payload when building the contact #184 packet.payload is nullable, and MeshPacket.FromString(None) raises TypeError, so one such row made the QR endpoint answer 500. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Generic single-database configuration.