3
0
mirror of https://github.com/ergochat/ergo.git synced 2024-11-22 03:49:27 +01:00

don't overwrite base command

This commit is contained in:
Jeremy Latt 2014-02-08 23:51:51 -08:00
parent 04f881a617
commit 55d3d6e946
3 changed files with 6 additions and 7 deletions

View File

@ -55,7 +55,7 @@ func (c *Client) readConn(recv <-chan string) {
continue
}
m.SetBase(c)
m.SetClient(c)
c.server.commands <- m
}
}

View File

@ -9,7 +9,7 @@ import (
type editableCommand interface {
Command
SetBase(*Client)
SetClient(*Client)
}
type parseCommandFunc func([]string) (editableCommand, error)
@ -42,8 +42,8 @@ func (command *BaseCommand) Client() *Client {
return command.client
}
func (command *BaseCommand) SetBase(c *Client) {
*command = BaseCommand{c}
func (command *BaseCommand) SetClient(c *Client) {
command.client = c
}
func (command *BaseCommand) Source() Identifier {

View File

@ -202,9 +202,8 @@ func (m *JoinCommand) HandleServer(s *Server) {
c := m.Client()
if m.zero {
cmd := &PartCommand{
BaseCommand: BaseCommand{c},
}
cmd := &PartCommand{}
cmd.SetClient(c)
for channel := range c.channels {
channel.commands <- cmd
}