summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_auditorium.cpp3
-rw-r--r--src/modules/m_hideoper.cpp2
-rw-r--r--src/modules/m_namesx.cpp16
3 files changed, 5 insertions, 16 deletions
diff --git a/src/modules/m_auditorium.cpp b/src/modules/m_auditorium.cpp
index 62aa7ec75..21afcabad 100644
--- a/src/modules/m_auditorium.cpp
+++ b/src/modules/m_auditorium.cpp
@@ -152,9 +152,8 @@ class ModuleAuditorium : public Module
}
}
- void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line) CXX11_OVERRIDE
+ void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, Channel* channel, std::string& line) CXX11_OVERRIDE
{
- Channel* channel = ServerInstance->FindChan(params[0]);
if (!channel)
return;
Membership* memb = channel->GetUser(user);
diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp
index a7a701697..de4a27cae 100644
--- a/src/modules/m_hideoper.cpp
+++ b/src/modules/m_hideoper.cpp
@@ -63,7 +63,7 @@ class ModuleHideOper : public Module
return MOD_RES_PASSTHRU;
}
- void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line) CXX11_OVERRIDE
+ void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, Channel* chan, std::string& line) CXX11_OVERRIDE
{
if (user->IsModeSet(hm) && !source->HasPrivPermission("users/auspex"))
{
diff --git a/src/modules/m_namesx.cpp b/src/modules/m_namesx.cpp
index afbf7a8e2..2e2060032 100644
--- a/src/modules/m_namesx.cpp
+++ b/src/modules/m_namesx.cpp
@@ -71,9 +71,9 @@ class ModuleNamesX : public Module
prefixes = memb->chan->GetAllPrefixChars(memb->user);
}
- void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, std::string& line) CXX11_OVERRIDE
+ void OnSendWhoLine(User* source, const std::vector<std::string>& params, User* user, Channel* chan, std::string& line) CXX11_OVERRIDE
{
- if (!cap.ext.get(source))
+ if ((!chan) || (!cap.ext.get(source)))
return;
// Channel names can contain ":", and ":" as a 'start-of-token' delimiter is
@@ -88,17 +88,7 @@ class ModuleNamesX : public Module
return;
// 352 21DAAAAAB #chan ident localhost insp21.test 21DAAAAAB H@ :0 a
- // a b pos
- std::string::size_type a = 4 + source->nick.length() + 1;
- std::string::size_type b = line.find(' ', a);
- if (b == std::string::npos)
- return;
-
- // Try to find this channel
- std::string channame = line.substr(a, b-a);
- Channel* chan = ServerInstance->FindChan(channame);
- if (!chan)
- return;
+ // pos
// Don't do anything if the user has only one prefix
std::string prefixes = chan->GetAllPrefixChars(user);