Box Events
#
Identity ViewIdentity view is an object representing an actor within event worlds.
The identity contains complementary information and has some removed considering user privacy and wishes (profile configuration).
It can sometimes be bound to the key sender
, kicked
, deletor
...
⚠️ Consumer can rely on the identity id as it is the only information about the end-user always presented.
Here is the description of this view:
with attributes:
id
: (string, uuid) the unique id of the identity (can lead to the identity profile).display_name
: (string) the display name of the sender.avatar_url
: (string, nullable) the potential avatar url of the sender.identifier_value
: (string, emptyable) the value of the identifier.identifier_kind
, (string, emptyable, one of: email): the kind of the identifier.
#
EventsBoxes objects contain events. An event represents the messages sent to the box as well as changes made to the state of the box (closing the box, and in the future other operations such as changing the title etc ...).
Events are mainly used in the endpoints described here and here.
An event has the following fields:
Create
type event#
A box starts with a create
event
which is not posted by the client
but is instead inserted automatically by the backend
at the creation of the box.
An event of type create
has the following content fields:
Member
type events#
#
JoinThe member.join
event is sent by the user when they want to be a member of the box.
The user must have access to the box to send such an event.
Messages of type member.join
have no content field:
#
LeaveAn event of type member.leave
can be added by the user if they are member of the box.
It will automatically refers the previous member.join
event of the user.
An admin can not create a member.leave
event on their box.
#
KickAn event of type member.kick
is automatically added to the box by the backend
when an access.rm
removes the last access rules allowing some members to access the box.
If any other rules allows the members to access the box, the event is not triggered.
The event refers the previous member.join
event of the user, the sender_id
is set to the kicked member id.
Messages of type member.kick
have no content.
Once the event has been created for a user, the user cannot get/list the box anymore.
On read, the kicker_id
is transformed into a kicker
field containing sender information. This kicker
attribute is nullable.
Message
type events#
Messages allow the transfer of encrypted message text or blob data.
#
TextMessages of type msg.text
allow the transfer of message text.
#
FileMessages of type msg.file
allow the transfer of blob data.
#
Deleting a Message#
Editing a MessageUsers can edit their own messages.
Where referrer_id
is the ID of the event to edit.
- The sender's account must be the one that sent the event to edit.
- the message must not be already deleted
- the box must be not be closed
State
type events#
State events are meant to update the state of a box: information that can be set to only one value and are overriden when updated.
#
Access ModeThe state.access_mode
event changes the access mode of a box: public or limited.
Anyone can join a box in public mode. Only people matching access rules can join a box in a limited mode.
#
Key Sharestate.key_share
events change the key share of a box.
Remarks:
- all binary fields are encoded in unpadded URL-safe base64.
- this event does not have a
content
field
Side effects:
- the key share of the box will be changed (and all previous ones for this box are deleted)
- every ACR2 member of the box will receive a cryptoaction
with type
set_box_key_share
and encrypted content the value ofextra.encrypted_invitation_key_share
.
For more information on box key shares, see here.
Access
type events#
Access events are specific rules defined by the admins and allowing considering their logic who can access the box.
#
AddThe add of an access is represented by this event shape
Where auto_invite
is only required if restriction_type
is identifier
under some circumstances
(see Section “to a specific identifier value”).
Note that there is no content.value
field (it has been deprecated).
#
To a specific identifier valueOr, in order to automatically invite the identifier (through crypto actions):
Where extra
is a mapping from each identity public key of the identifier being added
to the encrypted crypto action to send to the corresponding identity.
This will create a crypto action with type invitation
and a notification with type box.auto_invite
.
#
To an entire email domain#
RemoveThe removal of an access is represented by this event shape:
#
Privileges#
MembersMembers are users that have lastly joined the box.
#
AdminsAdmins are considered as the users having the most advanced privileges on a box.
Today, only the creator of the box is considered as an admin.