mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-01 01:35:48 +00:00
* companion radio: new command frames: CMD_SET_ADVERT_LATLON, CMD_REMOVE_CONTACT
This commit is contained in:
@@ -281,6 +281,22 @@ bool BaseChatMesh::addContact(const ContactInfo& contact) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool BaseChatMesh::removeContact(ContactInfo& contact) {
|
||||
int idx = 0;
|
||||
while (idx < num_contacts && !contacts[idx].id.matches(contact.id)) {
|
||||
idx++;
|
||||
}
|
||||
if (idx >= num_contacts) return false; // not found
|
||||
|
||||
// remove from contacts array
|
||||
num_contacts--;
|
||||
while (idx < num_contacts) {
|
||||
contacts[idx] = contacts[idx + 1];
|
||||
idx++;
|
||||
}
|
||||
return true; // Success
|
||||
}
|
||||
|
||||
#ifdef MAX_GROUP_CHANNELS
|
||||
#include <base64.hpp>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user