mirror of
https://github.com/ergochat/ergo.git
synced 2025-04-20 06:48:02 +02:00
fix deadlock on channel state mutex
This commit is contained in:
parent
d97e964b35
commit
af2ac175e3
@ -616,9 +616,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…
x
Reference in New Issue
Block a user