* fix for counter in RESP_CODE_CONTACTS_START
This commit is contained in:
1 parent
326e8de439
commit
7728baae11
2 files changed
+3
-2
No files matched your search
@@ -946,7 +946,7 @@ ContactsIterator BaseChatMesh::startContactsIterator() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool ContactsIterator::hasNext(const BaseChatMesh* mesh, ContactInfo& dest) {
|
bool ContactsIterator::hasNext(const BaseChatMesh* mesh, ContactInfo& dest) {
|
||||||
if (next_idx >= mesh->getNumContacts()) return false;
|
if (next_idx >= mesh->getTotalContactSlots()) return false;
|
||||||
|
|
||||||
dest = mesh->contacts[next_idx++];
|
dest = mesh->contacts[next_idx++];
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -172,7 +172,8 @@ public:
|
|||||||
ContactInfo* lookupContactByPubKey(const uint8_t* pub_key, int prefix_len);
|
ContactInfo* lookupContactByPubKey(const uint8_t* pub_key, int prefix_len);
|
||||||
bool removeContact(ContactInfo& contact);
|
bool removeContact(ContactInfo& contact);
|
||||||
bool addContact(const ContactInfo& contact);
|
bool addContact(const ContactInfo& contact);
|
||||||
int getNumContacts() const { return num_contacts; }
|
int getTotalContactSlots() const { return num_contacts; }
|
||||||
|
int getNumContacts() const { return num_contacts - MAX_ANON_CONTACTS; } // don't include the reserved slots at start
|
||||||
bool getContactByIdx(uint32_t idx, ContactInfo& contact);
|
bool getContactByIdx(uint32_t idx, ContactInfo& contact);
|
||||||
ContactsIterator startContactsIterator();
|
ContactsIterator startContactsIterator();
|
||||||
ChannelDetails* addChannel(const char* name, const char* psk_base64);
|
ChannelDetails* addChannel(const char* name, const char* psk_base64);
|
||||||
|
|||||||
Reference in new issue
Block a user