only store advblob when adding/updating contacts
This commit is contained in:
@@ -131,7 +131,6 @@ void BaseChatMesh::onAdvertRecv(mesh::Packet* packet, const mesh::Identity& id,
|
|||||||
plen = packet->writeTo(temp_buf);
|
plen = packet->writeTo(temp_buf);
|
||||||
packet->header = save;
|
packet->header = save;
|
||||||
}
|
}
|
||||||
putBlobByKey(id.pub_key, PUB_KEY_SIZE, temp_buf, plen);
|
|
||||||
|
|
||||||
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) {
|
||||||
@@ -157,6 +156,7 @@ void BaseChatMesh::onAdvertRecv(mesh::Packet* packet, const mesh::Identity& id,
|
|||||||
from->shared_secret_valid = false;
|
from->shared_secret_valid = false;
|
||||||
}
|
}
|
||||||
// update
|
// update
|
||||||
|
putBlobByKey(id.pub_key, PUB_KEY_SIZE, temp_buf, plen);
|
||||||
StrHelper::strncpy(from->name, parser.getName(), sizeof(from->name));
|
StrHelper::strncpy(from->name, parser.getName(), sizeof(from->name));
|
||||||
from->type = parser.getType();
|
from->type = parser.getType();
|
||||||
if (parser.hasLatLon()) {
|
if (parser.hasLatLon()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user