diff options
| author | 2008-05-01 16:12:45 +0000 | |
|---|---|---|
| committer | 2008-05-01 16:12:45 +0000 | |
| commit | f3abcf2bcfe36d3389b74caa9eef8582901fbe15 (patch) | |
| tree | 2ebd9c1c6615939d850cf95866e9e982cb2b18d1 /src/modules/m_services_account.cpp | |
| parent | remove debug (diff) | |
Simple user/channel mode patch
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9596 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_services_account.cpp')
| -rw-r--r-- | src/modules/m_services_account.cpp | 78 |
1 files changed, 6 insertions, 72 deletions
diff --git a/src/modules/m_services_account.cpp b/src/modules/m_services_account.cpp index 70539ddde..3ac333b37 100644 --- a/src/modules/m_services_account.cpp +++ b/src/modules/m_services_account.cpp @@ -18,92 +18,26 @@ /** Channel mode +R - unidentified users cannot join */ -class AChannel_R : public ModeHandler +class AChannel_R : public SimpleChannelModeHandler { public: - AChannel_R(InspIRCd* Instance) : ModeHandler(Instance, 'R', 0, 0, false, MODETYPE_CHANNEL, false) { } - - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) - { - if (adding) - { - if (!channel->IsModeSet('R')) - { - channel->SetMode('R',true); - return MODEACTION_ALLOW; - } - } - else - { - if (channel->IsModeSet('R')) - { - channel->SetMode('R',false); - return MODEACTION_ALLOW; - } - } - - return MODEACTION_DENY; - } + AChannel_R(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'R') { } }; /** User mode +R - unidentified users cannot message */ -class AUser_R : public ModeHandler +class AUser_R : public SimpleUserModeHandler { public: - AUser_R(InspIRCd* Instance) : ModeHandler(Instance, 'R', 0, 0, false, MODETYPE_USER, false) { } - - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) - { - if (adding) - { - if (!dest->IsModeSet('R')) - { - dest->SetMode('R',true); - return MODEACTION_ALLOW; - } - } - else - { - if (dest->IsModeSet('R')) - { - dest->SetMode('R',false); - return MODEACTION_ALLOW; - } - } - - return MODEACTION_DENY; - } + AUser_R(InspIRCd* Instance) : SimpleUserModeHandler(Instance, 'R') { } }; /** Channel mode +M - unidentified users cannot message channel */ -class AChannel_M : public ModeHandler +class AChannel_M : public SimpleChannelModeHandler { public: - AChannel_M(InspIRCd* Instance) : ModeHandler(Instance, 'M', 0, 0, false, MODETYPE_CHANNEL, false) { } - - ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string ¶meter, bool adding, bool) - { - if (adding) - { - if (!channel->IsModeSet('M')) - { - channel->SetMode('M',true); - return MODEACTION_ALLOW; - } - } - else - { - if (channel->IsModeSet('M')) - { - channel->SetMode('M',false); - return MODEACTION_ALLOW; - } - } - - return MODEACTION_DENY; - } + AChannel_M(InspIRCd* Instance) : SimpleChannelModeHandler(Instance, 'M') { } }; class ModuleServicesAccount : public Module |
