From 512a217cca62563a1ed0e577289e21ed2203b37b Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 30 Jun 2023 19:58:48 +0200 Subject: Add log-only handler for received IQ stanzas This handler is just a placeholder for a more extensive IQ handling but already writes to the log so that it is obvious what is happening. --- xmpp/router.go | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/xmpp/router.go b/xmpp/router.go index 9d69033..1d9c3e5 100644 --- a/xmpp/router.go +++ b/xmpp/router.go @@ -25,9 +25,17 @@ func getRoutingTable() routingTable { {xml.Name{`http://etherx.jabber.org/streams`, `features`}, streamFeaturesHandler}, {xml.Name{`urn:ietf:params:xml:ns:xmpp-sasl`, `success`}, saslSuccessHandler}, {xml.Name{`urn:ietf:params:xml:ns:xmpp-sasl`, `failure`}, saslFailureHandler}, + {xml.Name{`jabber:client`, `iq`}, voidIq}, } } +// voidIq just logs that an IQ element was received. In the current state of +// the software there is no further processing. +// TODO process IQs for error handling and further information processing. +func voidIq(s *session, e []xml.Token) { + log.Println("Received IQ element") +} + // route determines the correct handler function for the given XML element by a // given routingTable. In addition it executes the determined handler function. // If no handler function is found an error message is send via the log module. -- cgit v1.2.3-70-g09d2