libduvet/model/ready

Types

A voice state in a conversation’s call: it has no room.

pub type CallVoiceState {
  CallVoiceState(
    user_id: String,
    muted: Bool,
    deafened: Bool,
    screen_sharing: Bool,
    camera: Bool,
    version: Int,
  )
}

Constructors

  • CallVoiceState(
      user_id: String,
      muted: Bool,
      deafened: Bool,
      screen_sharing: Bool,
      camera: Bool,
      version: Int,
    )

    Arguments

    camera

    Their camera is on.

pub type GatewayReadyActiveCall {
  GatewayReadyActiveCall(
    conversation_id: String,
    initiator_id: String,
    initiator_name: option.Option(String),
    initiator_avatar: option.Option(String),
    voice_states: option.Option(List(CallVoiceState)),
    ringing: option.Option(Bool),
    answered: option.Option(Bool),
  )
}

Constructors

  • GatewayReadyActiveCall(
      conversation_id: String,
      initiator_id: String,
      initiator_name: option.Option(String),
      initiator_avatar: option.Option(String),
      voice_states: option.Option(List(CallVoiceState)),
      ringing: option.Option(Bool),
      answered: option.Option(Bool),
    )

    Arguments

    initiator_name

    The caller’s name and avatar, as CALL_INCOMING carries them.

    ringing

    Whether the call still rings for this user. None from a gateway that doesn’t say.

    answered

    Whether someone other than its caller has accepted the call. None from a gateway that doesn’t say.

READY’s data.

pub type GatewayReadyData {
  GatewayReadyData(
    user: user.GatewayUser,
    session_token: String,
    unread_rooms: option.Option(List(String)),
    last_read_rooms: option.Option(dict.Dict(String, String)),
    last_msg_rooms: option.Option(dict.Dict(String, String)),
    unread_convs: option.Option(List(String)),
    last_read_convs: option.Option(dict.Dict(String, String)),
    active_calls: option.Option(List(GatewayReadyActiveCall)),
    spaces: option.Option(List(space.GatewaySpace)),
    ice_servers: List(IceServer),
    guild_ids: List(String),
  )
}

Constructors

A STUN or TURN server for a peer connection, as READY hands them out.

pub type IceServer {
  IceServer(
    urls: List(String),
    username: option.Option(String),
    credential: option.Option(String),
  )
}

Constructors

Values

pub fn call_voice_state_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> CallVoiceState
pub fn ice_server_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> IceServer

urls may be one URL or a list; a credential that isn’t a password (an OAuth one) is left out.

pub fn ice_server_to_json(server: IceServer) -> json.Json
pub fn ready_active_call_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> GatewayReadyActiveCall
pub fn ready_data_from_json(
  object: dict.Dict(String, dynamic.Dynamic),
) -> GatewayReadyData
✨ Search Document