mirror of
https://github.com/ergochat/ergo.git
synced 2024-12-22 18:52:41 +01:00
stub cap command
This commit is contained in:
parent
28bd5a40ba
commit
fb65203805
@ -18,6 +18,7 @@ var (
|
|||||||
NotEnoughArgsError = errors.New("not enough arguments")
|
NotEnoughArgsError = errors.New("not enough arguments")
|
||||||
ErrParseCommand = errors.New("failed to parse message")
|
ErrParseCommand = errors.New("failed to parse message")
|
||||||
parseCommandFuncs = map[string]parseCommandFunc{
|
parseCommandFuncs = map[string]parseCommandFunc{
|
||||||
|
"CAP": NewCapCommand,
|
||||||
"JOIN": NewJoinCommand,
|
"JOIN": NewJoinCommand,
|
||||||
"MODE": NewModeCommand,
|
"MODE": NewModeCommand,
|
||||||
"NICK": NewNickCommand,
|
"NICK": NewNickCommand,
|
||||||
@ -564,3 +565,19 @@ func NewOperCommand(args []string) (editableCommand, error) {
|
|||||||
password: args[1],
|
password: args[1],
|
||||||
}, nil
|
}, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// TODO
|
||||||
|
type CapCommand struct {
|
||||||
|
BaseCommand
|
||||||
|
args []string
|
||||||
|
}
|
||||||
|
|
||||||
|
func (msg *CapCommand) String() string {
|
||||||
|
return fmt.Sprintf("CAP(args=%s)", msg.args)
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCapCommand(args []string) (editableCommand, error) {
|
||||||
|
return &CapCommand{
|
||||||
|
args: args,
|
||||||
|
}, nil
|
||||||
|
}
|
||||||
|
@ -58,10 +58,14 @@ func (server *Server) receiveCommands(commands <-chan Command) {
|
|||||||
if server.password == "" {
|
if server.password == "" {
|
||||||
client.serverPass = true
|
client.serverPass = true
|
||||||
|
|
||||||
} else if _, ok := command.(*PassCommand); !ok {
|
} else {
|
||||||
client.Reply(ErrPasswdMismatch(server))
|
switch command.(type) {
|
||||||
client.Destroy()
|
case *PassCommand, *CapCommand:
|
||||||
return
|
default:
|
||||||
|
client.Reply(ErrPasswdMismatch(server))
|
||||||
|
client.Destroy()
|
||||||
|
return
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
command.HandleServer(server)
|
command.HandleServer(server)
|
||||||
@ -393,3 +397,7 @@ func (msg *OperCommand) HandleServer(server *Server) {
|
|||||||
client.Reply(RplYoureOper(server))
|
client.Reply(RplYoureOper(server))
|
||||||
client.Reply(RplUModeIs(server, client))
|
client.Reply(RplUModeIs(server, client))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (msg *CapCommand) HandleServer(server *Server) {
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user