mirror of
				https://github.com/fluffle/goirc
				synced 2025-11-04 03:58:03 +00:00 
			
		
		
		
	Properly export Debug and add Network to Conn
This commit is contained in:
		
							parent
							
								
									38b846f9d7
								
							
						
					
					
						commit
						90a5268dfa
					
				
					 1 changed files with 4 additions and 3 deletions
				
			
		| 
						 | 
				
			
			@ -17,6 +17,7 @@ type Conn struct {
 | 
			
		|||
	// Connection Hostname and Nickname
 | 
			
		||||
	Host string
 | 
			
		||||
	Me   *Nick
 | 
			
		||||
	Network string
 | 
			
		||||
 | 
			
		||||
	// I/O stuff to server
 | 
			
		||||
	sock      net.Conn
 | 
			
		||||
| 
						 | 
				
			
			@ -34,7 +35,7 @@ type Conn struct {
 | 
			
		|||
	// Set this to true to disable flood protection and false to re-enable
 | 
			
		||||
	Flood bool
 | 
			
		||||
 | 
			
		||||
	debug bool
 | 
			
		||||
	Debug bool
 | 
			
		||||
 | 
			
		||||
	// Event handler mapping
 | 
			
		||||
	events map[string][]func(*Conn, *Line)
 | 
			
		||||
| 
						 | 
				
			
			@ -167,7 +168,7 @@ func (conn *Conn) send() {
 | 
			
		|||
			break
 | 
			
		||||
		}
 | 
			
		||||
		conn.io.Flush()
 | 
			
		||||
		if conn.debug {
 | 
			
		||||
		if conn.Debug {
 | 
			
		||||
			fmt.Println("-> " + line)
 | 
			
		||||
		}
 | 
			
		||||
	}
 | 
			
		||||
| 
						 | 
				
			
			@ -184,7 +185,7 @@ func (conn *Conn) recv() {
 | 
			
		|||
		}
 | 
			
		||||
		// chop off \r\n
 | 
			
		||||
		s = s[0 : len(s)-2]
 | 
			
		||||
		if conn.debug {
 | 
			
		||||
		if conn.Debug {
 | 
			
		||||
			fmt.Println("<- " + s)
 | 
			
		||||
		}
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue