Skip to content

Commit

Permalink
Switch to forked go-ircevent and enable IRC3 caps
Browse files Browse the repository at this point in the history
  • Loading branch information
russss committed Jan 25, 2017
1 parent 630dd04 commit 3cd8107
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion auth.go
@@ -1,7 +1,7 @@
package main

import (
"github.com/thoj/go-ircevent"
"github.com/irccloud/go-ircevent"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion command.go
Expand Up @@ -3,8 +3,8 @@ package main
import (
"bytes"
"fmt"
"github.com/irccloud/go-ircevent"
"github.com/spf13/viper"
"github.com/thoj/go-ircevent"
"os"
"os/exec"
"strings"
Expand Down
2 changes: 1 addition & 1 deletion dispatcher/dispatcher.go
@@ -1,9 +1,9 @@
package dispatcher

import (
"github.com/irccloud/go-ircevent"
"github.com/juju/loggo"
"github.com/spf13/viper"
"github.com/thoj/go-ircevent"
"strings"
)

Expand Down
2 changes: 1 addition & 1 deletion httplistener/httplistener.go
@@ -1,9 +1,9 @@
package httplistener

import (
"github.com/irccloud/go-ircevent"
"github.com/juju/loggo"
"github.com/spf13/viper"
"github.com/thoj/go-ircevent"
"net/http"
)

Expand Down
5 changes: 4 additions & 1 deletion main.go
Expand Up @@ -5,11 +5,11 @@ import (
"fmt"
"github.com/deckarep/golang-set"
"github.com/fsnotify/fsnotify"
"github.com/irccloud/go-ircevent"
"github.com/irccloud/irccat/httplistener"
"github.com/irccloud/irccat/tcplistener"
"github.com/juju/loggo"
"github.com/spf13/viper"
"github.com/thoj/go-ircevent"
"os"
"os/signal"
"strings"
Expand Down Expand Up @@ -85,10 +85,12 @@ func (i *IRCCat) signalHandler() {

func (i *IRCCat) connectIRC() error {
irccon := irc.IRC(viper.GetString("irc.nick"), viper.GetString("irc.realname"))
irccon.RequestCaps = []string{"away-notify", "account-notify", "draft/message-tags-0.2"}
irccon.UseTLS = viper.GetBool("irc.tls")
if viper.GetBool("irc.tls_skip_verify") {
irccon.TLSConfig = &tls.Config{InsecureSkipVerify: true}
}
irccon.Password = viper.GetString("irc.server_pass")

err := irccon.Connect(viper.GetString("irc.server"))
if err != nil {
Expand All @@ -115,6 +117,7 @@ func (i *IRCCat) connectIRC() error {
}

func (i *IRCCat) handleWelcome(e *irc.Event) {
log.Infof("Negotiated IRCv3 capabilities: %v", i.irc.AcknowledgedCaps)
if viper.IsSet("irc.identify_pass") && viper.GetString("irc.identify_pass") != "" {
i.irc.SendRawf("NICKSERV IDENTIFY %s", viper.GetString("irc.identify_pass"))
}
Expand Down
2 changes: 1 addition & 1 deletion tcplistener/tcplistener.go
Expand Up @@ -2,10 +2,10 @@ package tcplistener

import (
"bufio"
"github.com/irccloud/go-ircevent"
"github.com/irccloud/irccat/dispatcher"
"github.com/juju/loggo"
"github.com/spf13/viper"
"github.com/thoj/go-ircevent"
"net"
"strings"
)
Expand Down

0 comments on commit 3cd8107

Please sign in to comment.