1
0
Fork 0
forked from External/ergo

Make channel and privmsg replies more useful for logged-out users.

This commit is contained in:
Jeremy Latt 2013-05-12 11:37:35 -07:00
parent fd814bf969
commit f24bb5ee7d
3 changed files with 19 additions and 13 deletions

View file

@ -9,6 +9,7 @@ import (
type Command interface {
Client() *Client
User() *User
Source() Identifier
HandleServer(*Server)
}
@ -44,6 +45,13 @@ func (command *BaseCommand) Client() *Client {
return command.client
}
func (command *BaseCommand) User() *User {
if command.Client() == nil {
return nil
}
return command.User()
}
func (command *BaseCommand) SetClient(c *Client) {
command.client = c
}