From 50618675c84d2246f48a18de206200d27a733300 Mon Sep 17 00:00:00 2001 From: xengineering Date: Sun, 21 May 2023 15:30:39 +0200 Subject: Implement SASL PLAIN authentication --- xmpp/jid.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'xmpp/jid.go') diff --git a/xmpp/jid.go b/xmpp/jid.go index f3a5d49..672e934 100644 --- a/xmpp/jid.go +++ b/xmpp/jid.go @@ -21,3 +21,23 @@ func domainpart(jid string) string { return string(list) } + +func username(jid string) string { + list := []rune(jid) + + for i, v := range list { + if v == '/' { + list = list[:i] + break + } + } + + for i, v := range list { + if v == '@' { + list = list[:i] + break + } + } + + return string(list) +} -- cgit v1.2.3-70-g09d2