diff --git a/docs/README.md b/docs/README.md index 982bb4f67..e268de0d7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -42,6 +42,7 @@ For an detailed walk-through aimed at beginners, we recommend [meshtastic.letsta ### Related Groups Telegram group for **Italy**-based users [t.me/meshtastic_italia](http://t.me/meshtastic_italia) (Italian language, unofficial). +Telegram group for **Russian**-based users [t.me/meshtastic_russia](https://t.me/meshtastic_russia) (Russian language, unofficial). # Updates diff --git a/src/mesh/NodeDB.cpp b/src/mesh/NodeDB.cpp index 876a66bc5..22c1ccb6f 100644 --- a/src/mesh/NodeDB.cpp +++ b/src/mesh/NodeDB.cpp @@ -357,12 +357,16 @@ void NodeDB::updatePosition(uint32_t nodeId, const Position &p) DEBUG_MSG("DB update position node=0x%x time=%u, latI=%d, lonI=%d\n", nodeId, p.time, p.latitude_i, p.longitude_i); - auto oldtime = info->position.time; - info->position = p; - if(p.time == 0 && oldtime != 0) { - // A lot of position reports don't have time populated. In that case, be careful to not blow away the time we - // recorded based on the packet rxTime - info->position.time = oldtime; + // Be careful to only update fields that have been set by the sender + // A lot of position reports don't have time populated. In that case, be careful to not blow away the time we + // recorded based on the packet rxTime + if (!info->position.time && p.time) + info->position.time = p.time; + if(p.battery_level) + info->position.battery_level = p.battery_level; + if (p.latitude_i || p.longitude_i) { + info->position.latitude_i = p.latitude_i; + info->position.longitude_i = p.longitude_i; } info->has_position = true; updateGUIforNode = info;