|
@@ -266,20 +266,22 @@ func (m *UserMsgCommand) HandleServer(s *Server) {
|
266
|
266
|
s.tryRegister(c)
|
267
|
267
|
}
|
268
|
268
|
|
269
|
|
-func (m *QuitCommand) HandleServer(s *Server) {
|
270
|
|
- c := m.Client()
|
|
269
|
+func (m *QuitCommand) HandleServer(server *Server) {
|
|
270
|
+ client := m.Client()
|
|
271
|
+ iclients := client.InterestedClients()
|
|
272
|
+ iclients.Remove(client)
|
271
|
273
|
|
272
|
|
- s.clients.Remove(c)
|
273
|
|
- for channel := range c.channels {
|
274
|
|
- channel.members.Remove(c)
|
|
274
|
+ server.clients.Remove(client)
|
|
275
|
+ for channel := range client.channels {
|
|
276
|
+ channel.members.Remove(client)
|
275
|
277
|
}
|
276
|
278
|
|
277
|
|
- c.Reply(RplError(s, c))
|
278
|
|
- c.Destroy()
|
|
279
|
+ client.Reply(RplError(server, client))
|
|
280
|
+ client.Destroy()
|
279
|
281
|
|
280
|
|
- reply := RplQuit(c, m.message)
|
281
|
|
- for client := range c.InterestedClients() {
|
282
|
|
- client.Reply(reply)
|
|
282
|
+ reply := RplQuit(client, m.message)
|
|
283
|
+ for iclient := range iclients {
|
|
284
|
+ iclient.Reply(reply)
|
283
|
285
|
}
|
284
|
286
|
}
|
285
|
287
|
|