summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/modules/m_allowinvite.cpp11
-rw-r--r--src/modules/m_blockcaps.cpp13
-rw-r--r--src/modules/m_blockcolor.cpp12
-rw-r--r--src/modules/m_botmode.cpp12
-rw-r--r--src/modules/m_callerid.cpp12
-rw-r--r--src/modules/m_censor.cpp24
-rw-r--r--src/modules/m_commonchans.cpp13
-rw-r--r--src/modules/m_noctcp.cpp10
-rw-r--r--src/modules/m_nokicks.cpp10
-rw-r--r--src/modules/m_nonicks.cpp10
-rw-r--r--src/modules/m_nonotice.cpp10
-rw-r--r--src/modules/m_services_account.cpp36
-rw-r--r--src/modules/m_stripcolor.cpp25
13 files changed, 40 insertions, 158 deletions
diff --git a/src/modules/m_allowinvite.cpp b/src/modules/m_allowinvite.cpp
index 6a4db1822..41edbc855 100644
--- a/src/modules/m_allowinvite.cpp
+++ b/src/modules/m_allowinvite.cpp
@@ -19,18 +19,13 @@
#include "inspircd.h"
-class AllowInvite : public SimpleChannelModeHandler
-{
- public:
- AllowInvite(Module* Creator) : SimpleChannelModeHandler(Creator, "allowinvite", 'A') { }
-};
-
class ModuleAllowInvite : public Module
{
- AllowInvite ni;
+ SimpleChannelModeHandler ni;
public:
- ModuleAllowInvite() : ni(this)
+ ModuleAllowInvite()
+ : ni(this, "allowinvite", 'A')
{
}
diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp
index dc0bdf974..d7cd303b6 100644
--- a/src/modules/m_blockcaps.cpp
+++ b/src/modules/m_blockcaps.cpp
@@ -23,19 +23,10 @@
#include "inspircd.h"
#include "modules/exemption.h"
-
-/** Handles the +B channel mode
- */
-class BlockCaps : public SimpleChannelModeHandler
-{
- public:
- BlockCaps(Module* Creator) : SimpleChannelModeHandler(Creator, "blockcaps", 'B') { }
-};
-
class ModuleBlockCAPS : public Module
{
CheckExemption::EventProvider exemptionprov;
- BlockCaps bc;
+ SimpleChannelModeHandler bc;
unsigned int percent;
unsigned int minlen;
char capsmap[256];
@@ -43,7 +34,7 @@ class ModuleBlockCAPS : public Module
public:
ModuleBlockCAPS()
: exemptionprov(this)
- , bc(this)
+ , bc(this, "blockcaps", 'B')
{
}
diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp
index 175c3b793..e3135185d 100644
--- a/src/modules/m_blockcolor.cpp
+++ b/src/modules/m_blockcolor.cpp
@@ -24,23 +24,15 @@
#include "inspircd.h"
#include "modules/exemption.h"
-/** Handles the +c channel mode
- */
-class BlockColor : public SimpleChannelModeHandler
-{
- public:
- BlockColor(Module* Creator) : SimpleChannelModeHandler(Creator, "blockcolor", 'c') { }
-};
-
class ModuleBlockColor : public Module
{
CheckExemption::EventProvider exemptionprov;
- BlockColor bc;
+ SimpleChannelModeHandler bc;
public:
ModuleBlockColor()
: exemptionprov(this)
- , bc(this)
+ , bc(this, "blockcolor", 'c')
{
}
diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp
index e0236bc17..b5befe9fa 100644
--- a/src/modules/m_botmode.cpp
+++ b/src/modules/m_botmode.cpp
@@ -21,21 +21,13 @@
#include "inspircd.h"
-/** Handles user mode +B
- */
-class BotMode : public SimpleUserModeHandler
-{
- public:
- BotMode(Module* Creator) : SimpleUserModeHandler(Creator, "bot", 'B') { }
-};
-
class ModuleBotMode : public Module, public Whois::EventListener
{
- BotMode bm;
+ SimpleUserModeHandler bm;
public:
ModuleBotMode()
: Whois::EventListener(this)
- , bm(this)
+ , bm(this, "bot", 'B')
{
}
diff --git a/src/modules/m_callerid.cpp b/src/modules/m_callerid.cpp
index d191a9fc7..7b56ffce4 100644
--- a/src/modules/m_callerid.cpp
+++ b/src/modules/m_callerid.cpp
@@ -147,12 +147,6 @@ struct CallerIDExtInfo : public ExtensionItem
}
};
-class User_g : public SimpleUserModeHandler
-{
-public:
- User_g(Module* Creator) : SimpleUserModeHandler(Creator, "callerid", 'g') { }
-};
-
class CommandAccept : public Command
{
/** Pair: first is the target, second is true to add, false to remove
@@ -333,7 +327,7 @@ public:
class ModuleCallerID : public Module
{
CommandAccept cmd;
- User_g myumode;
+ SimpleUserModeHandler myumode;
// Configuration variables:
bool operoverride; // Operators can override callerid.
@@ -364,7 +358,9 @@ class ModuleCallerID : public Module
}
public:
- ModuleCallerID() : cmd(this), myumode(this)
+ ModuleCallerID()
+ : cmd(this)
+ , myumode(this, "callerid", 'g')
{
}
diff --git a/src/modules/m_censor.cpp b/src/modules/m_censor.cpp
index a2f671772..6394ba9d0 100644
--- a/src/modules/m_censor.cpp
+++ b/src/modules/m_censor.cpp
@@ -25,34 +25,18 @@
typedef insp::flat_map<irc::string, irc::string> censor_t;
-/** Handles usermode +G
- */
-class CensorUser : public SimpleUserModeHandler
-{
- public:
- CensorUser(Module* Creator) : SimpleUserModeHandler(Creator, "u_censor", 'G') { }
-};
-
-/** Handles channel mode +G
- */
-class CensorChannel : public SimpleChannelModeHandler
-{
- public:
- CensorChannel(Module* Creator) : SimpleChannelModeHandler(Creator, "censor", 'G') { }
-};
-
class ModuleCensor : public Module
{
CheckExemption::EventProvider exemptionprov;
censor_t censors;
- CensorUser cu;
- CensorChannel cc;
+ SimpleUserModeHandler cu;
+ SimpleChannelModeHandler cc;
public:
ModuleCensor()
: exemptionprov(this)
- , cu(this)
- , cc(this)
+ , cu(this, "u_censor", 'G')
+ , cc(this, "censor", 'G')
{
}
diff --git a/src/modules/m_commonchans.cpp b/src/modules/m_commonchans.cpp
index e04217e71..678be0c43 100644
--- a/src/modules/m_commonchans.cpp
+++ b/src/modules/m_commonchans.cpp
@@ -19,19 +19,12 @@
#include "inspircd.h"
-/** Handles user mode +c
- */
-class PrivacyMode : public SimpleUserModeHandler
-{
- public:
- PrivacyMode(Module* Creator) : SimpleUserModeHandler(Creator, "deaf_commonchan", 'c') { }
-};
-
class ModulePrivacyMode : public Module
{
- PrivacyMode pm;
+ SimpleUserModeHandler pm;
public:
- ModulePrivacyMode() : pm(this)
+ ModulePrivacyMode()
+ : pm(this, "deaf_commonchan", 'c')
{
}
diff --git a/src/modules/m_noctcp.cpp b/src/modules/m_noctcp.cpp
index 4fc844b74..e9733cf54 100644
--- a/src/modules/m_noctcp.cpp
+++ b/src/modules/m_noctcp.cpp
@@ -22,21 +22,15 @@
#include "inspircd.h"
#include "modules/exemption.h"
-class NoCTCP : public SimpleChannelModeHandler
-{
- public:
- NoCTCP(Module* Creator) : SimpleChannelModeHandler(Creator, "noctcp", 'C') { }
-};
-
class ModuleNoCTCP : public Module
{
CheckExemption::EventProvider exemptionprov;
- NoCTCP nc;
+ SimpleChannelModeHandler nc;
public:
ModuleNoCTCP()
: exemptionprov(this)
- , nc(this)
+ , nc(this, "noctcp", 'C')
{
}
diff --git a/src/modules/m_nokicks.cpp b/src/modules/m_nokicks.cpp
index fb3455567..3155dcb6c 100644
--- a/src/modules/m_nokicks.cpp
+++ b/src/modules/m_nokicks.cpp
@@ -22,19 +22,13 @@
#include "inspircd.h"
-class NoKicks : public SimpleChannelModeHandler
-{
- public:
- NoKicks(Module* Creator) : SimpleChannelModeHandler(Creator, "nokick", 'Q') { }
-};
-
class ModuleNoKicks : public Module
{
- NoKicks nk;
+ SimpleChannelModeHandler nk;
public:
ModuleNoKicks()
- : nk(this)
+ : nk(this, "nokick", 'Q')
{
}
diff --git a/src/modules/m_nonicks.cpp b/src/modules/m_nonicks.cpp
index 91a1303c6..fbf772e0c 100644
--- a/src/modules/m_nonicks.cpp
+++ b/src/modules/m_nonicks.cpp
@@ -22,21 +22,15 @@
#include "inspircd.h"
#include "modules/exemption.h"
-class NoNicks : public SimpleChannelModeHandler
-{
- public:
- NoNicks(Module* Creator) : SimpleChannelModeHandler(Creator, "nonick", 'N') { }
-};
-
class ModuleNoNickChange : public Module
{
CheckExemption::EventProvider exemptionprov;
- NoNicks nn;
+ SimpleChannelModeHandler nn;
bool override;
public:
ModuleNoNickChange()
: exemptionprov(this)
- , nn(this)
+ , nn(this, "nonick", 'N')
{
}
diff --git a/src/modules/m_nonotice.cpp b/src/modules/m_nonotice.cpp
index f6496120b..d7ea32d2f 100644
--- a/src/modules/m_nonotice.cpp
+++ b/src/modules/m_nonotice.cpp
@@ -22,21 +22,15 @@
#include "inspircd.h"
#include "modules/exemption.h"
-class NoNotice : public SimpleChannelModeHandler
-{
- public:
- NoNotice(Module* Creator) : SimpleChannelModeHandler(Creator, "nonotice", 'T') { }
-};
-
class ModuleNoNotice : public Module
{
CheckExemption::EventProvider exemptionprov;
- NoNotice nt;
+ SimpleChannelModeHandler nt;
public:
ModuleNoNotice()
: exemptionprov(this)
- , nt(this)
+ , nt(this, "nonotice", 'T')
{
}
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp
index 249ba35ce..f413a04d0 100644
--- a/src/modules/m_services_account.cpp
+++ b/src/modules/m_services_account.cpp
@@ -89,30 +89,6 @@ class User_r : public ModeHandler
}
};
-/** Channel mode +R - unidentified users cannot join
- */
-class AChannel_R : public SimpleChannelModeHandler
-{
- public:
- AChannel_R(Module* Creator) : SimpleChannelModeHandler(Creator, "reginvite", 'R') { }
-};
-
-/** User mode +R - unidentified users cannot message
- */
-class AUser_R : public SimpleUserModeHandler
-{
- public:
- AUser_R(Module* Creator) : SimpleUserModeHandler(Creator, "regdeaf", 'R') { }
-};
-
-/** Channel mode +M - unidentified users cannot message channel
- */
-class AChannel_M : public SimpleChannelModeHandler
-{
- public:
- AChannel_M(Module* Creator) : SimpleChannelModeHandler(Creator, "regmoderated", 'M') { }
-};
-
class AccountExtItemImpl : public AccountExtItem
{
Events::ModuleEventProvider eventprov;
@@ -155,9 +131,9 @@ class AccountExtItemImpl : public AccountExtItem
class ModuleServicesAccount : public Module, public Whois::EventListener
{
CheckExemption::EventProvider exemptionprov;
- AChannel_R m1;
- AChannel_M m2;
- AUser_R m3;
+ SimpleChannelModeHandler m1;
+ SimpleChannelModeHandler m2;
+ SimpleUserModeHandler m3;
Channel_r m4;
User_r m5;
AccountExtItemImpl accountname;
@@ -166,7 +142,11 @@ class ModuleServicesAccount : public Module, public Whois::EventListener
ModuleServicesAccount()
: Whois::EventListener(this)
, exemptionprov(this)
- , m1(this), m2(this), m3(this), m4(this), m5(this)
+ , m1(this, "reginvite", 'R')
+ , m2(this, "regmoderated", 'M')
+ , m3(this, "regdeaf", 'R')
+ , m4(this)
+ , m5(this)
, accountname(this)
, checking_ban(false)
{
diff --git a/src/modules/m_stripcolor.cpp b/src/modules/m_stripcolor.cpp
index 9afe7132c..8068d8b7e 100644
--- a/src/modules/m_stripcolor.cpp
+++ b/src/modules/m_stripcolor.cpp
@@ -22,34 +22,17 @@
#include "inspircd.h"
#include "modules/exemption.h"
-/** Handles channel mode +S
- */
-class ChannelStripColor : public SimpleChannelModeHandler
-{
- public:
- ChannelStripColor(Module* Creator) : SimpleChannelModeHandler(Creator, "stripcolor", 'S') { }
-};
-
-/** Handles user mode +S
- */
-class UserStripColor : public SimpleUserModeHandler
-{
- public:
- UserStripColor(Module* Creator) : SimpleUserModeHandler(Creator, "u_stripcolor", 'S') { }
-};
-
-
class ModuleStripColor : public Module
{
CheckExemption::EventProvider exemptionprov;
- ChannelStripColor csc;
- UserStripColor usc;
+ SimpleChannelModeHandler csc;
+ SimpleUserModeHandler usc;
public:
ModuleStripColor()
: exemptionprov(this)
- , csc(this)
- , usc(this)
+ , csc(this, "stripcolor", 'S')
+ , usc(this, "u_stripcolor", 'S')
{
}