summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2009-02-15 09:20:46 +0000
committerbrain <brain@e03df62e-2008-0410-955e-edbf42e46eb7>2009-02-15 09:20:46 +0000
commit6b26d9b62fd4db550e5a78d028b80a30ab38513d (patch)
treee2d003bad566126b25849125b0df0ea7b5c0c5e5
parentf44ff8cf3c1d661316c8801b1a75190cf6462218 (diff)
Fix for bug #725, operprefix rank value conflicts with founder rank value, raise operprefix value, also get rid of some static global var craq.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11110 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--src/modules/m_operprefix.cpp18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/modules/m_operprefix.cpp b/src/modules/m_operprefix.cpp
index 6614b867b..127a1b46b 100644
--- a/src/modules/m_operprefix.cpp
+++ b/src/modules/m_operprefix.cpp
@@ -19,7 +19,7 @@
#include "inspircd.h"
-static char prefixchar;
+#define OPERPREFIX_VALUE 1000000
std::set<std::string>* SetupExt(User* user)
{
@@ -51,11 +51,11 @@ void AddPrefixChan(User* user, Channel* channel)
class OperPrefixMode : public ModeHandler
{
public:
- OperPrefixMode(InspIRCd* Instance) : ModeHandler(Instance, 'y', 1, 1, true, MODETYPE_CHANNEL, false, prefixchar) { }
+ OperPrefixMode(InspIRCd* Instance, char prefix) : ModeHandler(Instance, 'y', 1, 1, true, MODETYPE_CHANNEL, false, prefix) { }
unsigned int GetPrefixRank()
{
- return 40000;
+ return OPERPREFIX_VALUE;
}
ModeAction OnModeChange(User* source, User* dest, Channel* channel, std::string &parameter, bool adding, bool servermode)
@@ -111,11 +111,9 @@ class ModuleOperPrefixMode : public Module
ModuleOperPrefixMode(InspIRCd* Me) : Module(Me)
{
ConfigReader Conf(ServerInstance);
- std::string tmp;
- tmp = Conf.ReadValue("operprefix", "prefix", "!", 0, false);
- strlcpy(&prefixchar,tmp.c_str(),2);
+ std::string pfx = Conf.ReadValue("operprefix", "prefix", "!", 0, false);
- opm = new OperPrefixMode(ServerInstance);
+ opm = new OperPrefixMode(ServerInstance, pfx[0]);
if ((!ServerInstance->Modes->AddMode(opm)))
throw ModuleException("Could not add a new mode!");
@@ -129,9 +127,9 @@ class ModuleOperPrefixMode : public Module
DelPrefixChan(user, channel);
else
AddPrefixChan(user, channel);
- char modeline[]="+y";
+ char modeline[] = "+y";
if (negate)
- modeline [0]='-';
+ modeline[0] = '-';
std::vector<std::string> modechange;
modechange.push_back(channel->name);
modechange.push_back(modeline);
@@ -189,7 +187,7 @@ class ModuleOperPrefixMode : public Module
{
for (UCListIter v = user->chans.begin(); v != user->chans.end(); v++)
{
- ModePair ms=opm->ModeSet(NULL, NULL , v->first, user->nick);
+ ModePair ms = opm->ModeSet(NULL, NULL , v->first, user->nick);
if (ms.first)
{
PushChanMode(v->first, user, true);