mirror of
https://github.com/alexhopeoconnor/firmware.git
synced 2026-10-13 07:01:18 +10:00
Merge branch 'master' into nomad-gemini
This commit is contained in:
@@ -38,7 +38,7 @@
|
||||
#include "modules/PositionModule.h"
|
||||
#endif
|
||||
|
||||
#if !defined(ARCH_PORTDUINO) && !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||
#if !defined(ARCH_STM32WL) && !MESHTASTIC_EXCLUDE_I2C
|
||||
#include "motion/AccelerometerThread.h"
|
||||
#endif
|
||||
|
||||
@@ -284,7 +284,11 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
case meshtastic_AdminMessage_remove_by_nodenum_tag: {
|
||||
LOG_INFO("Client received remove_nodenum command");
|
||||
nodeDB->removeNodeByNum(r->remove_by_nodenum);
|
||||
this->notifyObservers(r); // Observed by screen
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_add_contact_tag: {
|
||||
LOG_INFO("Client received add_contact command");
|
||||
nodeDB->addFromContact(r->add_contact);
|
||||
break;
|
||||
}
|
||||
case meshtastic_AdminMessage_set_favorite_node_tag: {
|
||||
@@ -444,6 +448,9 @@ bool AdminModule::handleReceivedProtobuf(const meshtastic_MeshPacket &mp, meshta
|
||||
myReply = allocErrorResponse(meshtastic_Routing_Error_NONE, &mp);
|
||||
}
|
||||
|
||||
// Allow any observers (e.g. the UI) to respond to this event
|
||||
notifyObservers(r);
|
||||
|
||||
return handled;
|
||||
}
|
||||
|
||||
@@ -497,6 +504,12 @@ void AdminModule::handleSetOwner(const meshtastic_User &o)
|
||||
sendWarning(licensedModeMessage);
|
||||
}
|
||||
}
|
||||
if (owner.has_is_unmessagable != o.has_is_unmessagable ||
|
||||
(o.has_is_unmessagable && owner.is_unmessagable != o.is_unmessagable)) {
|
||||
changed = 1;
|
||||
owner.has_is_unmessagable = o.has_is_unmessagable || o.has_is_unmessagable;
|
||||
owner.is_unmessagable = o.is_unmessagable;
|
||||
}
|
||||
|
||||
if (changed) { // If nothing really changed, don't broadcast on the network or write to flash
|
||||
service->reloadOwner(!hasOpenEditTransaction);
|
||||
@@ -546,8 +559,10 @@ void AdminModule::handleSetConfig(const meshtastic_Config &c)
|
||||
sendWarning(warning);
|
||||
}
|
||||
// If we're setting router role for the first time, install its intervals
|
||||
if (existingRole != c.payload_variant.device.role)
|
||||
if (existingRole != c.payload_variant.device.role) {
|
||||
nodeDB->installRoleDefaults(c.payload_variant.device.role);
|
||||
changes |= SEGMENT_NODEDATABASE | SEGMENT_DEVICESTATE; // Some role defaults affect owner
|
||||
}
|
||||
if (config.device.node_info_broadcast_secs < min_node_info_broadcast_secs) {
|
||||
LOG_DEBUG("Tried to set node_info_broadcast_secs too low, setting to %d", min_node_info_broadcast_secs);
|
||||
config.device.node_info_broadcast_secs = min_node_info_broadcast_secs;
|
||||
|
||||
Reference in New Issue
Block a user