From 8b608265772ba5df13d24071117c694bdfd1212a Mon Sep 17 00:00:00 2001 From: xengineering Date: Fri, 30 Jun 2023 13:07:12 +0200 Subject: Add session pointer to routing infrastructure It is nearly useless to route a XML element to an appropriate handler function if the latter has no idea how to send responses to the server or the GUI. Passing a pointer to the session solves this issue. --- xmpp/stream_pair.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'xmpp/stream_pair.go') diff --git a/xmpp/stream_pair.go b/xmpp/stream_pair.go index 8f70318..8ec06a6 100644 --- a/xmpp/stream_pair.go +++ b/xmpp/stream_pair.go @@ -28,7 +28,7 @@ func runStreamPair(s *session) { } if buf.isComplete() { element := buf.reset() - route(element, getRoutingTable()) + route(s, element, getRoutingTable()) } } } @@ -91,7 +91,7 @@ func closeStream(s *session) { } } -func streamFeaturesHandler(e []xml.Token) { +func streamFeaturesHandler(s *session, e []xml.Token) { sasl := hasSaslPlain(e) if sasl { log.Println("Stream is compatible with SASL PLAIN mechanism") -- cgit v1.2.3-70-g09d2