From 775435b722c4e90352f971561f8ec47df5209ae4 Mon Sep 17 00:00:00 2001 From: Liam Stanley Date: Wed, 8 Feb 2017 01:44:37 -0500 Subject: [PATCH] update documentation --- client.go | 2 +- handlers.go | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/client.go b/client.go index 784b14d..b5a3a72 100644 --- a/client.go +++ b/client.go @@ -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 diff --git a/handlers.go b/handlers.go index eab6b17..c8225d9 100644 --- a/handlers.go +++ b/handlers.go @@ -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.