summaryrefslogtreecommitdiff
path: root/src/modules/m_showwhois.cpp
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-05-04 13:24:48 +0200
committerAttila Molnar <attilamolnar@hush.com>2015-05-04 13:24:48 +0200
commit4711113dff7fc33c96f95f417f2813f28c690e01 (patch)
tree7ccecb9e52f6c13c233a3efe312410a1c8e526a0 /src/modules/m_showwhois.cpp
parent8aa03e455e14ea85cdee65527565975ddf558b88 (diff)
parent68bb6a67459298ca08eb18b60794619ddf782c77 (diff)
Merge branch 'master+whoiscontext'
Diffstat (limited to 'src/modules/m_showwhois.cpp')
-rw-r--r--src/modules/m_showwhois.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/modules/m_showwhois.cpp b/src/modules/m_showwhois.cpp
index ba17942cb..3cb85f3fb 100644
--- a/src/modules/m_showwhois.cpp
+++ b/src/modules/m_showwhois.cpp
@@ -69,7 +69,7 @@ class WhoisNoticeCmd : public Command
}
};
-class ModuleShowwhois : public Module
+class ModuleShowwhois : public Module, public Whois::EventListener
{
bool ShowWhoisFromOpers;
SeeWhois sw;
@@ -78,7 +78,9 @@ class ModuleShowwhois : public Module
public:
ModuleShowwhois()
- : sw(this), cmd(this)
+ : Whois::EventListener(this)
+ , sw(this)
+ , cmd(this)
{
}
@@ -95,9 +97,11 @@ class ModuleShowwhois : public Module
return Version("Allows opers to set +W to see when a user uses WHOIS on them",VF_OPTCOMMON|VF_VENDOR);
}
- void OnWhois(User* source, User* dest) CXX11_OVERRIDE
+ void OnWhois(Whois::Context& whois) CXX11_OVERRIDE
{
- if (!dest->IsModeSet(sw) || source == dest)
+ User* const source = whois.GetSource();
+ User* const dest = whois.GetTarget();
+ if (!dest->IsModeSet(sw) || whois.IsSelfWhois())
return;
if (!ShowWhoisFromOpers && source->IsOper())