From 3c33d393ddf06b6552b6dd7fbe85ddb985233968 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sat, 3 Jun 2023 21:33:33 +0200 Subject: Implement dummy XML encoder and decoder --- xmpp/encoder_decoder.go | 11 +++++++++++ xmpp/session.go | 7 +++++-- 2 files changed, 16 insertions(+), 2 deletions(-) create mode 100644 xmpp/encoder_decoder.go (limited to 'xmpp') diff --git a/xmpp/encoder_decoder.go b/xmpp/encoder_decoder.go new file mode 100644 index 0000000..c2d0423 --- /dev/null +++ b/xmpp/encoder_decoder.go @@ -0,0 +1,11 @@ +package xmpp + +type encoderDecoder struct{ + session *session +} + +func newEncoderDecoder(s *session) encoderDecoder { + ed := encoderDecoder{s} + + return ed +} diff --git a/xmpp/session.go b/xmpp/session.go index d8e4973..71b3acf 100644 --- a/xmpp/session.go +++ b/xmpp/session.go @@ -11,17 +11,20 @@ type SessionDisconnect struct{} type SessionShouldDisconnect struct{} type session struct { - in, out chan any jid string + in, out chan any transport *tls.Conn + ed encoderDecoder } func StartSession(out chan any, jid string, pwd string) chan any { s := session{} + s.jid = jid s.in = make(chan any) s.out = out - s.jid = jid + + s.ed = newEncoderDecoder(&s) go s.run() -- cgit v1.2.3-70-g09d2