mirror of
https://github.com/ergochat/ergo.git
synced 2025-01-03 08:32:43 +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)
|
m.SetClient(c)
|
||||||
c.server.Command(m)
|
c.server.Command(m)
|
||||||
}
|
}
|
||||||
c.ConnectionClosed()
|
|
||||||
|
if c.registered {
|
||||||
|
c.ConnectionClosed()
|
||||||
|
} else {
|
||||||
|
c.Destroy()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func (client *Client) writeReplies() {
|
func (client *Client) writeReplies() {
|
||||||
|
@ -65,10 +65,6 @@ func (server *Server) receiveCommands() {
|
|||||||
|
|
||||||
client.Touch()
|
client.Touch()
|
||||||
command.HandleServer(server)
|
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.Reply(RplError(server, client))
|
||||||
client.Destroy()
|
client.Destroy()
|
||||||
|
|
||||||
reply := RplQuit(client, m.message)
|
if len(iclients) > 0 {
|
||||||
for iclient := range iclients {
|
reply := RplQuit(client, m.message)
|
||||||
iclient.Reply(reply)
|
for iclient := range iclients {
|
||||||
|
iclient.Reply(reply)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user