1
0
Fork 0
forked from External/ergo

away modes

This commit is contained in:
Jeremy Latt 2014-02-11 15:44:58 -08:00
parent cdae59ecf5
commit 08d9d5ab79
6 changed files with 79 additions and 24 deletions

View file

@ -18,6 +18,7 @@ var (
NotEnoughArgsError = errors.New("not enough arguments")
ErrParseCommand = errors.New("failed to parse message")
parseCommandFuncs = map[string]parseCommandFunc{
"AWAY": NewAwayCommand,
"CAP": NewCapCommand,
"JOIN": NewJoinCommand,
"MODE": NewModeCommand,
@ -609,3 +610,24 @@ func NewProxyCommand(args []string) (editableCommand, error) {
destPort: args[4],
}, nil
}
type AwayCommand struct {
BaseCommand
text string
away bool
}
func (msg *AwayCommand) String() string {
return fmt.Sprintf("AWAY(%s)", msg.text)
}
func NewAwayCommand(args []string) (editableCommand, error) {
cmd := &AwayCommand{}
if len(args) > 0 {
cmd.text = args[0]
cmd.away = true
}
return cmd, nil
}