Browse Source

Switch to forked go-ircevent and enable IRC3 caps

tags/v0.3.0
Russ Garrett 7 years ago
parent
commit
3cd8107475
No account linked to committer's email address
6 changed files with 9 additions and 6 deletions
  1. 1
    1
      auth.go
  2. 1
    1
      command.go
  3. 1
    1
      dispatcher/dispatcher.go
  4. 1
    1
      httplistener/httplistener.go
  5. 4
    1
      main.go
  6. 1
    1
      tcplistener/tcplistener.go

+ 1
- 1
auth.go View File

1
 package main
1
 package main
2
 
2
 
3
 import (
3
 import (
4
-	"github.com/thoj/go-ircevent"
4
+	"github.com/irccloud/go-ircevent"
5
 	"strings"
5
 	"strings"
6
 )
6
 )
7
 
7
 

+ 1
- 1
command.go View File

3
 import (
3
 import (
4
 	"bytes"
4
 	"bytes"
5
 	"fmt"
5
 	"fmt"
6
+	"github.com/irccloud/go-ircevent"
6
 	"github.com/spf13/viper"
7
 	"github.com/spf13/viper"
7
-	"github.com/thoj/go-ircevent"
8
 	"os"
8
 	"os"
9
 	"os/exec"
9
 	"os/exec"
10
 	"strings"
10
 	"strings"

+ 1
- 1
dispatcher/dispatcher.go View File

1
 package dispatcher
1
 package dispatcher
2
 
2
 
3
 import (
3
 import (
4
+	"github.com/irccloud/go-ircevent"
4
 	"github.com/juju/loggo"
5
 	"github.com/juju/loggo"
5
 	"github.com/spf13/viper"
6
 	"github.com/spf13/viper"
6
-	"github.com/thoj/go-ircevent"
7
 	"strings"
7
 	"strings"
8
 )
8
 )
9
 
9
 

+ 1
- 1
httplistener/httplistener.go View File

1
 package httplistener
1
 package httplistener
2
 
2
 
3
 import (
3
 import (
4
+	"github.com/irccloud/go-ircevent"
4
 	"github.com/juju/loggo"
5
 	"github.com/juju/loggo"
5
 	"github.com/spf13/viper"
6
 	"github.com/spf13/viper"
6
-	"github.com/thoj/go-ircevent"
7
 	"net/http"
7
 	"net/http"
8
 )
8
 )
9
 
9
 

+ 4
- 1
main.go View File

5
 	"fmt"
5
 	"fmt"
6
 	"github.com/deckarep/golang-set"
6
 	"github.com/deckarep/golang-set"
7
 	"github.com/fsnotify/fsnotify"
7
 	"github.com/fsnotify/fsnotify"
8
+	"github.com/irccloud/go-ircevent"
8
 	"github.com/irccloud/irccat/httplistener"
9
 	"github.com/irccloud/irccat/httplistener"
9
 	"github.com/irccloud/irccat/tcplistener"
10
 	"github.com/irccloud/irccat/tcplistener"
10
 	"github.com/juju/loggo"
11
 	"github.com/juju/loggo"
11
 	"github.com/spf13/viper"
12
 	"github.com/spf13/viper"
12
-	"github.com/thoj/go-ircevent"
13
 	"os"
13
 	"os"
14
 	"os/signal"
14
 	"os/signal"
15
 	"strings"
15
 	"strings"
85
 
85
 
86
 func (i *IRCCat) connectIRC() error {
86
 func (i *IRCCat) connectIRC() error {
87
 	irccon := irc.IRC(viper.GetString("irc.nick"), viper.GetString("irc.realname"))
87
 	irccon := irc.IRC(viper.GetString("irc.nick"), viper.GetString("irc.realname"))
88
+	irccon.RequestCaps = []string{"away-notify", "account-notify", "draft/message-tags-0.2"}
88
 	irccon.UseTLS = viper.GetBool("irc.tls")
89
 	irccon.UseTLS = viper.GetBool("irc.tls")
89
 	if viper.GetBool("irc.tls_skip_verify") {
90
 	if viper.GetBool("irc.tls_skip_verify") {
90
 		irccon.TLSConfig = &tls.Config{InsecureSkipVerify: true}
91
 		irccon.TLSConfig = &tls.Config{InsecureSkipVerify: true}
91
 	}
92
 	}
93
+	irccon.Password = viper.GetString("irc.server_pass")
92
 
94
 
93
 	err := irccon.Connect(viper.GetString("irc.server"))
95
 	err := irccon.Connect(viper.GetString("irc.server"))
94
 	if err != nil {
96
 	if err != nil {
115
 }
117
 }
116
 
118
 
117
 func (i *IRCCat) handleWelcome(e *irc.Event) {
119
 func (i *IRCCat) handleWelcome(e *irc.Event) {
120
+	log.Infof("Negotiated IRCv3 capabilities: %v", i.irc.AcknowledgedCaps)
118
 	if viper.IsSet("irc.identify_pass") && viper.GetString("irc.identify_pass") != "" {
121
 	if viper.IsSet("irc.identify_pass") && viper.GetString("irc.identify_pass") != "" {
119
 		i.irc.SendRawf("NICKSERV IDENTIFY %s", viper.GetString("irc.identify_pass"))
122
 		i.irc.SendRawf("NICKSERV IDENTIFY %s", viper.GetString("irc.identify_pass"))
120
 	}
123
 	}

+ 1
- 1
tcplistener/tcplistener.go View File

2
 
2
 
3
 import (
3
 import (
4
 	"bufio"
4
 	"bufio"
5
+	"github.com/irccloud/go-ircevent"
5
 	"github.com/irccloud/irccat/dispatcher"
6
 	"github.com/irccloud/irccat/dispatcher"
6
 	"github.com/juju/loggo"
7
 	"github.com/juju/loggo"
7
 	"github.com/spf13/viper"
8
 	"github.com/spf13/viper"
8
-	"github.com/thoj/go-ircevent"
9
 	"net"
9
 	"net"
10
 	"strings"
10
 	"strings"
11
 )
11
 )

Loading…
Cancel
Save