diff options
author | Clombrong <cromblong@egregore.fun> | 2025-06-26 11:28:23 +0200 |
---|---|---|
committer | Clombrong <cromblong@egregore.fun> | 2025-06-26 16:26:14 +0200 |
commit | bc9430e1bc04c2d66f806b403dfa1fe2f24e9720 (patch) | |
tree | 6147c4fc08d67efa3c530691c9f05b1f3d4f7017 /portal/tcp/portal.ml | |
parent | 89bd44ddf5e253c4acf8a2b452b28346a4c8eedf (diff) |
fix(portal_tcp): provide the right xmlns
Diffstat (limited to 'portal/tcp/portal.ml')
-rw-r--r-- | portal/tcp/portal.ml | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/portal/tcp/portal.ml b/portal/tcp/portal.ml index 0532c39..e44732d 100644 --- a/portal/tcp/portal.ml +++ b/portal/tcp/portal.ml @@ -4,7 +4,7 @@ open Markup type t = (signal, async) stream * ((signal, sync) stream option -> unit) -let xmlns = "jabber:client" +let xmlns = "http://etherx.jabber.org/streams" exception MalformedStanza of Markup.location * Markup.Error.t @@ -13,9 +13,8 @@ let header ?from domain ((stream, push) : t) = let attributes = [(("", "to"), domain); (("", "version"), "1.0"); (("http://www.w3.org/XML/1998/namespace", "lang"), "en"); - (("http://www.w3.org/2000/xmlns/", "xmlns"), xmlns); - (("http://www.w3.org/2000/xmlns/", "stream"), - "http://etherx.jabber.org/streams")] + (("http://www.w3.org/2000/xmlns/", "xmlns"), "jabber:client"); + (("http://www.w3.org/2000/xmlns/", "stream"), xmlns)] in [`Xml {version="1.0"; encoding=None; standalone=None}; `Start_element (("http://etherx.jabber.org/streams", "stream"), @@ -38,7 +37,7 @@ let header ?from domain ((stream, push) : t) = let* stream_open = Markup_lwt.next stream in begin match stream_open with - | Some `Start_element (("http://etherx.jabber.org/streams", "stream"), attributes) -> + | Some `Start_element ((ns, "stream"), attributes) when ns = xmlns-> List.find_map (fun ((_, name), value) -> if name = "id" then Some value else None) attributes |