summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--xmpp/routing.go9
-rw-r--r--xmpp/session.go2
2 files changed, 10 insertions, 1 deletions
diff --git a/xmpp/routing.go b/xmpp/routing.go
index 2b1680f..b184b1c 100644
--- a/xmpp/routing.go
+++ b/xmpp/routing.go
@@ -22,3 +22,12 @@ func parse[T any](data T, s *xml.StartElement, d *xml.Decoder, c chan<- any) {
c <- data
}
}
+
+func handle(element any) {
+ switch t := element.(type) {
+ case streamFeatures:
+ log.Println("Handling stream features ...")
+ default:
+ log.Printf("Unknown parsed element: %v", t)
+ }
+}
diff --git a/xmpp/session.go b/xmpp/session.go
index 6abc343..a4120e9 100644
--- a/xmpp/session.go
+++ b/xmpp/session.go
@@ -64,7 +64,7 @@ func (s *session) run() {
for {
select {
case e := <-s.rx:
- log.Print(e)
+ handle(e)
case signal := <-s.in:
switch signal.(type) {
case SessionShouldDisconnect: