We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e057364 commit 4626c40Copy full SHA for 4626c40
events.go
@@ -21,6 +21,23 @@ func (c *Client) coreEvents() {
21
c.ReclaimNick()
22
})
23
24
+ // If the nick that PARTs is our configured nick we'll reclaim it.
25
+ c.Handle("QUIT", func(m *Message) {
26
+ if m.Name == c.nick {
27
+ // Acquire lock
28
+ c.infoMu.Lock()
29
+
30
+ // Send NICK command
31
+ c.Nick(c.nick)
32
33
+ // Set current nick to what we just changed it to be
34
+ c.currentNick = c.nick
35
36
+ // Release the lock
37
+ c.infoMu.Unlock()
38
+ }
39
+ })
40
41
// 401 is returned by the server after a WHOIS request if the nick is not in use
42
// Let's verify if the WHOIS request was made from a nick reclaim attempt
43
c.Handle("401", func(m *Message) {
0 commit comments