Invites & Joining
mzchat supports room-level invitations that allow users to join guilds and channels across different servers using their cryptographic identity.
Invite Links
Section titled “Invite Links”Invite links use standard HTTPS URLs:
https://<host>[:port]/channels/<guildId>/<channelId>?token=<token>
host:port: The address of the server owning the channel.token: A short-lived, auto-generated alphanumeric string.
Joining Flow
Section titled “Joining Flow”When a client processes an invite link:
- Preview: The client connects to the server specified in the link and requests metadata (guild/channel names, member count) via
PreviewInvite(token). - Identity: If not already registered on the target server, the client performs a registration using its existing Ed25519 key pair to ensure network-wide identity consistency.
- Consumption: The client consumes the token via
JoinInvite(token). The server validates the token, adds the user to the guild membership, and assigns the default @everyone role. - Token Swap:
JoinInvitereturns a refreshed JWT containing the new guild roles. The client must save this token immediately to perform authenticated actions in the newly joined guild.
Permissions
Section titled “Permissions”Guild creators are automatically assigned the Admin role upon creation. Members joining via invite are granted the permissions associated with the @everyone role. All permissions are resolved based on the roles and versions encoded in the client’s session token.