summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
b33ea3a)
Clean up AutoWho variable names using the "name" convention from
RFC 1459.
Clean up AutoWho comments likewise, referring to "name" instead of
"channel" where appropriate.
See https://tools.ietf.org/html/rfc1459#section-4.5.1
-bool CoreNetwork::setAutoWhoDone(const QString &channel)
+bool CoreNetwork::setAutoWhoDone(const QString &name)
- QString chan = channel.toLower();
- if (_autoWhoPending.value(chan, 0) <= 0)
+ QString chanOrNick = name.toLower();
+ if (_autoWhoPending.value(chanOrNick, 0) <= 0)
- if (--_autoWhoPending[chan] <= 0)
- _autoWhoPending.remove(chan);
+ if (--_autoWhoPending[chanOrNick] <= 0)
+ _autoWhoPending.remove(chanOrNick);
_autoWhoQueue = channels();
}
_autoWhoQueue = channels();
}
-void CoreNetwork::queueAutoWhoOneshot(const QString &channelOrNick)
+void CoreNetwork::queueAutoWhoOneshot(const QString &name)
{
// Prepend so these new channels/nicks are the first to be checked
// Don't allow duplicates
{
// Prepend so these new channels/nicks are the first to be checked
// Don't allow duplicates
- if (!_autoWhoQueue.contains(channelOrNick.toLower())) {
- _autoWhoQueue.prepend(channelOrNick.toLower());
+ if (!_autoWhoQueue.contains(name.toLower())) {
+ _autoWhoQueue.prepend(name.toLower());
}
if (capEnabled(IrcCap::AWAY_NOTIFY)) {
// When away-notify is active, the timer's stopped. Start a new cycle to who this channel.
}
if (capEnabled(IrcCap::AWAY_NOTIFY)) {
// When away-notify is active, the timer's stopped. Start a new cycle to who this channel.
-void CoreNetwork::cancelAutoWhoOneshot(const QString &channelOrNick)
+void CoreNetwork::cancelAutoWhoOneshot(const QString &name)
{
// Remove channel/nick from queue if it exists
{
// Remove channel/nick from queue if it exists
- _autoWhoQueue.removeAll(channelOrNick);
+ _autoWhoQueue.removeAll(name);
// The AutoWho timer will detect if the queue is empty and automatically stop, no need to
// manually control it.
// The AutoWho timer will detect if the queue is empty and automatically stop, no need to
// manually control it.
inline QByteArray readChannelCipherKey(const QString &channel) const { return _cipherKeys.value(channel.toLower()); }
inline void storeChannelCipherKey(const QString &channel, const QByteArray &key) { _cipherKeys[channel.toLower()] = key; }
inline QByteArray readChannelCipherKey(const QString &channel) const { return _cipherKeys.value(channel.toLower()); }
inline void storeChannelCipherKey(const QString &channel, const QByteArray &key) { _cipherKeys[channel.toLower()] = key; }
- inline bool isAutoWhoInProgress(const QString &channel) const { return _autoWhoPending.value(channel.toLower(), 0); }
+ /**
+ * Checks if the given target has an automatic WHO in progress
+ *
+ * @param name Channel or nickname
+ * @return True if an automatic WHO is in progress, otherwise false
+ */
+ inline bool isAutoWhoInProgress(const QString &name) const
+ {
+ return _autoWhoPending.value(name.toLower(), 0);
+ }
inline UserId userId() const { return _coreSession->user(); }
inline UserId userId() const { return _coreSession->user(); }
* When 'away-notify' is enabled, this will trigger an immediate AutoWho since regular
* who-cycles are disabled as per IRCv3 specifications.
*
* When 'away-notify' is enabled, this will trigger an immediate AutoWho since regular
* who-cycles are disabled as per IRCv3 specifications.
*
- * @param[in] channelOrNick Channel or nickname to WHO
+ * @param[in] name Channel or nickname
- void queueAutoWhoOneshot(const QString &channelOrNick);
+ void queueAutoWhoOneshot(const QString &name);
- * Removes the given channel/nick from AutoWho queue for when it stops existing
+ * Removes the given channel/nick from AutoWho queue
- * If not already in queue, nothing happens. This should only be used for nicknames and
- * channels that have suddenly stopped existing (e.g. nick joins then quits).
+ * This can avoid needlessly WHO'ng nicknames and channels that are no longer of interest, e.g.
+ * if parting a channel right after joining or if a nick joins then quits.
*
* For when a periodic channel AutoWho finishes, see CoreNetwork::setAutoWhoDone()
*
*
* For when a periodic channel AutoWho finishes, see CoreNetwork::setAutoWhoDone()
*
- * @param channelOrNick Channel or nickname to WHO
+ * @param name Channel or nickname
- void cancelAutoWhoOneshot(const QString &channelOrNick);
+ void cancelAutoWhoOneshot(const QString &name);
- bool setAutoWhoDone(const QString &channel);
+ /**
+ * Checks if the given target has an automatic WHO in progress, and sets it as done if so
+ *
+ * @param name Channel or nickname
+ * @return True if an automatic WHO is in progress (and should be silenced), otherwise false
+ */
+ bool setAutoWhoDone(const QString &name);
void updateIssuedModes(const QString &requestedModes);
void updatePersistentModes(QString addModes, QString removeModes);
void updateIssuedModes(const QString &requestedModes);
void updatePersistentModes(QString addModes, QString removeModes);