convert to extras extension for better expandability

This commit is contained in:
Liam Stanley 2016-12-30 06:10:24 -05:00
parent 8a8407d9cf
commit 0577eabe26
2 changed files with 11 additions and 6 deletions

View File

@ -170,7 +170,7 @@ func handleWHO(c *Client, e Event) {
user.Host = host
user.Ident = ident
user.Name = e.Trailing
user.Extras.Name = e.Trailing
c.state.mu.Unlock()
}

View File

@ -53,18 +53,23 @@ type User struct {
// many networks spoofing/hiding parts of the hostname for privacy
// reasons.
Host string
// Name is the users "realname" or full name. Commonly contains links
// to the IRC client being used, or something of non-importance. May also
// be empty.
Name string
// FirstSeen represents the first time that the user was seen by the
// client for the given channel. Only usable if from state, not in past.
FirstSeen time.Time
// LastActive represents the last time that we saw the user active,
// which could be during nickname change, message, channel join, etc.
// Only usable if from state, not in past.
LastActive time.Time
// Extras are things added on by additional tracking methods, which may
// or may not work on the IRC server in mention.
Extras struct {
// Name is the users "realname" or full name. Commonly contains links
// to the IRC client being used, or something of non-importance. May also
// be empty.
Name string
}
}
// Message returns an event which can be used to send a response to the user