summaryrefslogtreecommitdiff
path: root/include/modules/who.h
diff options
context:
space:
mode:
authorlinuxdaemon <linuxdaemon@snoonet.org>2019-03-12 09:48:28 -0500
committerPeter Powell <petpow@saberuk.com>2019-03-12 17:14:53 +0000
commitdfb1e0da7823641ad648f9fbd19b43d2e6b0d7ad (patch)
tree7ef8b5ae60b08765f6e2e04fa43b5a954dbcf87e /include/modules/who.h
parentf87b72b76f9ef198bdbbb01f9ca409501666c6a2 (diff)
Add Who::Request::GetFlagIndex to get field index
Replaces the dirty logic in m_hideoper and m_namesx
Diffstat (limited to 'include/modules/who.h')
-rw-r--r--include/modules/who.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/include/modules/who.h b/include/modules/who.h
index 4fcbe5f91..8fd2dab08 100644
--- a/include/modules/who.h
+++ b/include/modules/who.h
@@ -71,6 +71,17 @@ class Who::Request
/** A user specified label for the WHOX response. */
std::string whox_querytype;
+ /** Get the index in the response parameters for the different data fields
+ *
+ * The fields 'r' (realname) and 'd' (hops) will always be missing in a non-WHOX
+ * query, because WHOX splits them to 2 fields, where old WHO has them as one.
+ *
+ * @param flag The field name to look for
+ * @param out The index will be stored in this value
+ * @return True if the field is available, false otherwise
+ */
+ virtual bool GetFlagIndex(char flag, size_t& out) const = 0;
+
protected:
Request()
: fuzzy_match(false)