mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 23:08:11 +00:00
fix(live-share): exclude room servers from share targets
A [LOC] DM to a room server is delivered as a plain DM, not reposted to the room's members, so a room server can't act as a live-share broadcast target. The main contact picker already lists CHAT contacts only, but a favourited room server still showed up in the LEFT/RIGHT quick-cycle — skip it there, and reject a room in commitPickTargetDM as a backstop if the room-mode list is ever reachable during target pick. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -139,7 +139,10 @@ public:
|
||||
const uint8_t* pre = _prefs->favourite_contacts[i];
|
||||
bool empty = true;
|
||||
for (int b = 0; b < NodePrefs::FAVOURITE_PREFIX_LEN; b++) if (pre[b]) { empty = false; break; }
|
||||
if (empty || !the_mesh.lookupContactByPubKey(pre, NodePrefs::FAVOURITE_PREFIX_LEN)) continue;
|
||||
ContactInfo* fc = the_mesh.lookupContactByPubKey(pre, NodePrefs::FAVOURITE_PREFIX_LEN);
|
||||
// Skip room servers: a [LOC] DM to a room server isn't reposted to the
|
||||
// room's members, so it can't serve as a live-share broadcast target.
|
||||
if (empty || !fc || fc->type == ADV_TYPE_ROOM) continue;
|
||||
list[n].type = 1; list[n].ch = 0;
|
||||
memcpy(list[n].prefix, pre, NodePrefs::FAVOURITE_PREFIX_LEN); n++;
|
||||
}
|
||||
|
||||
@@ -908,6 +908,12 @@ public:
|
||||
}
|
||||
|
||||
void commitPickTargetDM(const ContactInfo& ci) {
|
||||
// A room server can't be a live-share target — a [LOC] DM to it is never
|
||||
// reposted to the room's members. Reject the pick and keep the chooser open.
|
||||
if (ci.type == ADV_TYPE_ROOM) {
|
||||
_task->showAlert("Rooms not supported", 1400);
|
||||
return;
|
||||
}
|
||||
NodePrefs* p = _task->getNodePrefs();
|
||||
if (p) {
|
||||
p->loc_share_target_type = 1;
|
||||
|
||||
Reference in New Issue
Block a user