+ bool CanSeeChan(User* user, Channel* chan)
+ {
+ // A user can always see the channel modes if they are:
+ // (1) In the channel.
+ // (2) An oper with the channels/auspex privilege.
+ if (chan->HasUser(user) || user->HasPrivPermission("channels/auspex"))
+ return true;
+
+ // Otherwise, they can only see the modes when the channel is not +p or +s.
+ return !chan->IsModeSet(secretmode) && !chan->IsModeSet(privatemode);
+ }
+