mirror of
https://github.com/ergochat/ergo.git
synced 2025-02-16 21:50:39 +01:00
clean up and fix targets for quit message
This commit is contained in:
parent
52dd2521c2
commit
2aa61b0dbe
@ -266,20 +266,22 @@ func (m *UserMsgCommand) HandleServer(s *Server) {
|
|||||||
s.tryRegister(c)
|
s.tryRegister(c)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (m *QuitCommand) HandleServer(s *Server) {
|
func (m *QuitCommand) HandleServer(server *Server) {
|
||||||
c := m.Client()
|
client := m.Client()
|
||||||
|
iclients := client.InterestedClients()
|
||||||
|
iclients.Remove(client)
|
||||||
|
|
||||||
s.clients.Remove(c)
|
server.clients.Remove(client)
|
||||||
for channel := range c.channels {
|
for channel := range client.channels {
|
||||||
channel.members.Remove(c)
|
channel.members.Remove(client)
|
||||||
}
|
}
|
||||||
|
|
||||||
c.Reply(RplError(s, c))
|
client.Reply(RplError(server, client))
|
||||||
c.Destroy()
|
client.Destroy()
|
||||||
|
|
||||||
reply := RplQuit(c, m.message)
|
reply := RplQuit(client, m.message)
|
||||||
for client := range c.InterestedClients() {
|
for iclient := range iclients {
|
||||||
client.Reply(reply)
|
iclient.Reply(reply)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user