summaryrefslogtreecommitdiff
path: root/xmpp/routing.go
diff options
context:
space:
mode:
Diffstat (limited to 'xmpp/routing.go')
-rw-r--r--xmpp/routing.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/xmpp/routing.go b/xmpp/routing.go
new file mode 100644
index 0000000..e8aa4ed
--- /dev/null
+++ b/xmpp/routing.go
@@ -0,0 +1,21 @@
+package xmpp
+
+import (
+ "encoding/xml"
+ "log"
+)
+
+func route(s *xml.StartElement, d *xml.Decoder, c chan<- any) {
+ switch (*s).Name {
+ case xml.Name{`http://etherx.jabber.org/streams`, `features`}:
+ data := streamFeatures{}
+ err := d.DecodeElement(&data, s)
+ if err != nil {
+ log.Printf("Could not decode stream features: %v\n", err)
+ } else {
+ log.Print(data) // TODO
+ }
+ default:
+ d.Skip()
+ }
+}