xmpp.go
changeset 8 30a7752cf8f7
parent 6 8e425e340ca1
child 9 4fe926b03827
--- a/xmpp.go	Sun Dec 25 19:02:53 2011 -0700
+++ b/xmpp.go	Mon Dec 26 11:48:35 2011 -0700
@@ -73,6 +73,10 @@
 	go readXml(cl.tcp, cl.in, debug)
 	go writeXml(cl.tcp, cl.out, debug)
 
+	// Initial handshake.
+	hsOut := &Stream{To: jid.Domain, Version: Version}
+	cl.Out <- hsOut
+
 	return cl, nil
 }
 
@@ -125,8 +129,12 @@
 			continue
 		case "stream error":
 			obj = &StreamError{}
+		case nsStream + " features":
+			obj = &Features{}
 		default:
 			obj = &Unrecognized{}
+			log.Printf("Ignoring unrecognized: %s %s\n",
+				se.Name.Space, se.Name.Local)
 		}
 
 		// Read the complete XML stanza.