update documentation

This commit is contained in:
Liam Stanley 2017-02-08 01:44:37 -05:00
parent d96e95be7f
commit 775435b722
2 changed files with 9 additions and 1 deletions

View File

@ -37,7 +37,7 @@ type Client struct {
// tries represents the internal reconnect count to the IRC server.
tries int
// stopped determins if Client.Stop() has been called.
// stopped determines if Client.Stop() has been called.
stopped bool
// limiter is a configurable EventLimiter by the end user.
limiter *EventLimiter

View File

@ -258,6 +258,7 @@ func handleNICK(c *Client, e Event) {
c.state.mu.Unlock()
}
// handleQUIT handles users that are quitting from the network.
func handleQUIT(c *Client, e Event) {
c.state.mu.Lock()
c.state.deleteUser(e.Source.Name)
@ -338,6 +339,9 @@ func handleMOTD(c *Client, e Event) {
c.state.mu.Unlock()
}
// handleNAMES handles incoming NAMES queries, of which lists all users in
// a given channel. Optionally also obtains ident/host values, as well as
// permissions for each user, depending on what capabilities are enabled.
func handleNAMES(c *Client, e Event) {
if len(e.Params) < 1 || !IsValidChannel(e.Params[len(e.Params)-1]) {
return
@ -390,6 +394,10 @@ func handleNAMES(c *Client, e Event) {
c.state.mu.Unlock()
}
// updateLastActive is a wrapper for any event which the source author
// should have it's LastActive time updated. This is useful for things like
// a KICK where we know they are active, as they just kicked another user,
// even though they may not be talking.
func updateLastActive(c *Client, e Event) {
c.state.mu.Lock()
// Update the users last active time, if they exist.