diff options
author | Attila Molnar <attilamolnar@hush.com> | 2014-01-25 12:40:21 +0100 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2014-01-25 12:40:21 +0100 |
commit | 1db0e984be491125d8f954aa22f17cad1d4c453f (patch) | |
tree | e60fea152f40c36b975472725f40eb89c76cf7fd /src/modules | |
parent | f3f8eae2cd68d8ce2c57f5df58db5833fb659cf5 (diff) |
Add Channel* parameter to OnSendWhoLine
Diffstat (limited to 'src/modules')
-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 |
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); |