Module type Client.S

type transport

Transport

type transport_options

Client

type t

Type of the client

type credentials = [
| `JidPassword of Jid.t * string(*

A JID password pair

*)
| `Anonymous of string(*

Anonymously

*)
]

Credentials used to authenticate with XMPP server

val create : ?seed:Stdlib.Random.State.t -> transport_options -> credentials:credentials -> t Lwt.t

Connection & State

val connect : t -> unit Lwt.t
val disconnect : t -> unit Lwt.t
type state =
| Disconnected
| Connected of Jid.t
val pp_state : state Fmt.t
val state : t -> state React.signal
val on_connect : t -> Jid.t React.event
val jid : t -> Jid.t Lwt.t

XMPP

val stanzas : t -> Stanza.t React.event
val iq_gets : ?element:Xmlm.name -> t -> Stanza.Iq.get React.event
val iq_sets : ?element:Xmlm.name -> t -> Stanza.Iq.set React.event
exception StanzaError of Stanza.Error.t
val iq_get : t -> ?to':Jid.t -> Xmlc.Tree.t -> Stanza.Iq.result Lwt.t
val iq_set : t -> ?to':Jid.t -> Xmlc.Tree.t -> Stanza.Iq.result Lwt.t
val send_message : t -> Stanza.Message.t -> unit Lwt.t
val send_iq : t -> Stanza.Iq.t -> unit Lwt.t
val send_presence : t -> Stanza.Presence.t -> unit Lwt.t

Low-levels

val send_xml : t -> Xmlc.Tree.t -> unit Lwt.t
val generate_id : t -> string