forked from External/ergo
monitor: Fix a crash around the MONITOR command
This commit is contained in:
parent
7ff33b88dd
commit
e95c75f87d
3 changed files with 39 additions and 6 deletions
|
|
@ -61,6 +61,7 @@ type Client struct {
|
|||
isDestroyed bool
|
||||
isQuitting bool
|
||||
monitoring map[string]bool
|
||||
monitoringMutex sync.RWMutex
|
||||
nick string
|
||||
nickCasefolded string
|
||||
nickMaskCasefolded string
|
||||
|
|
@ -523,9 +524,11 @@ func (client *Client) destroy() {
|
|||
}
|
||||
|
||||
// alert monitors
|
||||
client.server.monitoringMutex.RLock()
|
||||
for _, mClient := range client.server.monitoring[client.nickCasefolded] {
|
||||
mClient.Send(nil, client.server.name, RPL_MONOFFLINE, mClient.nick, client.nick)
|
||||
}
|
||||
client.server.monitoringMutex.RUnlock()
|
||||
|
||||
// remove my monitors
|
||||
client.clearMonitorList()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue