summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2015-06-02 20:05:00 +0200
committerAttila Molnar <attilamolnar@hush.com>2015-06-02 20:05:00 +0200
commit61696290a6ba5a2a862a0fa43508767886da3497 (patch)
treed8e74bf34c8b35b8e1baae1d0b864b1f8f60de1a /src/modules
parentffc8101b5fe2fae0de62d94f4a95d5434989dffc (diff)
Fix incomplete conversion to the new whois system noticed by @SaberUK
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/m_hidechans.cpp14
-rw-r--r--src/modules/m_hideoper.cpp11
-rw-r--r--src/modules/m_services_account.cpp8
-rw-r--r--src/modules/m_servprotect.cpp7
4 files changed, 23 insertions, 17 deletions
diff --git a/src/modules/m_hidechans.cpp b/src/modules/m_hidechans.cpp
index cd3ac2c26..431b7b968 100644
--- a/src/modules/m_hidechans.cpp
+++ b/src/modules/m_hidechans.cpp
@@ -28,12 +28,14 @@ class HideChans : public SimpleUserModeHandler
HideChans(Module* Creator) : SimpleUserModeHandler(Creator, "hidechans", 'I') { }
};
-class ModuleHideChans : public Module
+class ModuleHideChans : public Module, public Whois::LineEventListener
{
bool AffectsOpers;
HideChans hm;
public:
- ModuleHideChans() : hm(this)
+ ModuleHideChans()
+ : Whois::LineEventListener(this)
+ , hm(this)
{
}
@@ -47,10 +49,10 @@ class ModuleHideChans : public Module
AffectsOpers = ServerInstance->Config->ConfValue("hidechans")->getBool("affectsopers");
}
- ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) CXX11_OVERRIDE
+ ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE
{
/* always show to self */
- if (user == dest)
+ if (whois.IsSelfWhois())
return MOD_RES_PASSTHRU;
/* don't touch anything except 319 */
@@ -58,7 +60,7 @@ class ModuleHideChans : public Module
return MOD_RES_PASSTHRU;
/* don't touch if -I */
- if (!dest->IsModeSet(hm))
+ if (!whois.GetTarget()->IsModeSet(hm))
return MOD_RES_PASSTHRU;
/* if it affects opers, we don't care if they are opered */
@@ -66,7 +68,7 @@ class ModuleHideChans : public Module
return MOD_RES_DENY;
/* doesn't affect opers, sender is opered */
- if (user->HasPrivPermission("users/auspex"))
+ if (whois.GetSource()->HasPrivPermission("users/auspex"))
return MOD_RES_PASSTHRU;
/* user must be opered, boned. */
diff --git a/src/modules/m_hideoper.cpp b/src/modules/m_hideoper.cpp
index 81b9b888f..9f40d702e 100644
--- a/src/modules/m_hideoper.cpp
+++ b/src/modules/m_hideoper.cpp
@@ -32,12 +32,13 @@ class HideOper : public SimpleUserModeHandler
}
};
-class ModuleHideOper : public Module
+class ModuleHideOper : public Module, public Whois::LineEventListener
{
HideOper hm;
public:
ModuleHideOper()
- : hm(this)
+ : Whois::LineEventListener(this)
+ , hm(this)
{
}
@@ -46,7 +47,7 @@ class ModuleHideOper : public Module
return Version("Provides support for hiding oper status with user mode +H", VF_VENDOR);
}
- ModResult OnWhoisLine(User* user, User* dest, int &numeric, std::string &text) CXX11_OVERRIDE
+ ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE
{
/* Dont display numeric 313 (RPL_WHOISOPER) if they have +H set and the
* person doing the WHOIS is not an oper
@@ -54,10 +55,10 @@ class ModuleHideOper : public Module
if (numeric != 313)
return MOD_RES_PASSTHRU;
- if (!dest->IsModeSet(hm))
+ if (!whois.GetTarget()->IsModeSet(hm))
return MOD_RES_PASSTHRU;
- if (!user->HasPrivPermission("users/auspex"))
+ if (!whois.GetSource()->HasPrivPermission("users/auspex"))
return MOD_RES_DENY;
return MOD_RES_PASSTHRU;
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index 4ad339fcb..a11b05ca3 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -133,7 +133,7 @@ class AccountExtItemImpl : public AccountExtItem
}
};
-class ModuleServicesAccount : public Module
+class ModuleServicesAccount : public Module, public Whois::EventListener
{
AChannel_R m1;
AChannel_M m2;
@@ -143,8 +143,10 @@ class ModuleServicesAccount : public Module
AccountExtItemImpl accountname;
bool checking_ban;
public:
- ModuleServicesAccount() : m1(this), m2(this), m3(this), m4(this), m5(this),
- accountname(this)
+ ModuleServicesAccount()
+ : Whois::EventListener(this)
+ , m1(this), m2(this), m3(this), m4(this), m5(this)
+ , accountname(this)
, checking_ban(false)
{
}
diff --git a/src/modules/m_servprotect.cpp b/src/modules/m_servprotect.cpp
index 2ed37b9e4..0445235dc 100644
--- a/src/modules/m_servprotect.cpp
+++ b/src/modules/m_servprotect.cpp
@@ -42,12 +42,13 @@ class ServProtectMode : public ModeHandler
}
};
-class ModuleServProtectMode : public Module, public Whois::EventListener
+class ModuleServProtectMode : public Module, public Whois::EventListener, public Whois::LineEventListener
{
ServProtectMode bm;
public:
ModuleServProtectMode()
: Whois::EventListener(this)
+ , Whois::LineEventListener(this)
, bm(this)
{
}
@@ -120,9 +121,9 @@ class ModuleServProtectMode : public Module, public Whois::EventListener
return MOD_RES_PASSTHRU;
}
- ModResult OnWhoisLine(User* src, User* dst, int &numeric, std::string &text) CXX11_OVERRIDE
+ ModResult OnWhoisLine(Whois::Context& whois, unsigned int& numeric, std::string& text) CXX11_OVERRIDE
{
- return ((numeric == 319) && dst->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
+ return ((numeric == 319) && whois.GetTarget()->IsModeSet(bm)) ? MOD_RES_DENY : MOD_RES_PASSTHRU;
}
};