summaryrefslogtreecommitdiff
path: root/xmpp/routing.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-07-04 22:30:44 +0200
committerxengineering <me@xengineering.eu>2023-07-04 22:30:44 +0200
commit107f97f2cd3ff8dbbdb39269e622462c48b0d41c (patch)
treecbd5120bf4f27fdcacd95313f7c1e0b6dd37e773 /xmpp/routing.go
parent48811e7d2487ebc3db49b8af7e20f57db4ac28f4 (diff)
downloadlimox-107f97f2cd3ff8dbbdb39269e622462c48b0d41c.tar
limox-107f97f2cd3ff8dbbdb39269e622462c48b0d41c.tar.zst
limox-107f97f2cd3ff8dbbdb39269e622462c48b0d41c.zip
Implement (chat) message receiving backend
This sets a handler and the routing up to be able to log chat messages with body and sender reference. This can later be used for the GUI.
Diffstat (limited to 'xmpp/routing.go')
-rw-r--r--xmpp/routing.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/xmpp/routing.go b/xmpp/routing.go
index 5cd2040..2f2347a 100644
--- a/xmpp/routing.go
+++ b/xmpp/routing.go
@@ -13,6 +13,8 @@ func route(s *xml.StartElement, d *xml.Decoder, c chan<- any) {
parse(saslSuccess{}, s, d, c)
case xml.Name{`jabber:client`, `iq`}:
parse(iqResponse{}, s, d, c)
+ case xml.Name{`jabber:client`, `message`}:
+ parse(message{}, s, d, c)
default:
d.Skip()
}
@@ -35,6 +37,8 @@ func handle(s *session, element any) {
handleSaslSuccess(s)
case iqResponse:
handleIqResponse(s, t)
+ case message:
+ handleMessage(s, t)
default:
log.Printf("Unknown parsed element: %v", t)
}