mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-25 13:29:27 +01:00
fix deadlock on channel state mutex
This commit is contained in:
parent
ccc362be84
commit
6abb291290
@ -612,9 +612,11 @@ func (channel *Channel) Founder() string {
|
||||
|
||||
func (channel *Channel) HighestUserMode(client *Client) (result modes.Mode) {
|
||||
channel.stateMutex.RLock()
|
||||
clientModes := channel.members[client].modes
|
||||
channel.stateMutex.RUnlock()
|
||||
return clientModes.HighestChannelUserMode()
|
||||
defer channel.stateMutex.RUnlock()
|
||||
if clientData, ok := channel.members[client]; ok {
|
||||
return clientData.modes.HighestChannelUserMode()
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (channel *Channel) Settings() (result ChannelSettings) {
|
||||
|
Loading…
Reference in New Issue
Block a user