xmpp.go
changeset 11 48be1ae93fd4
parent 10 f38b0ee7b1c1
child 12 122ab6208c3c
--- a/xmpp.go	Mon Dec 26 18:07:14 2011 -0700
+++ b/xmpp.go	Tue Dec 27 15:36:07 2011 -0700
@@ -23,6 +23,7 @@
 	nsStreams = "urn:ietf:params:xml:ns:xmpp-streams"
 	nsStream = "http://etherx.jabber.org/streams"
 	nsTLS = "urn:ietf:params:xml:ns:xmpp-tls"
+	nsSASL = "urn:ietf:params:xml:ns:xmpp-sasl"
 
 	// DNS SRV names
 	serverSrv = "xmpp-server"
@@ -34,8 +35,10 @@
 // The client in a client-server XMPP connection.
 type Client struct {
 	Jid JID
+	password string
 	socket net.Conn
 	socketSync sync.WaitGroup
+	saslExpected string
 	In <-chan interface{}
 	Out chan<- interface{}
 	xmlOut chan<- interface{}
@@ -74,6 +77,7 @@
 	}
 
 	cl := new(Client)
+	cl.password = password
 	cl.Jid = *jid
 	cl.socket = tcp
 
@@ -136,7 +140,7 @@
 
 func (cl *Client) startStreamReader(xmlIn <-chan interface{}, srvOut chan<- interface{}) <-chan interface{} {
 	ch := make(chan interface{})
-	go cl.readStream(xmlIn, srvOut, ch)
+	go cl.readStream(xmlIn, ch)
 	return ch
 }