summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSadie Powell <sadie@witchery.services>2021-03-02 19:55:54 +0000
committerSadie Powell <sadie@witchery.services>2021-03-02 19:55:54 +0000
commit85d94c6f49aa83abbb31292c4a7c5c5246d51198 (patch)
tree93a69c99d9734530f15a12df22438ec15549b5c6
parente0dff7cf01daa6067f1896e80b5bf9d42073efa5 (diff)
Fix fuzzy matching in core_who.
Previously this code would consider requests with fields but no flags as fuzzy. This is incorrect as users can make requests like: WHO Sadie %n Reported by @ilbelkyr.
-rw-r--r--src/coremods/core_who.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/coremods/core_who.cpp b/src/coremods/core_who.cpp
index fdf8919a2..135504b84 100644
--- a/src/coremods/core_who.cpp
+++ b/src/coremods/core_who.cpp
@@ -77,9 +77,6 @@ struct WhoData : public Who::Request
if (matchtext == "0")
matchtext = "*";
- // Fuzzy matches are when the source has not specified a specific user.
- fuzzy_match = (parameters.size() > 1) || (matchtext.find_first_of("*?.") != std::string::npos);
-
// If flags have been specified by the source.
if (parameters.size() > 1)
{
@@ -108,6 +105,9 @@ struct WhoData : public Who::Request
current_bitset->set(chr);
}
}
+
+ // Fuzzy matches are when the source has not specified a specific user.
+ fuzzy_match = flags.any() || (matchtext.find_first_of("*?.") != std::string::npos);
}
};