summaryrefslogtreecommitdiffstats
path: root/vendor/github.com/thoj/go-ircevent/sasl.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2016-08-14 21:48:51 +0200
committerWim <wim@42.be>2016-08-14 22:44:59 +0200
commitff9479670070c0f1de4cf66622df7b69736dd22a (patch)
treec3003f19d8821900398b5b2803188555725030b6 /vendor/github.com/thoj/go-ircevent/sasl.go
parent1f72ca4c4ecb5ab3ef831b8e70c74909f5720fb8 (diff)
downloadmatterbridge-msglm-ff9479670070c0f1de4cf66622df7b69736dd22a.tar.gz
matterbridge-msglm-ff9479670070c0f1de4cf66622df7b69736dd22a.tar.bz2
matterbridge-msglm-ff9479670070c0f1de4cf66622df7b69736dd22a.zip
Refactor bridge. Allows bridging between every protocol
Diffstat (limited to 'vendor/github.com/thoj/go-ircevent/sasl.go')
-rw-r--r--vendor/github.com/thoj/go-ircevent/sasl.go54
1 files changed, 0 insertions, 54 deletions
diff --git a/vendor/github.com/thoj/go-ircevent/sasl.go b/vendor/github.com/thoj/go-ircevent/sasl.go
deleted file mode 100644
index e5ff9e38..00000000
--- a/vendor/github.com/thoj/go-ircevent/sasl.go
+++ /dev/null
@@ -1,54 +0,0 @@
-package irc
-
-import (
- "encoding/base64"
- "errors"
- "fmt"
- "strings"
-)
-
-type SASLResult struct {
- Failed bool
- Err error
-}
-
-func (irc *Connection) setupSASLCallbacks(result chan<- *SASLResult) {
- irc.AddCallback("CAP", func(e *Event) {
- if len(e.Arguments) == 3 {
- if e.Arguments[1] == "LS" {
- if !strings.Contains(e.Arguments[2], "sasl") {
- result <- &SASLResult{true, errors.New("no SASL capability " + e.Arguments[2])}
- }
- }
- if e.Arguments[1] == "ACK" {
- if irc.SASLMech != "PLAIN" {
- result <- &SASLResult{true, errors.New("only PLAIN is supported")}
- }
- irc.SendRaw("AUTHENTICATE " + irc.SASLMech)
- }
- }
- })
- irc.AddCallback("AUTHENTICATE", func(e *Event) {
- str := base64.StdEncoding.EncodeToString([]byte(fmt.Sprintf("%s\x00%s\x00%s", irc.SASLLogin, irc.SASLLogin, irc.SASLPassword)))
- irc.SendRaw("AUTHENTICATE " + str)
- })
- irc.AddCallback("901", func(e *Event) {
- irc.SendRaw("CAP END")
- irc.SendRaw("QUIT")
- result <- &SASLResult{true, errors.New(e.Arguments[1])}
- })
- irc.AddCallback("902", func(e *Event) {
- irc.SendRaw("CAP END")
- irc.SendRaw("QUIT")
- result <- &SASLResult{true, errors.New(e.Arguments[1])}
- })
- irc.AddCallback("903", func(e *Event) {
- irc.SendRaw("CAP END")
- result <- &SASLResult{false, nil}
- })
- irc.AddCallback("904", func(e *Event) {
- irc.SendRaw("CAP END")
- irc.SendRaw("QUIT")
- result <- &SASLResult{true, errors.New(e.Arguments[1])}
- })
-}