mirror of
https://github.com/ergochat/ergo.git
synced 2024-11-10 22:19:31 +01:00
client: Unlock channel mutex earlier
This commit is contained in:
parent
e34475d536
commit
aad1070633
@ -332,7 +332,6 @@ func (client *Client) Friends(Capabilities ...Capability) ClientSet {
|
|||||||
|
|
||||||
for channel := range client.channels {
|
for channel := range client.channels {
|
||||||
channel.membersMutex.RLock()
|
channel.membersMutex.RLock()
|
||||||
defer channel.membersMutex.RUnlock()
|
|
||||||
for member := range channel.members {
|
for member := range channel.members {
|
||||||
// make sure they have all the required caps
|
// make sure they have all the required caps
|
||||||
for _, Cap := range Capabilities {
|
for _, Cap := range Capabilities {
|
||||||
@ -342,6 +341,7 @@ func (client *Client) Friends(Capabilities ...Capability) ClientSet {
|
|||||||
}
|
}
|
||||||
friends.Add(member)
|
friends.Add(member)
|
||||||
}
|
}
|
||||||
|
channel.membersMutex.RUnlock()
|
||||||
}
|
}
|
||||||
return friends
|
return friends
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user