aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClombrong <cromblong@egregore.fun>2025-08-17 16:29:18 +0200
committerClombrong <cromblong@egregore.fun>2025-08-17 16:48:17 +0200
commit22b7dcd4fae032630e4041c5d6bdda88bad1e8b9 (patch)
treebf87e2fae673b4a9c019e76b2e243038a938f9fd
parenta04aa5ab29225c836b369cb90e43543514390a1d (diff)
refactor!(portal): split portal creation in two functions
-rw-r--r--portal/portal.mli13
1 files changed, 6 insertions, 7 deletions
diff --git a/portal/portal.mli b/portal/portal.mli
index b8657ee..ae2b0c5 100644
--- a/portal/portal.mli
+++ b/portal/portal.mli
@@ -10,14 +10,13 @@ type domain
val domain_of_string : string -> domain
val domain_to_string : domain -> string
-(** The type of portals communicating with an XMPP server via [_socket].
+(** The type of portals communicating with an XMPP stream to the server located at [_socket].
- [stream] is the data sent by the XMPP server.
+ [stream] is the data sent to the XMPP server.
[push None] closes the XMPP stream and disconnects the underlying [_socket]. This is
- how XMPP streams should be ended. *)
+ how XMPP connections should be ended. *)
type t = {
- domain : domain;
mutable stream : (signal, async) stream;
mutable push : (signal, sync) stream option -> unit;
mutable _socket : socket;
@@ -29,8 +28,8 @@ type t = {
since the Portal interface is supposed to be agnostic. *)
val xmlns : string
-(** [connect domain] returns a Portal connected to the XMPP server [domain]. *)
-val connect : domain -> t Lwt.t
+(** [connect domain] returns a socket connected to the XMPP server [domain]. *)
+val connect : domain -> socket Lwt.t
(** [starttls portal] mutates [portal] into a TLS-encrypted stream with the same state.
@@ -44,7 +43,7 @@ val starttls : t -> unit Lwt.t
the response stream header.
When [from] is specified, a from attribute is included. *)
-val header : ?from:string -> t -> string Lwt.t
+val header : ?from:string -> socket -> t Lwt.t
(** [_encrypted socket] returns whether [socket] is encrypted, using TLS or otherwise. *)
val _encrypted : socket -> bool