diff options
author | xengineering <me@xengineering.eu> | 2023-05-21 15:30:39 +0200 |
---|---|---|
committer | xengineering <me@xengineering.eu> | 2023-05-21 15:30:39 +0200 |
commit | 50618675c84d2246f48a18de206200d27a733300 (patch) | |
tree | af731af431d5d3059cfe8a9a5806860bf2ca8b12 /xmpp/jid.go | |
parent | 8d4ebab923ae23d1dfbc9b47eeabec33d3605ef5 (diff) | |
download | limox-50618675c84d2246f48a18de206200d27a733300.tar limox-50618675c84d2246f48a18de206200d27a733300.tar.zst limox-50618675c84d2246f48a18de206200d27a733300.zip |
Implement SASL PLAIN authentication
Diffstat (limited to 'xmpp/jid.go')
-rw-r--r-- | xmpp/jid.go | 20 |
1 files changed, 20 insertions, 0 deletions
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) +} |