aboutsummaryrefslogtreecommitdiff
path: root/lib/flesh.ml
diff options
context:
space:
mode:
Diffstat (limited to 'lib/flesh.ml')
-rw-r--r--lib/flesh.ml31
1 files changed, 0 insertions, 31 deletions
diff --git a/lib/flesh.ml b/lib/flesh.ml
index d9574b8..49f4102 100644
--- a/lib/flesh.ml
+++ b/lib/flesh.ml
@@ -5,34 +5,3 @@ module Starttls = Starttls
module Wire = Wire
module Xml = Xml
module Jid = Jid
-
-open Lwt.Syntax
-open Lwt.Infix
-
-(** [connect domain config] is a promise containing the portal connected to the XMPP
- server located at [domain], and all its supported features.
-
- Basically, it conforms to {{:
- https://datatracker.ietf.org/doc/html/rfc6120#section-4.3 }}, and gets the provided
- Portal in a "ready" state. *)
-let connect (domain : string) (config : Stream.config) : (Portal.t * Stream.features) Lwt.t =
- let open Portal in
- let open Stream in
- let* portal = connect domain
- in
- let needs_restart = function
- | Feature.Mechanisms _ | STARTTLS -> true
- | _ -> false
- in
- let+ features =
- let rec handle_features (features : Stream.features) : Stream.features Lwt.t =
- match features with
- | feature :: rest ->
- let* () = negotiate feature portal config
- in if needs_restart (Feature.unwrap feature)
- then start domain portal >>= handle_features
- else handle_features rest
- | features -> Lwt.return features
- in start domain portal >>= handle_features
- in (portal, features)
-