mirror of
				https://github.com/ergochat/ergo.git
				synced 2025-10-31 05:47:22 +01:00 
			
		
		
		
	bump irc-go to latest
This commit is contained in:
		
							parent
							
								
									2681097516
								
							
						
					
					
						commit
						a6f3e2c748
					
				
							
								
								
									
										2
									
								
								go.mod
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.mod
									
									
									
									
									
								
							| @ -10,7 +10,7 @@ require ( | ||||
| 	github.com/go-sql-driver/mysql v1.5.0 | ||||
| 	github.com/go-test/deep v1.0.6 // indirect | ||||
| 	github.com/gorilla/websocket v1.4.2 | ||||
| 	github.com/goshuirc/irc-go v0.0.0-20210222010959-6e139f6c42e9 | ||||
| 	github.com/goshuirc/irc-go v0.0.0-20210223005429-8d38e43fc6ed | ||||
| 	github.com/onsi/ginkgo v1.12.0 // indirect | ||||
| 	github.com/onsi/gomega v1.9.0 // indirect | ||||
| 	github.com/oragono/confusables v0.0.0-20201108231250-4ab98ab61fb1 | ||||
|  | ||||
							
								
								
									
										2
									
								
								go.sum
									
									
									
									
									
								
							
							
						
						
									
										2
									
								
								go.sum
									
									
									
									
									
								
							| @ -36,6 +36,8 @@ github.com/goshuirc/irc-go v0.0.0-20210215162435-14cd697c0c8c h1:pOTMO5A1nszuxNy | ||||
| github.com/goshuirc/irc-go v0.0.0-20210215162435-14cd697c0c8c/go.mod h1:q/JhvvKLmif3y9q8MDQM+gRCnjEKnu5ClF298TTXJug= | ||||
| github.com/goshuirc/irc-go v0.0.0-20210222010959-6e139f6c42e9 h1:A1mSQ0N5Kx8i+aeqeQ0VLbq3swuH0R/JoQcFcR9yUWA= | ||||
| github.com/goshuirc/irc-go v0.0.0-20210222010959-6e139f6c42e9/go.mod h1:q/JhvvKLmif3y9q8MDQM+gRCnjEKnu5ClF298TTXJug= | ||||
| github.com/goshuirc/irc-go v0.0.0-20210223005429-8d38e43fc6ed h1:cwwqHrmLafgEucSMC9PmFOA671dc4bEZ5z6FsamnBY8= | ||||
| github.com/goshuirc/irc-go v0.0.0-20210223005429-8d38e43fc6ed/go.mod h1:q/JhvvKLmif3y9q8MDQM+gRCnjEKnu5ClF298TTXJug= | ||||
| github.com/hpcloud/tail v1.0.0 h1:nfCOvKYfkgYP8hkirhJocXT2+zOD8yUNjXaWfTlyFKI= | ||||
| github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU= | ||||
| github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE= | ||||
|  | ||||
							
								
								
									
										34
									
								
								vendor/github.com/goshuirc/irc-go/ircmsg/message.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										34
									
								
								vendor/github.com/goshuirc/irc-go/ircmsg/message.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -9,7 +9,6 @@ import ( | ||||
| 	"bytes" | ||||
| 	"errors" | ||||
| 	"strings" | ||||
| 	"unicode/utf8" | ||||
| ) | ||||
| 
 | ||||
| const ( | ||||
| @ -41,8 +40,8 @@ var ( | ||||
| 	// (the name references 417 ERR_INPUTTOOLONG; we reserve the right to return it | ||||
| 	// for messages that exceed the non-tag length limit) | ||||
| 	ErrorLineTooLong = errors.New("Line could not be parsed because a specified length limit was exceeded") | ||||
| 	// ErrorInvalidTagContent indicates that a tag value was invalid | ||||
| 	ErrorInvalidTagContent = errors.New("Line could not be parsed because it contained an invalid tag value") | ||||
| 	// ErrorInvalidTagContent indicates that a tag name or value was invalid | ||||
| 	ErrorInvalidTagContent = errors.New("Line could not be processed because it contained an invalid tag name or value") | ||||
| 
 | ||||
| 	ErrorCommandMissing = errors.New("IRC messages MUST have a command") | ||||
| 	ErrorBadParam       = errors.New("Cannot have an empty param, a param with spaces, or a param that starts with ':' before the last parameter") | ||||
| @ -168,19 +167,12 @@ func trimInitialSpaces(str string) string { | ||||
| } | ||||
| 
 | ||||
| func parseLine(line string, maxTagDataLength int, truncateLen int) (ircmsg IRCMessage, err error) { | ||||
| 	if strings.IndexByte(line, '\x00') != -1 { | ||||
| 		err = ErrorLineContainsBadChar | ||||
| 		return | ||||
| 	} | ||||
| 
 | ||||
| 	// trim to the first appearance of either '\r' or '\n': | ||||
| 	lineEnd := strings.IndexByte(line, '\r') | ||||
| 	newlineIndex := strings.IndexByte(line, '\n') | ||||
| 	if newlineIndex != -1 && (lineEnd == -1 || newlineIndex < lineEnd) { | ||||
| 		lineEnd = newlineIndex | ||||
| 	} | ||||
| 	if lineEnd != -1 { | ||||
| 		line = line[:lineEnd] | ||||
| 	// remove either \n or \r\n from the end of the line: | ||||
| 	line = strings.TrimSuffix(line, "\n") | ||||
| 	line = strings.TrimSuffix(line, "\r") | ||||
| 	// now validate for the 3 forbidden bytes: | ||||
| 	if strings.IndexByte(line, '\x00') != -1 || strings.IndexByte(line, '\n') != -1 || strings.IndexByte(line, '\r') != -1 { | ||||
| 		return ircmsg, ErrorLineContainsBadChar | ||||
| 	} | ||||
| 
 | ||||
| 	if len(line) < 1 { | ||||
| @ -285,8 +277,7 @@ func (ircmsg *IRCMessage) parseTags(tags string) (err error) { | ||||
| 		// "Implementations [...] MUST NOT perform any validation that would | ||||
| 		//  reject the message if an invalid tag key name is used." | ||||
| 		if validateTagName(tagName) { | ||||
| 			// "Tag values MUST be encoded as UTF8." | ||||
| 			if !utf8.ValidString(tagValue) { | ||||
| 			if !validateTagValue(tagValue) { | ||||
| 				return ErrorInvalidTagContent | ||||
| 			} | ||||
| 			ircmsg.SetTag(tagName, UnescapeTagValue(tagValue)) | ||||
| @ -356,10 +347,14 @@ func (ircmsg *IRCMessage) line(tagLimit, clientOnlyTagDataLimit, serverAddedTagD | ||||
| 	// write the tags, computing the budgets for client-only tags and regular tags | ||||
| 	var lenRegularTags, lenClientOnlyTags, lenTags int | ||||
| 	if 0 < len(ircmsg.tags) || 0 < len(ircmsg.clientOnlyTags) { | ||||
| 		var tagError error | ||||
| 		buf.WriteByte('@') | ||||
| 		firstTag := true | ||||
| 		writeTags := func(tags map[string]string) { | ||||
| 			for tag, val := range tags { | ||||
| 				if !(validateTagName(tag) && validateTagValue(val)) { | ||||
| 					tagError = ErrorInvalidTagContent | ||||
| 				} | ||||
| 				if !firstTag { | ||||
| 					buf.WriteByte(';') // delimiter | ||||
| 				} | ||||
| @ -380,6 +375,9 @@ func (ircmsg *IRCMessage) line(tagLimit, clientOnlyTagDataLimit, serverAddedTagD | ||||
| 			lenClientOnlyTags -= 1 | ||||
| 		} | ||||
| 		buf.WriteByte(' ') | ||||
| 		if tagError != nil { | ||||
| 			return nil, tagError | ||||
| 		} | ||||
| 	} | ||||
| 	lenTags = buf.Len() | ||||
| 
 | ||||
|  | ||||
							
								
								
									
										11
									
								
								vendor/github.com/goshuirc/irc-go/ircmsg/tags.go
									
									
									
										generated
									
									
										vendored
									
									
								
							
							
						
						
									
										11
									
								
								vendor/github.com/goshuirc/irc-go/ircmsg/tags.go
									
									
									
										generated
									
									
										vendored
									
									
								
							| @ -3,7 +3,10 @@ | ||||
| 
 | ||||
| package ircmsg | ||||
| 
 | ||||
| import "strings" | ||||
| import ( | ||||
| 	"strings" | ||||
| 	"unicode/utf8" | ||||
| ) | ||||
| 
 | ||||
| var ( | ||||
| 	// valtoescape replaces real characters with message tag escapes. | ||||
| @ -73,6 +76,7 @@ func UnescapeTagValue(inString string) string { | ||||
| 	return buf.String() | ||||
| } | ||||
| 
 | ||||
| // https://ircv3.net/specs/extensions/message-tags.html#rules-for-naming-message-tags | ||||
| func validateTagName(name string) bool { | ||||
| 	if len(name) == 0 { | ||||
| 		return false | ||||
| @ -92,3 +96,8 @@ func validateTagName(name string) bool { | ||||
| 	} | ||||
| 	return true | ||||
| } | ||||
| 
 | ||||
| // "Tag values MUST be encoded as UTF8." | ||||
| func validateTagValue(value string) bool { | ||||
| 	return utf8.ValidString(value) | ||||
| } | ||||
|  | ||||
							
								
								
									
										2
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										2
									
								
								vendor/modules.txt
									
									
									
									
										vendored
									
									
								
							| @ -21,7 +21,7 @@ github.com/go-sql-driver/mysql | ||||
| # github.com/gorilla/websocket v1.4.2 | ||||
| ## explicit | ||||
| github.com/gorilla/websocket | ||||
| # github.com/goshuirc/irc-go v0.0.0-20210222010959-6e139f6c42e9 | ||||
| # github.com/goshuirc/irc-go v0.0.0-20210223005429-8d38e43fc6ed | ||||
| ## explicit | ||||
| github.com/goshuirc/irc-go/ircfmt | ||||
| github.com/goshuirc/irc-go/ircmsg | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Shivaram Lingamneni
						Shivaram Lingamneni