mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
only quit registered clients
This commit is contained in:
parent
dcc40bbac1
commit
be01a412d9
@ -113,7 +113,12 @@ func (c *Client) readCommands() {
|
||||
m.SetClient(c)
|
||||
c.server.Command(m)
|
||||
}
|
||||
c.ConnectionClosed()
|
||||
|
||||
if c.registered {
|
||||
c.ConnectionClosed()
|
||||
} else {
|
||||
c.Destroy()
|
||||
}
|
||||
}
|
||||
|
||||
func (client *Client) writeReplies() {
|
||||
|
@ -65,10 +65,6 @@ func (server *Server) receiveCommands() {
|
||||
|
||||
client.Touch()
|
||||
command.HandleServer(server)
|
||||
|
||||
if DEBUG_SERVER {
|
||||
log.Printf("%s → %s %+v processed", command.Client(), server, command)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -311,9 +307,11 @@ func (m *QuitCommand) HandleServer(server *Server) {
|
||||
client.Reply(RplError(server, client))
|
||||
client.Destroy()
|
||||
|
||||
reply := RplQuit(client, m.message)
|
||||
for iclient := range iclients {
|
||||
iclient.Reply(reply)
|
||||
if len(iclients) > 0 {
|
||||
reply := RplQuit(client, m.message)
|
||||
for iclient := range iclients {
|
||||
iclient.Reply(reply)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user