refactor(BaseChatMesh): extract onDiscoveredAdvert to keep upstream signature

Reverts onDiscoveredContact to the upstream 4-param signature, adding a
separate virtual onDiscoveredAdvert(bool was_flood) with a default no-op
implementation. Only MyMesh overrides the new virtual; simple_secure_chat
and any future implementors need no changes on upstream merges.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Jakub
2026-06-08 20:37:22 +02:00
co-authored by Claude Sonnet 4.6
parent ceea1df196
commit 2d6d35192b
5 changed files with 16 additions and 9 deletions
+3 -1
View File
@@ -360,9 +360,11 @@ void MyMesh::onContactsFull() {
}
}
void MyMesh::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path_len, const uint8_t* path, bool was_flood) {
void MyMesh::onDiscoveredAdvert(bool was_flood) {
if (_ui) _ui->notify(was_flood ? UIEventType::advertReceivedFlood : UIEventType::advertReceivedZeroHop);
}
void MyMesh::onDiscoveredContact(ContactInfo &contact, bool is_new, uint8_t path_len, const uint8_t* path) {
if (_serial->isConnected()) {
if (is_new) {
writeContactRespFrame(PUSH_CODE_NEW_ADVERT, contact);