mirror of
https://github.com/jkingsman/Remote-Terminal-for-MeshCore.git
synced 2026-07-06 01:42:11 +02:00
Always clear fav flag on a blind load
This commit is contained in:
@@ -48,6 +48,7 @@ _GET_CONTACTS_TIMEOUT = 10
|
||||
AdvertMode = Literal["flood", "zero_hop"]
|
||||
|
||||
_AUTO_ADD_OVERWRITE_OLDEST = 0x01
|
||||
_RADIO_CONTACT_FAVORITE = 0x01
|
||||
|
||||
|
||||
async def _enable_autoevict_on_radio(mc: MeshCore) -> bool:
|
||||
@@ -1298,6 +1299,12 @@ async def _reconcile_radio_contacts_in_background(
|
||||
public_key = contact.public_key.lower()
|
||||
try:
|
||||
add_payload = contact.to_radio_dict()
|
||||
# In autoevict mode, app-loaded contacts should
|
||||
# remain evictable by the radio even if the
|
||||
# stored contact record carries the favorite bit.
|
||||
add_payload["flags"] = (
|
||||
int(add_payload.get("flags", 0)) & ~_RADIO_CONTACT_FAVORITE
|
||||
)
|
||||
add_result = await mc.commands.add_contact(add_payload)
|
||||
except Exception as exc:
|
||||
failed += 1
|
||||
|
||||
Reference in New Issue
Block a user