From 3a5e9fce02264eeed884b15781593479fda9296a Mon Sep 17 00:00:00 2001 From: xengineering Date: Tue, 4 Jul 2023 14:25:21 +0200 Subject: Rework routing completely --- xmpp/routing.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 xmpp/routing.go (limited to 'xmpp/routing.go') 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() + } +} -- cgit v1.2.3-70-g09d2