Browse Source

use ergochat/irc-go instead of goshuirc/irc-go

tags/v2.8.0-rc1
Shivaram Lingamneni 2 years ago
parent
commit
4910aefa37

+ 2
- 1
go.mod View File

@@ -9,10 +9,11 @@ require (
9 9
 	github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815
10 10
 	github.com/ergochat/confusables v0.0.0-20201108231250-4ab98ab61fb1
11 11
 	github.com/ergochat/go-ident v0.0.0-20200511222032-830550b1d775
12
+	github.com/ergochat/irc-go v0.0.0-20210617222258-256f1601d3ce
12 13
 	github.com/go-sql-driver/mysql v1.6.0
13 14
 	github.com/go-test/deep v1.0.6 // indirect
14 15
 	github.com/gorilla/websocket v1.4.2
15
-	github.com/goshuirc/irc-go v0.0.0-20210318074529-bdc2c2cd2fef
16
+	github.com/goshuirc/irc-go v0.0.0-20210318074529-bdc2c2cd2fef // indirect
16 17
 	github.com/onsi/ginkgo v1.12.0 // indirect
17 18
 	github.com/onsi/gomega v1.9.0 // indirect
18 19
 	github.com/oragono/confusables v0.0.0-20201108231250-4ab98ab61fb1 // indirect

+ 2
- 0
go.sum View File

@@ -13,6 +13,8 @@ github.com/ergochat/confusables v0.0.0-20201108231250-4ab98ab61fb1 h1:WLHTOodthV
13 13
 github.com/ergochat/confusables v0.0.0-20201108231250-4ab98ab61fb1/go.mod h1:mov+uh1DPWsltdQnOdzn08UO9GsJ3MEvhtu0Ci37fdk=
14 14
 github.com/ergochat/go-ident v0.0.0-20200511222032-830550b1d775 h1:QSJIdpr3HOzJDPwxT7hp7WbjoZcS+5GqVvsBscqChk0=
15 15
 github.com/ergochat/go-ident v0.0.0-20200511222032-830550b1d775/go.mod h1:d2qvgjD0TvGNSvUs+mZgX090RiJlrzUYW6vtANGOy3A=
16
+github.com/ergochat/irc-go v0.0.0-20210617222258-256f1601d3ce h1:RfyjeynouKZjmnN8WGzCSrtuHGZ9dwfSYBq405FPoqs=
17
+github.com/ergochat/irc-go v0.0.0-20210617222258-256f1601d3ce/go.mod h1:2vi7KNpIPWnReB5hmLpl92eMywQvuIeIIGdt/FQCph0=
16 18
 github.com/ergochat/websocket v1.4.2-oragono1 h1:plMUunFBM6UoSCIYCKKclTdy/TkkHfUslhOfJQzfueM=
17 19
 github.com/ergochat/websocket v1.4.2-oragono1/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
18 20
 github.com/fsnotify/fsnotify v1.4.7 h1:IXs+QLmnXW2CcXuY+8Mzv/fWEsPGWxqefPtCP5CnV9I=

+ 1
- 1
irc/channel.go View File

@@ -13,7 +13,7 @@ import (
13 13
 
14 14
 	"sync"
15 15
 
16
-	"github.com/goshuirc/irc-go/ircutils"
16
+	"github.com/ergochat/irc-go/ircutils"
17 17
 
18 18
 	"github.com/ergochat/ergo/irc/caps"
19 19
 	"github.com/ergochat/ergo/irc/history"

+ 1
- 1
irc/chanserv.go View File

@@ -13,7 +13,7 @@ import (
13 13
 	"github.com/ergochat/ergo/irc/modes"
14 14
 	"github.com/ergochat/ergo/irc/sno"
15 15
 	"github.com/ergochat/ergo/irc/utils"
16
-	"github.com/goshuirc/irc-go/ircfmt"
16
+	"github.com/ergochat/irc-go/ircfmt"
17 17
 )
18 18
 
19 19
 const chanservHelp = `ChanServ lets you register and manage channels.`

+ 3
- 3
irc/client.go View File

@@ -17,9 +17,9 @@ import (
17 17
 	"time"
18 18
 
19 19
 	ident "github.com/ergochat/go-ident"
20
-	"github.com/goshuirc/irc-go/ircfmt"
21
-	"github.com/goshuirc/irc-go/ircmsg"
22
-	"github.com/goshuirc/irc-go/ircreader"
20
+	"github.com/ergochat/irc-go/ircfmt"
21
+	"github.com/ergochat/irc-go/ircmsg"
22
+	"github.com/ergochat/irc-go/ircreader"
23 23
 
24 24
 	"github.com/ergochat/ergo/irc/caps"
25 25
 	"github.com/ergochat/ergo/irc/connection_limits"

+ 1
- 1
irc/commands.go View File

@@ -6,7 +6,7 @@
6 6
 package irc
7 7
 
8 8
 import (
9
-	"github.com/goshuirc/irc-go/ircmsg"
9
+	"github.com/ergochat/irc-go/ircmsg"
10 10
 )
11 11
 
12 12
 // Command represents a command accepted from a client.

+ 1
- 1
irc/config.go View File

@@ -24,7 +24,7 @@ import (
24 24
 	"time"
25 25
 
26 26
 	"code.cloudfoundry.org/bytefmt"
27
-	"github.com/goshuirc/irc-go/ircfmt"
27
+	"github.com/ergochat/irc-go/ircfmt"
28 28
 	"gopkg.in/yaml.v2"
29 29
 
30 30
 	"github.com/ergochat/ergo/irc/caps"

+ 3
- 3
irc/handlers.go View File

@@ -20,9 +20,9 @@ import (
20 20
 	"strings"
21 21
 	"time"
22 22
 
23
-	"github.com/goshuirc/irc-go/ircfmt"
24
-	"github.com/goshuirc/irc-go/ircmsg"
25
-	"github.com/goshuirc/irc-go/ircutils"
23
+	"github.com/ergochat/irc-go/ircfmt"
24
+	"github.com/ergochat/irc-go/ircmsg"
25
+	"github.com/ergochat/irc-go/ircutils"
26 26
 	"golang.org/x/crypto/bcrypt"
27 27
 
28 28
 	"github.com/ergochat/ergo/irc/caps"

+ 1
- 1
irc/hostserv.go View File

@@ -8,7 +8,7 @@ import (
8 8
 	"fmt"
9 9
 	"regexp"
10 10
 
11
-	"github.com/goshuirc/irc-go/ircfmt"
11
+	"github.com/ergochat/irc-go/ircfmt"
12 12
 
13 13
 	"github.com/ergochat/ergo/irc/utils"
14 14
 )

+ 2
- 2
irc/ircconn.go View File

@@ -8,9 +8,9 @@ import (
8 8
 	"net"
9 9
 	"unicode/utf8"
10 10
 
11
+	"github.com/ergochat/irc-go/ircmsg"
12
+	"github.com/ergochat/irc-go/ircreader"
11 13
 	"github.com/gorilla/websocket"
12
-	"github.com/goshuirc/irc-go/ircmsg"
13
-	"github.com/goshuirc/irc-go/ircreader"
14 14
 
15 15
 	"github.com/ergochat/ergo/irc/utils"
16 16
 )

+ 1
- 1
irc/message_cache.go View File

@@ -6,7 +6,7 @@ package irc
6 6
 import (
7 7
 	"time"
8 8
 
9
-	"github.com/goshuirc/irc-go/ircmsg"
9
+	"github.com/ergochat/irc-go/ircmsg"
10 10
 
11 11
 	"github.com/ergochat/ergo/irc/caps"
12 12
 	"github.com/ergochat/ergo/irc/utils"

+ 1
- 1
irc/monitor.go View File

@@ -6,7 +6,7 @@ package irc
6 6
 import (
7 7
 	"sync"
8 8
 
9
-	"github.com/goshuirc/irc-go/ircmsg"
9
+	"github.com/ergochat/irc-go/ircmsg"
10 10
 )
11 11
 
12 12
 // MonitorManager keeps track of who's monitoring which nicks.

+ 1
- 1
irc/nickname.go View File

@@ -13,7 +13,7 @@ import (
13 13
 	"github.com/ergochat/ergo/irc/modes"
14 14
 	"github.com/ergochat/ergo/irc/sno"
15 15
 	"github.com/ergochat/ergo/irc/utils"
16
-	"github.com/goshuirc/irc-go/ircfmt"
16
+	"github.com/ergochat/irc-go/ircfmt"
17 17
 )
18 18
 
19 19
 var (

+ 1
- 1
irc/nickserv.go View File

@@ -11,7 +11,7 @@ import (
11 11
 	"strings"
12 12
 	"time"
13 13
 
14
-	"github.com/goshuirc/irc-go/ircfmt"
14
+	"github.com/ergochat/irc-go/ircfmt"
15 15
 
16 16
 	"github.com/ergochat/ergo/irc/custime"
17 17
 	"github.com/ergochat/ergo/irc/passwd"

+ 1
- 1
irc/responsebuffer.go View File

@@ -9,7 +9,7 @@ import (
9 9
 
10 10
 	"github.com/ergochat/ergo/irc/caps"
11 11
 	"github.com/ergochat/ergo/irc/utils"
12
-	"github.com/goshuirc/irc-go/ircmsg"
12
+	"github.com/ergochat/irc-go/ircmsg"
13 13
 )
14 14
 
15 15
 const (

+ 1
- 1
irc/server.go View File

@@ -20,7 +20,7 @@ import (
20 20
 	"time"
21 21
 	"unsafe"
22 22
 
23
-	"github.com/goshuirc/irc-go/ircfmt"
23
+	"github.com/ergochat/irc-go/ircfmt"
24 24
 
25 25
 	"github.com/ergochat/ergo/irc/caps"
26 26
 	"github.com/ergochat/ergo/irc/connection_limits"

+ 2
- 2
irc/services.go View File

@@ -12,8 +12,8 @@ import (
12 12
 	"time"
13 13
 
14 14
 	"github.com/ergochat/ergo/irc/utils"
15
-	"github.com/goshuirc/irc-go/ircfmt"
16
-	"github.com/goshuirc/irc-go/ircmsg"
15
+	"github.com/ergochat/irc-go/ircfmt"
16
+	"github.com/ergochat/irc-go/ircmsg"
17 17
 )
18 18
 
19 19
 // defines an IRC service, e.g., NICKSERV

+ 1
- 1
irc/snomanager.go View File

@@ -5,7 +5,7 @@ import (
5 5
 	"sync"
6 6
 
7 7
 	"github.com/ergochat/ergo/irc/sno"
8
-	"github.com/goshuirc/irc-go/ircfmt"
8
+	"github.com/ergochat/irc-go/ircfmt"
9 9
 )
10 10
 
11 11
 // SnoManager keeps track of which clients to send snomasks to.

+ 1
- 1
irc/uban.go View File

@@ -9,7 +9,7 @@ import (
9 9
 	"strings"
10 10
 	"time"
11 11
 
12
-	"github.com/goshuirc/irc-go/ircmsg"
12
+	"github.com/ergochat/irc-go/ircmsg"
13 13
 
14 14
 	"github.com/ergochat/ergo/irc/custime"
15 15
 	"github.com/ergochat/ergo/irc/flatip"

vendor/github.com/goshuirc/irc-go/LICENSE → vendor/github.com/ergochat/irc-go/LICENSE View File


vendor/github.com/goshuirc/irc-go/ircfmt/doc.go → vendor/github.com/ergochat/irc-go/ircfmt/doc.go View File


vendor/github.com/goshuirc/irc-go/ircfmt/ircfmt.go → vendor/github.com/ergochat/irc-go/ircfmt/ircfmt.go View File


vendor/github.com/goshuirc/irc-go/ircmsg/doc.go → vendor/github.com/ergochat/irc-go/ircmsg/doc.go View File


vendor/github.com/goshuirc/irc-go/ircmsg/message.go → vendor/github.com/ergochat/irc-go/ircmsg/message.go View File


vendor/github.com/goshuirc/irc-go/ircmsg/tags.go → vendor/github.com/ergochat/irc-go/ircmsg/tags.go View File


vendor/github.com/goshuirc/irc-go/ircreader/ircreader.go → vendor/github.com/ergochat/irc-go/ircreader/ircreader.go View File


vendor/github.com/goshuirc/irc-go/ircutils/doc.go → vendor/github.com/ergochat/irc-go/ircutils/doc.go View File


vendor/github.com/goshuirc/irc-go/ircutils/hostnames.go → vendor/github.com/ergochat/irc-go/ircutils/hostnames.go View File


+ 62
- 0
vendor/github.com/ergochat/irc-go/ircutils/unicode.go View File

@@ -0,0 +1,62 @@
1
+// Copyright (c) 2021 Shivaram Lingamneni
2
+// Released under the MIT License
3
+
4
+package ircutils
5
+
6
+import (
7
+	"strings"
8
+	"unicode"
9
+	"unicode/utf8"
10
+)
11
+
12
+// truncate a message, taking care not to make valid UTF8 into invalid UTF8
13
+func TruncateUTF8Safe(message string, byteLimit int) (result string) {
14
+	if len(message) <= byteLimit {
15
+		return message
16
+	}
17
+	message = message[:byteLimit]
18
+	for i := 0; i < (utf8.UTFMax - 1); i++ {
19
+		r, n := utf8.DecodeLastRuneInString(message)
20
+		if r == utf8.RuneError && n <= 1 {
21
+			message = message[:len(message)-1]
22
+		} else {
23
+			break
24
+		}
25
+	}
26
+	return message
27
+}
28
+
29
+// Sanitizes human-readable text to make it safe for IRC;
30
+// assumes UTF-8 and uses the replacement character where
31
+// applicable.
32
+func SanitizeText(message string, byteLimit int) (result string) {
33
+	var buf strings.Builder
34
+
35
+	for _, r := range message {
36
+		if r == '\x00' || r == '\r' {
37
+			continue
38
+		} else if r == '\n' {
39
+			if buf.Len()+2 <= byteLimit {
40
+				buf.WriteString("  ")
41
+				continue
42
+			} else {
43
+				break
44
+			}
45
+		} else if unicode.IsSpace(r) {
46
+			if buf.Len()+1 <= byteLimit {
47
+				buf.WriteString(" ")
48
+			} else {
49
+				break
50
+			}
51
+		} else {
52
+			rLen := utf8.RuneLen(r)
53
+			if buf.Len()+rLen <= byteLimit {
54
+				buf.WriteRune(r)
55
+			} else {
56
+				break
57
+			}
58
+		}
59
+	}
60
+
61
+	return buf.String()
62
+}

vendor/github.com/goshuirc/irc-go/ircutils/userhost.go → vendor/github.com/ergochat/irc-go/ircutils/userhost.go View File


+ 0
- 25
vendor/github.com/goshuirc/irc-go/ircutils/unicode.go View File

@@ -1,25 +0,0 @@
1
-// Copyright (c) 2021 Shivaram Lingamneni
2
-// Released under the MIT License
3
-
4
-package ircutils
5
-
6
-import (
7
-	"unicode/utf8"
8
-)
9
-
10
-// truncate a message, taking care not to make valid UTF8 into invalid UTF8
11
-func TruncateUTF8Safe(message string, byteLimit int) (result string) {
12
-	if len(message) <= byteLimit {
13
-		return message
14
-	}
15
-	message = message[:byteLimit]
16
-	for i := 0; i < (utf8.UTFMax - 1); i++ {
17
-		r, n := utf8.DecodeLastRuneInString(message)
18
-		if r == utf8.RuneError && n <= 1 {
19
-			message = message[:len(message)-1]
20
-		} else {
21
-			break
22
-		}
23
-	}
24
-	return message
25
-}

+ 6
- 4
vendor/modules.txt View File

@@ -19,6 +19,12 @@ github.com/ergochat/confusables
19 19
 # github.com/ergochat/go-ident v0.0.0-20200511222032-830550b1d775
20 20
 ## explicit
21 21
 github.com/ergochat/go-ident
22
+# github.com/ergochat/irc-go v0.0.0-20210617222258-256f1601d3ce
23
+## explicit
24
+github.com/ergochat/irc-go/ircfmt
25
+github.com/ergochat/irc-go/ircmsg
26
+github.com/ergochat/irc-go/ircreader
27
+github.com/ergochat/irc-go/ircutils
22 28
 # github.com/go-sql-driver/mysql v1.6.0
23 29
 ## explicit
24 30
 github.com/go-sql-driver/mysql
@@ -29,10 +35,6 @@ github.com/go-sql-driver/mysql
29 35
 github.com/gorilla/websocket
30 36
 # github.com/goshuirc/irc-go v0.0.0-20210318074529-bdc2c2cd2fef
31 37
 ## explicit
32
-github.com/goshuirc/irc-go/ircfmt
33
-github.com/goshuirc/irc-go/ircmsg
34
-github.com/goshuirc/irc-go/ircreader
35
-github.com/goshuirc/irc-go/ircutils
36 38
 # github.com/onsi/ginkgo v1.12.0
37 39
 ## explicit
38 40
 # github.com/onsi/gomega v1.9.0

Loading…
Cancel
Save