From f6fc729c7211ac6cc9fca4ef63a710b48ccf2457 Mon Sep 17 00:00:00 2001 From: brain Date: Sat, 8 Jul 2006 21:37:16 +0000 Subject: Did some renaming so that the methods for modes in chanrec and userrec are identical. bool IsModeSet(const unsigned char c); void SetMode(const unsigned char c, bool value); Fixed m_botmode for new api git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@4194 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/modules/m_blockcaps.cpp | 4 ++-- src/modules/m_blockcolor.cpp | 4 ++-- src/modules/m_botmode.cpp | 25 +++++++++++++++++++++++++ 3 files changed, 29 insertions(+), 4 deletions(-) (limited to 'src/modules') diff --git a/src/modules/m_blockcaps.cpp b/src/modules/m_blockcaps.cpp index 4cad8ebc2..017217073 100644 --- a/src/modules/m_blockcaps.cpp +++ b/src/modules/m_blockcaps.cpp @@ -33,7 +33,7 @@ class BlockCaps : public ModeHandler { if (!channel->IsModeSet('P')) { - channel->SetCustomMode('P',true); + channel->SetMode('P',true); return MODEACTION_ALLOW; } } @@ -41,7 +41,7 @@ class BlockCaps : public ModeHandler { if (channel->IsModeSet('P')) { - channel->SetCustomMode('P',false); + channel->SetMode('P',false); return MODEACTION_ALLOW; } } diff --git a/src/modules/m_blockcolor.cpp b/src/modules/m_blockcolor.cpp index 04c621ac0..f517ba215 100644 --- a/src/modules/m_blockcolor.cpp +++ b/src/modules/m_blockcolor.cpp @@ -36,7 +36,7 @@ class BlockColor : public ModeHandler { if (!channel->IsModeSet('c')) { - channel->SetCustomMode('c',true); + channel->SetMode('c',true); return MODEACTION_ALLOW; } } @@ -44,7 +44,7 @@ class BlockColor : public ModeHandler { if (channel->IsModeSet('c')) { - channel->SetCustomMode('c',false); + channel->SetMode('c',false); return MODEACTION_ALLOW; } } diff --git a/src/modules/m_botmode.cpp b/src/modules/m_botmode.cpp index 612eb3b9c..d5757c002 100644 --- a/src/modules/m_botmode.cpp +++ b/src/modules/m_botmode.cpp @@ -24,6 +24,31 @@ using namespace std; /* $ModDesc: Provides support for unreal-style umode +B */ +class BotMode : public ModeHandler +{ + BotMode() : ModeHandler('B', 0, 0, false, MODETYPE_USER, false) { } + + ModeAction OnModeChange(userrec* source, userrec* dest, chanrec* channel, std::string ¶meter, bool adding) + { + if (adding) + { + if (!dest->IsModeSet('B')) + { + user->SetMode('B',true); + return MODEACTION_ALLOW; + } + } + else + { + if (dest->IsModeSet('B')) + { + user->SetMode('B',false); + return MODEACTION_ALLOW; + } + } + } +}; + class ModuleBotMode : public Module { Server *Srv; -- cgit v1.2.3