|
@@ -1623,8 +1623,15 @@ func (channel *Channel) auditoriumFriends(client *Client) (friends []*Client) {
|
1623
|
1623
|
}
|
1624
|
1624
|
|
1625
|
1625
|
// returns whether the client is visible to unprivileged users in the channel
|
1626
|
|
-// (i.e., respecting auditorium mode)
|
1627
|
|
-func (channel *Channel) clientIsVisible(client *Client) bool {
|
|
1626
|
+// (i.e., respecting auditorium mode). note that this assumes that the client
|
|
1627
|
+// is a member; if the client is not, it may return true anyway
|
|
1628
|
+func (channel *Channel) memberIsVisible(client *Client) bool {
|
|
1629
|
+ // fast path, we assume they're a member so if this isn't an auditorium,
|
|
1630
|
+ // they're visible:
|
|
1631
|
+ if !channel.flags.HasMode(modes.Auditorium) {
|
|
1632
|
+ return true
|
|
1633
|
+ }
|
|
1634
|
+
|
1628
|
1635
|
channel.stateMutex.RLock()
|
1629
|
1636
|
defer channel.stateMutex.RUnlock()
|
1630
|
1637
|
|
|
@@ -1632,9 +1639,6 @@ func (channel *Channel) clientIsVisible(client *Client) bool {
|
1632
|
1639
|
if !found {
|
1633
|
1640
|
return false
|
1634
|
1641
|
}
|
1635
|
|
- if !channel.flags.HasMode(modes.Auditorium) {
|
1636
|
|
- return true
|
1637
|
|
- }
|
1638
|
1642
|
return clientData.modes.HighestChannelUserMode() != modes.Mode(0)
|
1639
|
1643
|
}
|
1640
|
1644
|
|