~samwhited/xmpp

cdf17c3c083fb748799fefdc483d3b6a3aa1ad7d — Sam Whited 4 years ago 3f972ba
Add a way to get the streams encoder/decoder

This gives StreamFeatures a way to use the same encoder/decoder that
created the stream so that we don't get them out of sync with the stream
somehow.
1 files changed, 10 insertions(+), 0 deletions(-)

M conn.go
M conn.go => conn.go +10 -0
@@ 79,6 79,16 @@ func (c *Conn) Raw() io.ReadWriteCloser {
	return c.rwc
}

// Decoder returns the XML decoder that was used to negotiate the latest stream.
func (c *Conn) Decoder() *xml.Decoder {
	return c.in.d
}

// Encoder returns the XML encoder that was used to negotiate the latest stream.
func (c *Conn) Encoder() *xml.Encoder {
	return c.out.e
}

// Config returns the connections config.
func (c *Conn) Config() *Config {
	return c.config