From 9abf8f6869bc35c76bdfa86416012d4e7f0dda78 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Fri, 24 Apr 2026 11:09:10 +0200 Subject: Add support for Sasl2 + Bind2 --- xmpp-vala/src/core/io_xmpp_stream.vala | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'xmpp-vala/src/core/io_xmpp_stream.vala') diff --git a/xmpp-vala/src/core/io_xmpp_stream.vala b/xmpp-vala/src/core/io_xmpp_stream.vala index 1d9d061b..e13d1448 100644 --- a/xmpp-vala/src/core/io_xmpp_stream.vala +++ b/xmpp-vala/src/core/io_xmpp_stream.vala @@ -74,12 +74,7 @@ public abstract class Xmpp.IoXmppStream : XmppStream { } public override async void setup() throws IOError { - StanzaNode outs = new StanzaNode.build("stream", "http://etherx.jabber.org/streams") - .put_attribute("to", remote_name.to_string()) - .put_attribute("version", "1.0") - .put_attribute("xmlns", "jabber:client") - .put_attribute("stream", "http://etherx.jabber.org/streams", XMLNS_URI); - outs.has_nodes = true; + StanzaNode outs = generate_root_node(); log.node("OUT ROOT", outs, this); yield write_async(outs, Priority.HIGH, cancellable); received_root_node(this, yield read_root()); @@ -87,6 +82,16 @@ public abstract class Xmpp.IoXmppStream : XmppStream { setup_needed = false; } + public virtual StanzaNode generate_root_node() { + StanzaNode root_node = new StanzaNode.build("stream", "http://etherx.jabber.org/streams") + .put_attribute("to", remote_name.to_string()) + .put_attribute("version", "1.0") + .put_attribute("xmlns", "jabber:client") + .put_attribute("stream", "http://etherx.jabber.org/streams", XMLNS_URI); + root_node.has_nodes = true; + return root_node; + } + private async StanzaNode read_root() throws IOError { StanzaReader? reader = this.reader; if (reader == null) throw new IOError.NOT_CONNECTED("trying to read, but no stream open"); -- cgit v1.3