Skip to content

Commit

Permalink
add SASL login support
Browse files Browse the repository at this point in the history
  • Loading branch information
Habbie committed Feb 18, 2019
1 parent a415d78 commit b364ef7
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,18 @@ func (i *IRCCat) signalHandler() {
func (i *IRCCat) connectIRC() error {
irccon := irc.IRC(viper.GetString("irc.nick"), viper.GetString("irc.realname"))
i.irc = irccon
irccon.RequestCaps = []string{"away-notify", "account-notify", "draft/message-tags-0.2"}
// requesting any caps breaks SASL
// irccon.RequestCaps = []string{"away-notify", "account-notify", "draft/message-tags-0.2"}
irccon.UseTLS = viper.GetBool("irc.tls")
if viper.IsSet("irc.sasl_pass") && viper.GetString("irc.sasl_pass") != "" {
if viper.IsSet("irc.sasl_login") && viper.GetString("irc.sasl_login") != "" {
irccon.SASLLogin = viper.GetString("irc.sasl_login")
} else {
irccon.SASLLogin = viper.GetString("irc.nick")
}
irccon.SASLPassword = viper.GetString("irc.sasl_pass")
irccon.UseSASL = true
}
if viper.GetBool("irc.tls_skip_verify") {
irccon.TLSConfig = &tls.Config{InsecureSkipVerify: true}
}
Expand Down

0 comments on commit b364ef7

Please sign in to comment.