Skip to main content

accept_invite

Function accept_invite 

Source
pub fn accept_invite(invite: &CommunityInvite) -> Result<Community, String>
Expand description

Accept a parked invite and persist the member-view Community (the user-consented half of the carrier — the inbound handler only parks invites; this is reached from an explicit accept command). Guards against id-collision overwrites:

  • if we already OWN a Community with this id, refuse (a member-view save would clobber our owner state);
  • if we already hold it as a member under a DIFFERENT server root, refuse — community_id is unauthenticated random bytes, so a hostile bundle reusing a known id must not be able to swap out our channel keys / authority / relays.

SessionGuard-gated: the accept may straddle a relay-fetch in the caller, and the save must land in the account that consented.