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