leave (37)
The leave message is sent by a user to a bot to request removal from a group chat or channel managed by that bot. The message is signed to prove that the request is authentic.
Core Data Types
IxiBytes: See IxiBytes Encoding.
Payload Structure
The payload contains the public key of the user who is leaving, which is used for signature verification.
| Field | Data Type | Min | Max | Description |
|---|---|---|---|---|
userPubKey | IxiBytes | * | * | The public key of the user initiating the leave request. |
Behavioral Notes
- Target: This message is always sent to a bot's address. The
friendobject in the sending context is the bot itself. - Signature: The
StreamMessagecontaining this payload MUST be signed with the private key corresponding touserPubKey. - Bot Action: Upon receiving a
leavemessage, the bot verifies the signature. If valid, it removes the user from its internal list of group members and stops sending them messages for that group. The bot should then respond with aleaveConfirmedmessage. - Client Action: After sending
leave, the user's client should mark the bot contact aspendingDeletionand await confirmation before removing it from the user's contact list.