- bool display = (match(chan->name, ld->glob) || (!chan->topic.empty() && match(chan->topic, ld->glob)));
- if ((users) && (display))
+ bool display = (InspIRCd::Match(chan->name, ld->glob) || (!chan->topic.empty() && InspIRCd::Match(chan->topic, ld->glob)));
+
+ if (!users || !display)
+ {
+ ld->list_position++;
+ continue;
+ }
+
+ /* +s, not in chan / not got channels/auspex */
+ if (chan->IsModeSet('s') && !is_special)
+ {
+ ld->list_position++;
+ continue;
+ }
+
+ if (chan->IsModeSet('p') && !is_special)