mirror of
https://github.com/meshtastic/firmware.git
synced 2025-08-10 15:37:17 +00:00
Add the ability to share ignored contacts (for blacklisting problematic nodes) (#7044)
This commit is contained in:
parent
66d5dde956
commit
ac52edd11a
@ -1545,15 +1545,25 @@ void NodeDB::addFromContact(meshtastic_SharedContact contact)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
info->num = contact.node_num;
|
info->num = contact.node_num;
|
||||||
info->last_heard = getValidTime(RTCQualityNTP);
|
|
||||||
info->has_user = true;
|
info->has_user = true;
|
||||||
info->user = TypeConversions::ConvertToUserLite(contact.user);
|
info->user = TypeConversions::ConvertToUserLite(contact.user);
|
||||||
info->is_favorite = true;
|
if (contact.should_ignore) {
|
||||||
// Mark the node's key as manually verified to indicate trustworthiness.
|
// If should_ignore is set,
|
||||||
info->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK;
|
// we need to clear the public key and other cruft, in addition to setting the node as ignored
|
||||||
updateGUIforNode = info;
|
info->is_ignored = true;
|
||||||
powerFSM.trigger(EVENT_NODEDB_UPDATED);
|
info->has_device_metrics = false;
|
||||||
notifyObservers(true); // Force an update whether or not our node counts have changed
|
info->has_position = false;
|
||||||
|
info->user.public_key.size = 0;
|
||||||
|
info->user.public_key.bytes[0] = 0;
|
||||||
|
} else {
|
||||||
|
info->last_heard = getValidTime(RTCQualityNTP);
|
||||||
|
info->is_favorite = true;
|
||||||
|
info->bitfield |= NODEINFO_BITFIELD_IS_KEY_MANUALLY_VERIFIED_MASK;
|
||||||
|
// Mark the node's key as manually verified to indicate trustworthiness.
|
||||||
|
updateGUIforNode = info;
|
||||||
|
powerFSM.trigger(EVENT_NODEDB_UPDATED);
|
||||||
|
notifyObservers(true); // Force an update whether or not our node counts have changed
|
||||||
|
}
|
||||||
saveNodeDatabaseToDisk();
|
saveNodeDatabaseToDisk();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user