summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_namesx.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp
index 2603b0ce5..7e9c5fd48 100644
--- a/src/modules/m_namesx.cpp
+++ b/src/modules/m_namesx.cpp
@@ -83,13 +83,16 @@ class ModuleNamesX : public Module
void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line)
{
- if (!cap.ext.get(source) || line.empty())
+ if (!cap.ext.get(source))
return;
- std::string::size_type pos = line.find(':');
- if (pos == std::string::npos || pos < 2)
+ // Channel names can contain ":", and ":" as a 'start-of-token' delimiter is
+ // only ever valid after whitespace, so... find the actual delimiter first!
+ // Thanks to FxChiP for pointing this out.
+ std::string::size_type pos = line.find(" :");
+ if (pos == std::string::npos || pos == 0)
return;
- pos -= 2;
+ pos--;
// Don't do anything if the user has no prefixes
if ((line[pos] == 'H') || (line[pos] == 'G') || (line[pos] == '*'))
return;