mirror of
				https://github.com/fluffle/goirc
				synced 2025-11-03 19:48:04 +00:00 
			
		
		
		
	Merge f0c8334ff6 into 7923e28091
				
					
				
			This commit is contained in:
		
						commit
						77118501ce
					
				
					 2 changed files with 10 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -6,6 +6,7 @@ package client
 | 
			
		|||
import (
 | 
			
		||||
	"github.com/fluffle/goevent/event"
 | 
			
		||||
	"strings"
 | 
			
		||||
	"time"
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// Consts for unnamed events.
 | 
			
		||||
| 
						 | 
				
			
			@ -99,6 +100,13 @@ func (conn *Conn) h_433(line *Line) {
 | 
			
		|||
	// Args[1] is the new nick we were attempting to acquire
 | 
			
		||||
	neu := conn.NewNick(line.Args[1])
 | 
			
		||||
	conn.Nick(neu)
 | 
			
		||||
	// arm a timer to try get back our nick.
 | 
			
		||||
	go func(old string) {
 | 
			
		||||
		retry := 1 * time.Minute
 | 
			
		||||
		for time.Sleep(retry); conn.Me.Nick != old; time.Sleep(retry) {
 | 
			
		||||
			conn.Nick(old)
 | 
			
		||||
		}
 | 
			
		||||
	}(line.Args[1])
 | 
			
		||||
	// if this is happening before we're properly connected (i.e. the nick
 | 
			
		||||
	// we sent in the initial NICK command is in use) we will not receive
 | 
			
		||||
	// a NICK message to confirm our change of nick, so ReNick here...
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -136,11 +136,11 @@ func (m *mockNetConn) Close() error {
 | 
			
		|||
}
 | 
			
		||||
 | 
			
		||||
func (m *mockNetConn) LocalAddr() net.Addr {
 | 
			
		||||
	return &net.IPAddr{net.IPv4(127, 0, 0, 1)}
 | 
			
		||||
	return &net.IPAddr{IP: net.IPv4(127, 0, 0, 1)}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *mockNetConn) RemoteAddr() net.Addr {
 | 
			
		||||
	return &net.IPAddr{net.IPv4(127, 0, 0, 1)}
 | 
			
		||||
	return &net.IPAddr{IP: net.IPv4(127, 0, 0, 1)}
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
func (m *mockNetConn) SetDeadline(t time.Time) error {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue