- QString chan = _autoWhoQueue.takeFirst();
- IrcChannel *ircchan = ircChannel(chan);
- if (!ircchan) continue;
- if (networkConfig()->autoWhoNickLimit() > 0 && ircchan->ircUsers().count() >= networkConfig()->autoWhoNickLimit())
+ QString chanOrNick = _autoWhoQueue.takeFirst();
+ // Check if it's a known channel or nick
+ IrcChannel *ircchan = ircChannel(chanOrNick);
+ IrcUser *ircuser = ircUser(chanOrNick);
+ if (ircchan) {
+ // Apply channel limiting rules
+ // If using away-notify, don't impose channel size limits in order to capture away
+ // state of everyone. Auto-who won't run on a timer so network impact is minimal.
+ if (networkConfig()->autoWhoNickLimit() > 0
+ && ircchan->ircUsers().count() >= networkConfig()->autoWhoNickLimit()
+ && !useCapAwayNotify())
+ continue;
+ _autoWhoPending[chanOrNick.toLower()]++;
+ } else if (ircuser) {
+ // Checking a nick, add it to the pending list
+ _autoWhoPending[ircuser->nick().toLower()]++;
+ } else {
+ // Not a channel or a nick, skip it
+ qDebug() << "Skipping who polling of unknown channel or nick" << chanOrNick;