Browse Source

upgrade irc-go to latest master

tags/v2.1.0-rc1
Shivaram Lingamneni 4 years ago
parent
commit
3d13c1bc5f
4 changed files with 23 additions and 6 deletions
  1. 1
    1
      go.mod
  2. 3
    0
      go.sum
  3. 18
    4
      vendor/github.com/goshuirc/irc-go/ircmsg/message.go
  4. 1
    1
      vendor/modules.txt

+ 1
- 1
go.mod View File

8
 	github.com/go-ldap/ldap/v3 v3.1.7
8
 	github.com/go-ldap/ldap/v3 v3.1.7
9
 	github.com/go-sql-driver/mysql v1.5.0
9
 	github.com/go-sql-driver/mysql v1.5.0
10
 	github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940 // indirect
10
 	github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940 // indirect
11
-	github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0
11
+	github.com/goshuirc/irc-go v0.0.0-20200311142257-57fd157327ac
12
 	github.com/mattn/go-colorable v0.1.4
12
 	github.com/mattn/go-colorable v0.1.4
13
 	github.com/mattn/go-isatty v0.0.10 // indirect
13
 	github.com/mattn/go-isatty v0.0.10 // indirect
14
 	github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b
14
 	github.com/mgutz/ansi v0.0.0-20170206155736-9520e82c474b

+ 3
- 0
go.sum View File

2
 code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
2
 code.cloudfoundry.org/bytefmt v0.0.0-20190819182555-854d396b647c/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
3
 code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48 h1:/EMHruHCFXR9xClkGV/t0rmHrdhX4+trQUcBqjwc9xE=
3
 code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48 h1:/EMHruHCFXR9xClkGV/t0rmHrdhX4+trQUcBqjwc9xE=
4
 code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
4
 code.cloudfoundry.org/bytefmt v0.0.0-20200131002437-cf55d5288a48/go.mod h1:wN/zk7mhREp/oviagqUXY3EwuHhWyOvAdsn5Y4CzOrc=
5
+github.com/DanielOaks/go-idn v0.0.0-20160120021903-76db0e10dc65/go.mod h1:GYIaL2hleNQvfMUBTes1Zd/lDTyI/p2hv3kYB4jssyU=
5
 github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
6
 github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
6
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7
 github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
7
 github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
8
 github.com/docopt/docopt-go v0.0.0-20180111231733-ee0de3bc6815 h1:bWDMxwH3px2JBh6AyO7hdCn/PkvCZXii8TGj7sbtEbQ=
22
 github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940/go.mod h1:VOmrX6cmj7zwUeexC9HzznUdTIObHqIXUrWNYS+Ik7w=
23
 github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940/go.mod h1:VOmrX6cmj7zwUeexC9HzznUdTIObHqIXUrWNYS+Ik7w=
23
 github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0 h1:unxsR0de0MIS708eZI7lKa6HiP8FS0PhGCWwwEt9+vQ=
24
 github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0 h1:unxsR0de0MIS708eZI7lKa6HiP8FS0PhGCWwwEt9+vQ=
24
 github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0/go.mod h1:rhIkxdehxNqK9iwJXWzQnxlGuuUR4cHu7PN64VryKXk=
25
 github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0/go.mod h1:rhIkxdehxNqK9iwJXWzQnxlGuuUR4cHu7PN64VryKXk=
26
+github.com/goshuirc/irc-go v0.0.0-20200311142257-57fd157327ac h1:0JSojWrghcpK9/wx1RpV9Bv2d+3TbBWtHWubKjU2tao=
27
+github.com/goshuirc/irc-go v0.0.0-20200311142257-57fd157327ac/go.mod h1:BRnLblzpqH2T5ANCODHBZLytz0NZN2KaMJ+di8oh3EM=
25
 github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
28
 github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI=
26
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
29
 github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
27
 github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=
30
 github.com/mattn/go-colorable v0.1.4 h1:snbPLB8fVfU9iwbbo30TPtbLRzwWu6aJS6Xh4eaaviA=

+ 18
- 4
vendor/github.com/goshuirc/irc-go/ircmsg/message.go View File

