Skip to content

Commit 3ec935b

Browse files
committed
Add docs to numbered client handlers
1 parent 636832b commit 3ec935b

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

client_handlers.go

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,24 @@ var clientFilters = map[string]clientFilter{
2020
"CAP": handleCap,
2121
}
2222

23+
// From rfc2812 section 5.1 (Command responses)
24+
//
25+
// 001 RPL_WELCOME
26+
// "Welcome to the Internet Relay Network
27+
// <nick>!<user>@<host>"
2328
func handle001(c *Client, m *Message) {
2429
c.currentNick = m.Params[0]
2530
c.connected = true
2631
}
2732

33+
// From rfc2812 section 5.2 (Error Replies)
34+
//
35+
// 433 ERR_NICKNAMEINUSE
36+
// "<nick> :Nickname is already in use"
37+
//
38+
// - Returned when a NICK message is processed that results
39+
// in an attempt to change to a currently existing
40+
// nickname.
2841
func handle433(c *Client, m *Message) {
2942
// We only want to try and handle nick collisions during the initial
3043
// handshake.
@@ -35,6 +48,17 @@ func handle433(c *Client, m *Message) {
3548
c.Writef("NICK :%s", c.currentNick)
3649
}
3750

51+
// From rfc2812 section 5.2 (Error Replies)
52+
//
53+
// 437 ERR_UNAVAILRESOURCE
54+
// "<nick/channel> :Nick/channel is temporarily unavailable"
55+
//
56+
// - Returned by a server to a user trying to join a channel
57+
// currently blocked by the channel delay mechanism.
58+
//
59+
// - Returned by a server to a user trying to change nickname
60+
// when the desired nickname is blocked by the nick delay
61+
// mechanism.
3862
func handle437(c *Client, m *Message) {
3963
// We only want to try and handle nick collisions during the initial
4064
// handshake.

0 commit comments

Comments
 (0)