package erm_xmpp

  1. Overview
  2. Docs

Parameters

Signature

type 'a t = 'a M.t
val return : 'a -> 'a t
val (>>=) : 'a t -> ('a -> 'b t) -> 'b t
val fail : exn -> 'a t
val catch : (unit -> 'a t) -> (exn -> 'a t) -> 'a t
module X : sig ... end
exception Error of string
exception StreamError of StreamError.t
exception MalformedStanza
exception BadRequest
module NS : sig ... end
module IQRequestCallback : sig ... end
module Qname : sig ... end
module StanzaHandler : sig ... end
val ns_streams : string option
val ns_server : string option
val ns_client : string option
val ns_xmpp_tls : string option
val ns_xmpp_sasl : string option
val ns_xmpp_bind : string option
val ns_xmpp_session : string option
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
module type Socket = sig ... end
type !'a session_data = {
  1. mutable socket : (module Socket);
  2. p : X.p;
  3. mutable sid : int;
  4. mutable iq_response : (iq_response -> string option -> string option -> string option -> unit -> unit t) IDCallback.t;
  5. mutable iq_request : (iq_request -> string option -> string option -> string option -> unit -> iq_response t) IQRequestCallback.t;
  6. mutable stanza_handlers : ('a session_data -> Xml.attribute list -> Xml.element list -> unit t) StanzaHandler.t;
  7. mutable myjid : JID.t;
  8. ser : Xml.Serialization.t;
  9. user_data : 'a;
}
val string_of_option : string option -> string
val maybe : ('a -> 'b) -> 'a option -> 'b option
val get_myjid : 'a session_data -> JID.t
val make_stanza_attrs : ?id:Xml.cdata -> ?jid_from:Xml.cdata -> ?jid_to:Xml.cdata -> ?kind:Xml.cdata -> ?lang:Xml.cdata -> unit -> Xml.attribute list
val make_stanza_attrs_reply : ?lang:Xml.cdata -> ?kind:Xml.cdata -> Xml.attribute list -> Xml.attribute list
val parse_stanza_attrs : ((Xml.namespace * string) * 'a) list -> 'a option * 'a option * 'a option * 'a option * 'a option
val send : 'a session_data -> string -> unit M.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 M.t
type !'a stanza = {
  1. id : 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 string_of_message_type : message_type -> string
type message_stanza = message_content stanza
val parse_message : callback:('a -> message_content stanza -> 'b) -> callback_error: ('a -> ?id:id -> ?jid_from:JID.t -> ?jid_to:id -> ?lang:id -> StanzaError.t -> 'b) -> 'a -> ((Xml.namespace * string) * id) list -> Xml.element list -> 'b
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 M.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 -> presence_content stanza -> 'b) -> callback_error: ('a -> ?id:id -> ?jid_from:JID.t -> ?jid_to:id -> ?lang:id -> StanzaError.t -> 'b) -> 'a -> ((Xml.namespace * string) * id) list -> Xml.element list -> 'b
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 M.t
val send_error_reply : 'a session_data -> StanzaError.condition -> ?text:string -> ?lang:string -> Xml.qname -> Xml.attribute list -> Xml.element list -> unit M.t
val register_iq_request_handler : 'a session_data -> IQRequestCallback.key -> (iq_request -> string option -> string option -> string option -> unit -> iq_response t) -> unit
val unregister_iq_request_handler : 'a session_data -> IQRequestCallback.key -> unit
val register_stanza_handler : 'a session_data -> StanzaHandler.key -> ('a session_data -> Xml.attribute list -> Xml.element list -> unit t) -> unit
val unregister_stanza_handler : 'a session_data -> StanzaHandler.key -> unit
val process_iq : 'a session_data -> ((Xml.namespace * string) * Xml.cdata) list -> Xml.element list -> unit t
val make_session : 'a session_data -> ('a session_data -> unit t) -> unit M.t
val make_bind : 'a session_data -> ('a session_data -> unit t) -> unit M.t
exception AuthError of string
exception AuthFailure of string
val sasl_digest : 'a session_data -> string -> ('a session_data -> unit t) -> unit M.t
val sasl_plain : 'a session_data -> string -> ('a session_data -> unit t) -> unit M.t
val sasl_auth : 'a session_data -> Xml.element list -> Xml.cdata option -> string -> ('a session_data -> unit t) -> unit t
val starttls : 'a session_data -> ('a session_data -> unit t) -> Xml.cdata option -> string -> ('a session_data -> unit t) -> unit M.t
val start_stream : 'a session_data -> ?tls:('a session_data -> unit t) -> ?compress:'b -> Xml.cdata option -> string -> ('a session_data -> unit t) -> unit t
val close_stream : 'a session_data -> unit M.t
val stream_stanza : 'a session_data -> (StanzaHandler.key * Xml.attribute list * Xml.element list) -> unit t
val stream_start : (string option * string) -> Xml.attribute list -> unit t
val stream_end : 'a -> unit -> unit t
val create_session_data : (module Socket) -> JID.t -> 'a -> 'a session_data
val open_stream : 'a session_data -> ?tls_socket:(unit -> (module Socket) t) -> ?lang:Xml.cdata -> string -> ('a session_data -> unit t) -> unit t
val setup_session : myjid:JID.t -> user_data:'a -> plain_socket:(module Socket) -> ?tls_socket:(unit -> (module Socket) M.t) -> ?lang:Xml.cdata -> password:string -> ('a session_data -> unit t) -> 'a session_data t
val parse : 'a session_data -> unit M.t
OCaml

Innovation. Community. Security.