#include "inspircd.h"
#include "modules/account.h"
+#include "modules/exemption.h"
/** Channel mode +r - mark a channel as identified
*/
class ModuleServicesAccount : public Module, public Whois::EventListener
{
+ CheckExemption::EventProvider exemptionprov;
AChannel_R m1;
AChannel_M m2;
AUser_R m3;
public:
ModuleServicesAccount()
: Whois::EventListener(this)
+ , exemptionprov(this)
, m1(this), m2(this), m3(this), m4(this), m5(this)
, accountname(this)
, checking_ban(false)
void OnUserPostNick(User* user, const std::string &oldnick) CXX11_OVERRIDE
{
/* On nickchange, if they have +r, remove it */
- if (user->IsModeSet(m5) && assign(user->nick) != oldnick)
+ if ((user->IsModeSet(m5)) && (ServerInstance->FindNickOnly(oldnick) != user))
m5.RemoveMode(user);
}
if (target_type == TYPE_CHANNEL)
{
Channel* c = (Channel*)dest;
- ModResult res = ServerInstance->OnCheckExemption(user,c,"regmoderated");
+ ModResult res;
+ FIRST_MOD_RESULT_CUSTOM(exemptionprov, CheckExemption::EventListener, OnCheckExemption, res, (user, c, "regmoderated"));
if (c->IsModeSet(m2) && !is_registered && res != MOD_RES_ALLOW)
{