diff options
| author | fiaxh <git@lightrise.org> | 2026-04-24 11:09:10 +0200 |
|---|---|---|
| committer | fiaxh <git@lightrise.org> | 2026-04-24 11:17:43 +0200 |
| commit | 9abf8f6869bc35c76bdfa86416012d4e7f0dda78 (patch) | |
| tree | 3c3f7628d7fdc5410113a8efc6b96a4372c6d80b /xmpp-vala/src/core/io_xmpp_stream.vala | |
| parent | c5ba4275ae68dd558108ce273dafa1bf890259e8 (diff) | |
Add support for Sasl2 + Bind2
Diffstat (limited to 'xmpp-vala/src/core/io_xmpp_stream.vala')
| -rw-r--r-- | xmpp-vala/src/core/io_xmpp_stream.vala | 17 |
1 files changed, 11 insertions, 6 deletions
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"); |
