mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
Merge pull request #452 from slingamn/deadlock
fix a deadlock in CS AMODE
This commit is contained in:
commit
c5dd87a64d
11
irc/modes.go
11
irc/modes.go
@ -261,6 +261,13 @@ func (channel *Channel) ProcessAccountToUmodeChange(client *Client, change modes
|
|||||||
return l == r || umodeGreaterThan(l, r)
|
return l == r || umodeGreaterThan(l, r)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
changed := false
|
||||||
|
defer func() {
|
||||||
|
if changed {
|
||||||
|
channel.MarkDirty(IncludeLists)
|
||||||
|
}
|
||||||
|
}()
|
||||||
|
|
||||||
account := client.Account()
|
account := client.Account()
|
||||||
isOperChange := client.HasRoleCapabs("chanreg")
|
isOperChange := client.HasRoleCapabs("chanreg")
|
||||||
|
|
||||||
@ -290,14 +297,14 @@ func (channel *Channel) ProcessAccountToUmodeChange(client *Client, change modes
|
|||||||
case modes.Add:
|
case modes.Add:
|
||||||
if targetModeNow != targetModeAfter {
|
if targetModeNow != targetModeAfter {
|
||||||
channel.accountToUMode[change.Arg] = change.Mode
|
channel.accountToUMode[change.Arg] = change.Mode
|
||||||
channel.MarkDirty(IncludeLists)
|
changed = true
|
||||||
return []modes.ModeChange{change}, nil
|
return []modes.ModeChange{change}, nil
|
||||||
}
|
}
|
||||||
return nil, nil
|
return nil, nil
|
||||||
case modes.Remove:
|
case modes.Remove:
|
||||||
if targetModeNow == change.Mode {
|
if targetModeNow == change.Mode {
|
||||||
delete(channel.accountToUMode, change.Arg)
|
delete(channel.accountToUMode, change.Arg)
|
||||||
channel.MarkDirty(IncludeLists)
|
changed = true
|
||||||
return []modes.ModeChange{change}, nil
|
return []modes.ModeChange{change}, nil
|
||||||
}
|
}
|
||||||
return nil, nil
|
return nil, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user