diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-18 01:00:46 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-18 01:00:46 +0200 |
commit | f6bf68a86908f1967bda9573b6d1ae7c2f8c7078 (patch) | |
tree | e770b688f138955194a42107d6d100984b23cd85 | |
parent | f7dc0efb3581c259f6c5f18662bbdb0d336bbd0e (diff) |
fix(portal): return stream of signals instead of parsermarkup-rework
-rw-r--r-- | portal/lib/portal.mli | 2 | ||||
-rw-r--r-- | portal/lib/ws/portal.ml | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/portal/lib/portal.mli b/portal/lib/portal.mli index 3867f1b..5da97ad 100644 --- a/portal/lib/portal.mli +++ b/portal/lib/portal.mli @@ -1,6 +1,6 @@ open Markup -type t = async parser * ((signal, sync) stream option -> unit) +type t = (signal, async) stream * ((signal, sync) stream option -> unit) val stanza_open : ?from:string -> string -> (signal, sync) stream diff --git a/portal/lib/ws/portal.ml b/portal/lib/ws/portal.ml index 7ca70db..d5362c1 100644 --- a/portal/lib/ws/portal.ml +++ b/portal/lib/ws/portal.ml @@ -5,7 +5,7 @@ open Markup let jss = Js.string let sjs = Js.to_string -type t = async parser * ((signal, sync) stream option -> unit) +type t = (signal, async) stream * ((signal, sync) stream option -> unit) (* sic. XEP-0156: "host-meta files MUST be fetched only over HTTPS". I don't make the rules. *) let well_known_of (domain : string) = "https://" ^ domain ^ "/.well-known/host-meta" @@ -135,4 +135,4 @@ let connect domain = |> Markup_lwt.to_lwt_stream in let+ _ = Lwt_stream.iter (fun x -> ws_push (Some x)) stanzas in ws_push None in Lwt.async @@ (fun () -> Markup_lwt.(mu_stream |> lwt_stream |> iter to_frames)); - ws_stream |> lwt_stream |> strings_to_bytes |> parse_xml ~report, mu_push + ws_stream |> lwt_stream |> strings_to_bytes |> parse_xml ~report |> signals, mu_push |