diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/commands/cmd_who.cpp | 2 | ||||
-rw-r--r-- | src/modules.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_auditorium.cpp | 3 | ||||
-rw-r--r-- | src/modules/m_hideoper.cpp | 2 | ||||
-rw-r--r-- | src/modules/m_namesx.cpp | 16 |
5 files changed, 7 insertions, 18 deletions
diff --git a/src/commands/cmd_who.cpp b/src/commands/cmd_who.cpp index 37a04af83..afc27fb9b 100644 --- a/src/commands/cmd_who.cpp +++ b/src/commands/cmd_who.cpp @@ -228,7 +228,7 @@ void CommandWho::SendWhoLine(User* user, const std::vector<std::string>& parms, wholine.append(" :0 " + u->fullname); - FOREACH_MOD(OnSendWhoLine, (user, parms, u, wholine)); + FOREACH_MOD(OnSendWhoLine, (user, parms, u, ch, wholine)); if (!wholine.empty()) whoresults.push_back(wholine); diff --git a/src/modules.cpp b/src/modules.cpp index 22047ce81..245ad5345 100644 --- a/src/modules.cpp +++ b/src/modules.cpp @@ -155,7 +155,7 @@ void Module::OnRunTestSuite() { DetachEvent(I_OnRunTestSuite); } void Module::OnNamesListItem(User*, Membership*, std::string&, std::string&) { DetachEvent(I_OnNamesListItem); } ModResult Module::OnNumeric(User*, unsigned int, const std::string&) { DetachEvent(I_OnNumeric); return MOD_RES_PASSTHRU; } ModResult Module::OnAcceptConnection(int, ListenSocket*, irc::sockets::sockaddrs*, irc::sockets::sockaddrs*) { DetachEvent(I_OnAcceptConnection); return MOD_RES_PASSTHRU; } -void Module::OnSendWhoLine(User*, const std::vector<std::string>&, User*, std::string&) { DetachEvent(I_OnSendWhoLine); } +void Module::OnSendWhoLine(User*, const std::vector<std::string>&, User*, Channel*, std::string&) { DetachEvent(I_OnSendWhoLine); } void Module::OnSetUserIP(LocalUser*) { DetachEvent(I_OnSetUserIP); } ServiceProvider::ServiceProvider(Module* Creator, const std::string& Name, ServiceType Type) 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); |