mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-29 06:06:38 +00:00
* now handle the case where onAdvertRecv() should _replace_ the anon contact slot
This commit is contained in:
@@ -146,6 +146,11 @@ void BaseChatMesh::onAdvertRecv(mesh::Packet* packet, const mesh::Identity& id,
|
|||||||
packet->header = save;
|
packet->header = save;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (from && from->type == ADV_TYPE_NONE) { // already in contacts, but from a temporary ANON_REQ ?
|
||||||
|
memset(from, 0, sizeof(*from)); // clear the anon/temp slot
|
||||||
|
from = NULL; // do normal 'add' flow
|
||||||
|
}
|
||||||
|
|
||||||
bool is_new = false; // true = not in contacts[], false = exists in contacts[]
|
bool is_new = false; // true = not in contacts[], false = exists in contacts[]
|
||||||
if (from == NULL) {
|
if (from == NULL) {
|
||||||
if (!shouldAutoAddContactType(parser.getType())) {
|
if (!shouldAutoAddContactType(parser.getType())) {
|
||||||
|
|||||||
Reference in New Issue
Block a user