summaryrefslogtreecommitdiff
path: root/xmpp/routing.go
diff options
context:
space:
mode:
authorxengineering <me@xengineering.eu>2023-07-06 21:21:33 +0200
committerxengineering <me@xengineering.eu>2023-07-06 21:21:33 +0200
commit553537a2c9f08450614648d7184b6bbf212d5ed5 (patch)
treebd804d8a9b5fa66bdcb115f522b0348feae809f1 /xmpp/routing.go
parent4cc9ea5cd439a1f5306f38838774b46d2b145d9a (diff)
downloadlimox-553537a2c9f08450614648d7184b6bbf212d5ed5.tar
limox-553537a2c9f08450614648d7184b6bbf212d5ed5.tar.zst
limox-553537a2c9f08450614648d7184b6bbf212d5ed5.zip
Use different IQ struct for RX and TX
It is quite tricky to write structs with correct XML struct tags which are suitable for RX and TX because in RX structs all possible fields have to be addressed and in TX some have to be hidden depending on the use case.
Diffstat (limited to 'xmpp/routing.go')
-rw-r--r--xmpp/routing.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/xmpp/routing.go b/xmpp/routing.go
index df45451..4058dfb 100644
--- a/xmpp/routing.go
+++ b/xmpp/routing.go
@@ -12,7 +12,7 @@ func route(s *xml.StartElement, d *xml.Decoder, c chan<- any) {
case xml.Name{`urn:ietf:params:xml:ns:xmpp-sasl`, `success`}:
parse(saslSuccess{}, s, d, c)
case xml.Name{`jabber:client`, `iq`}:
- parse(iq{}, s, d, c)
+ parse(iqRx{}, s, d, c)
case xml.Name{`jabber:client`, `message`}:
parse(message{}, s, d, c)
default:
@@ -35,8 +35,8 @@ func handle(s *session, element any) {
handleStreamFeatures(s, t)
case saslSuccess:
handleSaslSuccess(s)
- case iq:
- handleIq(s, t)
+ case iqRx:
+ t.handle(s)
case message:
handleMessage(s, t)
default: