Merge pull request #1 from meshcore-dev/dev

Merge dev branch
This commit is contained in:
Quency-D 2026-01-22 15:06:44 +08:00 committed by GitHub
commit 9f38835543
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 646 additions and 5 deletions

View file

@ -323,7 +323,7 @@ void MyMesh::onContactsFull() {
void MyMesh::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path_len, const uint8_t* path) {
if (_serial->isConnected()) {
if (!shouldAutoAddContactType(contact.type) && is_new) {
if (is_new) {
writeContactRespFrame(PUSH_CODE_NEW_ADVERT, contact);
} else {
out_frame[0] = PUSH_CODE_ADVERT;
@ -358,7 +358,7 @@ void MyMesh::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path
memcpy(p->path, path, p->path_len);
}
dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY);
if (!is_new) dirty_contacts_expiry = futureMillis(LAZY_CONTACTS_WRITE_DELAY); // only schedule lazy write for contacts that are in contacts[]
}
static int sort_by_recent(const void *a, const void *b) {