diff options
author | xengineering <me@xengineering.eu> | 2023-07-04 14:25:21 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-07-04 14:26:01 +0200 |
commit | 3a5e9fce02264eeed884b15781593479fda9296a (patch) | |
tree | 96fc5facb359c70c26623621f6022202f994054f /xmpp/routing.go | |
parent | 1d3dfa5b93000bc4109ba49ea018e72fbf4f5753 (diff) | |
download | limox-3a5e9fce02264eeed884b15781593479fda9296a.tar limox-3a5e9fce02264eeed884b15781593479fda9296a.tar.zst limox-3a5e9fce02264eeed884b15781593479fda9296a.zip |
Rework routing completely
Diffstat (limited to 'xmpp/routing.go')
-rw-r--r-- | xmpp/routing.go | 21 |
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() + } +} |