mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-25 21:39:25 +01:00
don't overwrite base command
This commit is contained in:
parent
04f881a617
commit
55d3d6e946
@ -55,7 +55,7 @@ func (c *Client) readConn(recv <-chan string) {
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
m.SetBase(c)
|
m.SetClient(c)
|
||||||
c.server.commands <- m
|
c.server.commands <- m
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@ import (
|
|||||||
|
|
||||||
type editableCommand interface {
|
type editableCommand interface {
|
||||||
Command
|
Command
|
||||||
SetBase(*Client)
|
SetClient(*Client)
|
||||||
}
|
}
|
||||||
|
|
||||||
type parseCommandFunc func([]string) (editableCommand, error)
|
type parseCommandFunc func([]string) (editableCommand, error)
|
||||||
@ -42,8 +42,8 @@ func (command *BaseCommand) Client() *Client {
|
|||||||
return command.client
|
return command.client
|
||||||
}
|
}
|
||||||
|
|
||||||
func (command *BaseCommand) SetBase(c *Client) {
|
func (command *BaseCommand) SetClient(c *Client) {
|
||||||
*command = BaseCommand{c}
|
command.client = c
|
||||||
}
|
}
|
||||||
|
|
||||||
func (command *BaseCommand) Source() Identifier {
|
func (command *BaseCommand) Source() Identifier {
|
||||||
|
@ -202,9 +202,8 @@ func (m *JoinCommand) HandleServer(s *Server) {
|
|||||||
c := m.Client()
|
c := m.Client()
|
||||||
|
|
||||||
if m.zero {
|
if m.zero {
|
||||||
cmd := &PartCommand{
|
cmd := &PartCommand{}
|
||||||
BaseCommand: BaseCommand{c},
|
cmd.SetClient(c)
|
||||||
}
|
|
||||||
for channel := range c.channels {
|
for channel := range c.channels {
|
||||||
channel.commands <- cmd
|
channel.commands <- cmd
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user