diff --git a/prisma/migrations/20250810082255_add_node_max_hops/migration.sql b/prisma/migrations/20250810082255_add_node_max_hops/migration.sql new file mode 100644 index 0000000..b9dc9b4 --- /dev/null +++ b/prisma/migrations/20250810082255_add_node_max_hops/migration.sql @@ -0,0 +1,2 @@ +-- AlterTable +ALTER TABLE `nodes` ADD COLUMN `max_hops` INTEGER NULL; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index fcb0a77..10bd2c8 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -54,7 +54,8 @@ model Node { mqtt_connection_state_updated_at DateTime? ok_to_mqtt Boolean? - is_backbone Boolean? + is_backbone Boolean? + max_hops Int? created_at DateTime @default(now()) updated_at DateTime @default(now()) @updatedAt diff --git a/src/mqtt.js b/src/mqtt.js index c7a2b1d..6078f10 100644 --- a/src/mqtt.js +++ b/src/mqtt.js @@ -947,6 +947,7 @@ client.on("message", async (topic, message) => { role: user.role, is_unmessagable: user.isUnmessagable, ok_to_mqtt: isOkToMqtt, + max_hops: envelope.packet.hopStart, firmware_version: '<2.5.0', ...(user.publicKey != '' && { @@ -965,6 +966,7 @@ client.on("message", async (topic, message) => { role: user.role, is_unmessagable: user.isUnmessagable, ok_to_mqtt: isOkToMqtt, + max_hops: envelope.packet.hopStart, firmware_version: '<2.5.0', ...(user.publicKey != '' && {