mirror of
https://github.com/meshtastic/firmware.git
synced 2025-09-14 14:31:24 +00:00
Add NodeDB::isFavorite, NodeDB::isFromOrToFavoritedNode
This commit is contained in:
parent
3cc2b70e4f
commit
484b4cd848
@ -1770,6 +1770,20 @@ void NodeDB::set_favorite(bool is_favorite, uint32_t nodeId)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool NodeDB::isFavorite(uint32_t nodeId)
|
||||||
|
{
|
||||||
|
meshtastic_NodeInfoLite *lite = getMeshNode(nodeId);
|
||||||
|
if (lite) {
|
||||||
|
return lite->is_favorite;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool NodeDB::isFromOrToFavoritedNode(const meshtastic_MeshPacket &p)
|
||||||
|
{
|
||||||
|
return isFavorite(p.from) || isFavorite(p.to);
|
||||||
|
}
|
||||||
|
|
||||||
void NodeDB::pause_sort(bool paused)
|
void NodeDB::pause_sort(bool paused)
|
||||||
{
|
{
|
||||||
sortingIsPaused = paused;
|
sortingIsPaused = paused;
|
||||||
|
@ -185,6 +185,16 @@ class NodeDB
|
|||||||
*/
|
*/
|
||||||
void set_favorite(bool is_favorite, uint32_t nodeId);
|
void set_favorite(bool is_favorite, uint32_t nodeId);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns true if the node is in the NodeDB and marked as favorite
|
||||||
|
*/
|
||||||
|
bool isFavorite(uint32_t nodeId);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Returns true if p->from or p->to is a favorited node
|
||||||
|
*/
|
||||||
|
bool isFromOrToFavoritedNode(const meshtastic_MeshPacket &p);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Other functions like the node picker can request a pause in the node sorting
|
* Other functions like the node picker can request a pause in the node sorting
|
||||||
*/
|
*/
|
||||||
|
Loading…
Reference in New Issue
Block a user