package erm_xmpp

  1. Overview
  2. Docs
exception Error of string
exception StreamError of StreamError.t
exception MalformedStanza
exception BadRequest
type 'a t
val return : 'a -> 'a t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
type iq_request =
  1. | IQSet of Xml.element
  2. | IQGet of Xml.element
type iq_response =
  1. | IQResult of Xml.element option
  2. | IQError of StanzaError.t
type iq =
  1. | IQRequest of iq_request
  2. | IQResponse of iq_response
type 'a session_data
val get_myjid : 'a session_data -> JID.t
val make_iq_request : 'a session_data -> ?jid_from:JID.t -> ?jid_to:JID.t -> ?lang:Xml.cdata -> iq_request -> (iq_response -> string option -> string option -> string option -> unit -> unit t) -> unit t
type !'a stanza = {
  1. id : XMPP.id option;
  2. jid_from : JID.t option;
  3. jid_to : string option;
  4. lang : string option;
  5. content : 'a;
  6. x : Xml.element list;
}
type message_type =
  1. | Normal
  2. | Chat
  3. | Groupchat
  4. | Headline
type message_content = {
  1. message_type : message_type option;
  2. body : string option;
  3. subject : string option;
  4. thread : string option;
}
val send_message : 'a session_data -> ?id:Xml.cdata -> ?jid_from:JID.t -> ?jid_to:JID.t -> ?kind:message_type -> ?lang:Xml.cdata -> ?body:Xml.cdata -> ?subject:Xml.cdata -> ?thread:Xml.cdata -> ?x:Xml.element list -> unit -> unit t
type presence_type =
  1. | Probe
  2. | Subscribe
  3. | Subscribed
  4. | Unsubscribe
  5. | Unsubscribed
  6. | Unavailable
val string_of_presence_type : presence_type -> string
type presence_show =
  1. | ShowChat
  2. | ShowAway
  3. | ShowDND
  4. | ShowXA
val string_of_show : presence_show -> string
type presence_content = {
  1. presence_type : presence_type option;
  2. show : presence_show option;
  3. status : string option;
  4. priority : int option;
}
type presence_stanza = presence_content stanza
val parse_presence : callback:('a session_data -> presence_content stanza -> unit t) -> callback_error: ('a session_data -> ?id:XMPP.id -> ?jid_from:JID.t -> ?jid_to:XMPP.id -> ?lang:XMPP.id -> StanzaError.t -> unit t) -> 'a session_data -> Xml.attribute list -> Xml.element list -> unit t
val send_presence : 'a session_data -> ?id:Xml.cdata -> ?jid_from:JID.t -> ?jid_to:JID.t -> ?kind:presence_type -> ?lang:Xml.cdata -> ?show:presence_show -> ?status:Xml.cdata -> ?priority:int -> ?x:Xml.element list -> unit -> unit t
OCaml

Innovation. Community. Security.