52
 	Prefix         string
52
 	Prefix         string
53
 	Command        string
53
 	Command        string
54
 	Params         []string
54
 	Params         []string
55
+	forceTrailing  bool
55
 	tags           map[string]string
56
 	tags           map[string]string
56
 	clientOnlyTags map[string]string
57
 	clientOnlyTags map[string]string
57
 }
58
 }
58
 
59
 
60
+// ForceTrailing ensures that when the message is serialized, the final parameter
61
+// will be encoded as a "trailing parameter" (preceded by a colon). This is
62
+// almost never necessary and should not be used except when having to interact
63
+// with broken implementations that don't correctly interpret IRC messages.
64
+func (msg *IrcMessage) ForceTrailing() {
65
+	msg.forceTrailing = true
66
+}
67
+
59
 // GetTag returns whether a tag is present, and if so, what its value is.
68
 // GetTag returns whether a tag is present, and if so, what its value is.
60
 func (msg *IrcMessage) GetTag(tagName string) (present bool, value string) {
69
 func (msg *IrcMessage) GetTag(tagName string) (present bool, value string) {
61
 	if len(tagName) == 0 {
70
 	if len(tagName) == 0 {
321
 	return ircmsg.line(tagLimit, clientOnlyTagDataLimit, serverAddedTagDataLimit, truncateLen)
330
 	return ircmsg.line(tagLimit, clientOnlyTagDataLimit, serverAddedTagDataLimit, truncateLen)
322
 }
331
 }
323
 
332
 
333
+func paramRequiresTrailing(param string) bool {
334
+	return len(param) == 0 || strings.IndexByte(param, ' ') != -1 || param[0] == ':'
335
+}
336
+
324
 // line returns a sendable line created from an IrcMessage.
337
 // line returns a sendable line created from an IrcMessage.
325
 func (ircmsg *IrcMessage) line(tagLimit, clientOnlyTagDataLimit, serverAddedTagDataLimit, truncateLen int) ([]byte, error) {
338
 func (ircmsg *IrcMessage) line(tagLimit, clientOnlyTagDataLimit, serverAddedTagDataLimit, truncateLen int) ([]byte, error) {
326
 	if len(ircmsg.Command) < 1 {
339
 	if len(ircmsg.Command) < 1 {
376
 
389
 
377
 	for i, param := range ircmsg.Params {
390
 	for i, param := range ircmsg.Params {
378
 		buf.WriteByte(' ')
391
 		buf.WriteByte(' ')
379
-		if len(param) < 1 || strings.IndexByte(param, ' ') != -1 || param[0] == ':' {
380
-			if i != len(ircmsg.Params)-1 {
381
-				return nil, ErrorBadParam
382
-			}
392
+		requiresTrailing := paramRequiresTrailing(param)
393
+		lastParam := i == len(ircmsg.Params)-1
394
+		if (requiresTrailing || ircmsg.forceTrailing) && lastParam {
383
 			buf.WriteByte(':')
395
 			buf.WriteByte(':')
396
+		} else if requiresTrailing && !lastParam {
397
+			return nil, ErrorBadParam
384
 		}
398
 		}
385
 		buf.WriteString(param)
399
 		buf.WriteString(param)
386
 	}
400
 	}

+ 1
- 1
vendor/modules.txt View File

15
 # github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940
15
 # github.com/goshuirc/e-nfa v0.0.0-20160917075329-7071788e3940
16
 ## explicit
16
 ## explicit
17
 github.com/goshuirc/e-nfa
17
 github.com/goshuirc/e-nfa
18
-# github.com/goshuirc/irc-go v0.0.0-20190713001546-05ecc95249a0
18
+# github.com/goshuirc/irc-go v0.0.0-20200311142257-57fd157327ac
19
 ## explicit
19
 ## explicit
20
 github.com/goshuirc/irc-go/ircfmt
20
 github.com/goshuirc/irc-go/ircfmt
21
 github.com/goshuirc/irc-go/ircmatch
21
 github.com/goshuirc/irc-go/ircmatch

Loading…
Cancel
Save