mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-08-01 09:46:22 +00:00
QuickMsgScreen: show only companion (chat) contacts
Filter contact list to ADV_TYPE_CHAT only — excludes repeaters, rooms, and sensors which cannot receive direct chat messages. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Sonnet 4.6
parent
76904f2ec5
commit
202060af12
@@ -391,17 +391,19 @@ public:
|
|||||||
_contact_sel = _contact_scroll = 0;
|
_contact_sel = _contact_scroll = 0;
|
||||||
_msg_sel = _msg_scroll = 0;
|
_msg_sel = _msg_scroll = 0;
|
||||||
_num_contacts = the_mesh.getNumContacts();
|
_num_contacts = the_mesh.getNumContacts();
|
||||||
// sort: favourites (flags & 0x01) first, rest after
|
// only show chat companions (not repeaters/rooms/sensors), favourites first
|
||||||
ContactInfo c;
|
ContactInfo c;
|
||||||
int nfavs = 0;
|
int nfavs = 0;
|
||||||
for (int i = 0; i < _num_contacts; i++)
|
for (int i = 0; i < _num_contacts; i++)
|
||||||
if (the_mesh.getContactByIdx(i, c) && (c.flags & 0x01)) nfavs++;
|
if (the_mesh.getContactByIdx(i, c) && c.type == ADV_TYPE_CHAT && (c.flags & 0x01)) nfavs++;
|
||||||
int fpos = 0, npos = nfavs;
|
int fpos = 0, npos = nfavs;
|
||||||
for (int i = 0; i < _num_contacts; i++) {
|
_num_contacts = 0;
|
||||||
if (the_mesh.getContactByIdx(i, c) && (c.flags & 0x01))
|
int total = the_mesh.getNumContacts();
|
||||||
_sorted[fpos++] = i;
|
for (int i = 0; i < total; i++) {
|
||||||
else
|
if (!the_mesh.getContactByIdx(i, c) || c.type != ADV_TYPE_CHAT) continue;
|
||||||
_sorted[npos++] = i;
|
if (c.flags & 0x01) _sorted[fpos++] = i;
|
||||||
|
else _sorted[npos++] = i;
|
||||||
|
_num_contacts++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user