Online Status And Membership Visibility¶
Status Dot Meaning¶
- Green: online and direct connection is available.
- Orange: online through relay.
- Grey: offline.
Code Semantics¶
isOnlinemeans reachable, either direct or relayed.isDirectConnectmeans direct path is available.isRelayedmeans reachable only through relay.isReachableis the preferred helper for call sites that only need transport availability.
Recommended usage:
- Use
isReachablefor send/accept/reject gating and other transport checks. - Use
isDirectConnectandisRelayedfor UI presentation, diagnostics, or behavior that depends on route type. - Avoid duplicating checks like
isOnline || isRelayedat call sites; useisReachableto keep intent explicit.
Relevant Join/Identity Flow¶
- A user joins a host (Group/ChatRoom/RandomConnect).
- Host accepts join and sends
PktHostJoinReplyto the new member. - Host sends existing member identities (
PktAnnounce) to the new member (sendMemberListToClient). - Host broadcasts the new member's
PktAnnounceto existing members. - Clients receiving a host member identity issue a
PktAnnounceto that peer with request-reply semantics so both sides learn each other for contact/list visibility.
Note: host-provided member identities use guest friendship (my/his = eFriendStateGuest) by design. Friendship is not the transport trigger for visibility in this flow.
Bug: Missing Members Depending On Join Order¶
Symptom¶
- Sometimes not all members appear in lists after join.
- Behavior appears dependent on who joined most recently.
Root Cause¶
In HostServerMgr::sendMemberListToClient, the loop used an inverted connection check:
- Before (buggy): break when
sktBase->isConnected()is true. - Effect: loop exits after first successful send, so only one prior member identity is delivered.
Fix¶
Changed the loop guard to break only when disconnected:
- After (fixed): break when
!sktBase->isConnected().
This ensures all currently known members are sent to the newly joined client, regardless of join order.
Related Relay Authorization Fix¶
Also fixed a separate relay authorization regression in MemberActiveMgr::isUserJoinedToRelayHost:
- Before: user/host match used
||. - After: user/host match uses
&&.
This prevents false-positive relay authorization for users who are not actually joined to the relay host.