summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-04-29 02:43:16 +0000
committerdanieldg <danieldg@e03df62e-2008-0410-955e-edbf42e46eb7>2009-04-29 02:43:16 +0000
commitd2a71fd3447c8bac65cc26077e2b9fc3fb0b28a7 (patch)
tree648fcf8fa6ca20ab599d618fd33433a761639d98
parent1064b6732975ad32ac32147974a3af2d888a7e12 (diff)
Overloading SetMode seems to cause the compiler to interpret "" as a bool and not a string. Fixes bug #849
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@11335 e03df62e-2008-0410-955e-edbf42e46eb7
-rw-r--r--include/channels.h2
-rw-r--r--src/channels.cpp2
-rw-r--r--src/modes/cmode_k.cpp4
-rw-r--r--src/modes/cmode_l.cpp4
-rw-r--r--src/modules/m_joinflood.cpp6
-rw-r--r--src/modules/m_kicknorejoin.cpp6
-rw-r--r--src/modules/m_messageflood.cpp6
-rw-r--r--src/modules/m_nickflood.cpp6
-rw-r--r--src/modules/m_redirect.cpp4
9 files changed, 20 insertions, 20 deletions
diff --git a/include/channels.h b/include/channels.h
index dfee69dc0..1b6e9a875 100644
--- a/include/channels.h
+++ b/include/channels.h
@@ -207,7 +207,7 @@ class CoreExport Channel : public Extensible
* @param parameter The parameter string to associate with this mode character.
* If it is empty, the mode is unset; if it is nonempty, the mode is set.
*/
- void SetMode(char mode, std::string parameter);
+ void SetModeParam(char mode, std::string parameter);
/** Returns true if a mode is set on a channel
* @param mode The mode character you wish to query
diff --git a/src/channels.cpp b/src/channels.cpp
index c8334d42e..a6ed3406d 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -36,7 +36,7 @@ void Channel::SetMode(char mode,bool mode_on)
modes[mode-65] = mode_on;
}
-void Channel::SetMode(char mode, std::string parameter)
+void Channel::SetModeParam(char mode, std::string parameter)
{
CustomModeList::iterator n = custom_mode_params.find(mode);
// always erase, even if changing, so that the map gets the new value
diff --git a/src/modes/cmode_k.cpp b/src/modes/cmode_k.cpp
index a7c491aa5..59d401ebb 100644
--- a/src/modes/cmode_k.cpp
+++ b/src/modes/cmode_k.cpp
@@ -99,11 +99,11 @@ ModeAction ModeChannelKey::OnModeChange(User* source, User*, Channel* channel, s
std::string ckey;
ckey.assign(parameter, 0, 32);
parameter = ckey;
- channel->SetMode('k', parameter);
+ channel->SetModeParam('k', parameter);
}
else
{
- channel->SetMode('k', "");
+ channel->SetModeParam('k', "");
}
return MODEACTION_ALLOW;
}
diff --git a/src/modes/cmode_l.cpp b/src/modes/cmode_l.cpp
index 3d37fc900..f20256e87 100644
--- a/src/modes/cmode_l.cpp
+++ b/src/modes/cmode_l.cpp
@@ -54,7 +54,7 @@ ModeAction ModeChannelLimit::OnModeChange(User*, User*, Channel* channel, std::s
parameter = ConvToStr(limit);
/* Set new limit */
- channel->SetMode('l', parameter);
+ channel->SetModeParam('l', parameter);
return MODEACTION_ALLOW;
}
@@ -70,7 +70,7 @@ ModeAction ModeChannelLimit::OnModeChange(User*, User*, Channel* channel, std::s
}
/* Removing old limit, no checks here */
- channel->SetMode('l', "");
+ channel->SetModeParam('l', "");
return MODEACTION_ALLOW;
}
}
diff --git a/src/modules/m_joinflood.cpp b/src/modules/m_joinflood.cpp
index 7e4a05d2b..cb8c90e09 100644
--- a/src/modules/m_joinflood.cpp
+++ b/src/modules/m_joinflood.cpp
@@ -144,7 +144,7 @@ class JoinFlood : public ModeHandler
parameter = ConvToStr(njoins) + ":" +ConvToStr(nsecs);
joinfloodsettings *f = new joinfloodsettings(ServerInstance, nsecs, njoins);
channel->Extend("joinflood", f);
- channel->SetMode('j', parameter);
+ channel->SetModeParam('j', parameter);
return MODEACTION_ALLOW;
}
else
@@ -167,7 +167,7 @@ class JoinFlood : public ModeHandler
f = new joinfloodsettings(ServerInstance, nsecs, njoins);
channel->Shrink("joinflood");
channel->Extend("joinflood", f);
- channel->SetMode('j', parameter);
+ channel->SetModeParam('j', parameter);
return MODEACTION_ALLOW;
}
else
@@ -192,7 +192,7 @@ class JoinFlood : public ModeHandler
channel->GetExt("joinflood", f);
delete f;
channel->Shrink("joinflood");
- channel->SetMode('j', "");
+ channel->SetModeParam('j', "");
return MODEACTION_ALLOW;
}
}
diff --git a/src/modules/m_kicknorejoin.cpp b/src/modules/m_kicknorejoin.cpp
index c5abc80c2..9e12b4e18 100644
--- a/src/modules/m_kicknorejoin.cpp
+++ b/src/modules/m_kicknorejoin.cpp
@@ -65,7 +65,7 @@ class KickRejoin : public ModeHandler
}
else
{
- channel->SetMode('J', "");
+ channel->SetModeParam('J', "");
return MODEACTION_ALLOW;
}
}
@@ -74,7 +74,7 @@ class KickRejoin : public ModeHandler
if (!channel->IsModeSet('J'))
{
parameter = ConvToStr(atoi(parameter.c_str()));
- channel->SetMode('J', parameter);
+ channel->SetModeParam('J', parameter);
return MODEACTION_ALLOW;
}
else
@@ -91,7 +91,7 @@ class KickRejoin : public ModeHandler
parameter = ConvToStr(atoi(parameter.c_str()));
if (parameter != "0")
{
- channel->SetMode('J', parameter);
+ channel->SetModeParam('J', parameter);
return MODEACTION_ALLOW;
}
else
diff --git a/src/modules/m_messageflood.cpp b/src/modules/m_messageflood.cpp
index fb9d2bbc2..2342870b8 100644
--- a/src/modules/m_messageflood.cpp
+++ b/src/modules/m_messageflood.cpp
@@ -143,7 +143,7 @@ class MsgFlood : public ModeHandler
parameter = std::string(ban ? "*" : "") + ConvToStr(nlines) + ":" +ConvToStr(nsecs);
floodsettings *fs = new floodsettings(ServerInstance,ban,nsecs,nlines);
channel->Extend("flood",fs);
- channel->SetMode('f', parameter);
+ channel->SetModeParam('f', parameter);
return MODEACTION_ALLOW;
}
else
@@ -163,7 +163,7 @@ class MsgFlood : public ModeHandler
floodsettings *fs = new floodsettings(ServerInstance,ban,nsecs,nlines);
channel->Shrink("flood");
channel->Extend("flood",fs);
- channel->SetMode('f', parameter);
+ channel->SetModeParam('f', parameter);
return MODEACTION_ALLOW;
}
else
@@ -187,7 +187,7 @@ class MsgFlood : public ModeHandler
{
delete f;
channel->Shrink("flood");
- channel->SetMode('f', "");
+ channel->SetModeParam('f', "");
return MODEACTION_ALLOW;
}
}
diff --git a/src/modules/m_nickflood.cpp b/src/modules/m_nickflood.cpp
index 0a8e9a31d..81f5d9ea9 100644
--- a/src/modules/m_nickflood.cpp
+++ b/src/modules/m_nickflood.cpp
@@ -144,7 +144,7 @@ class NickFlood : public ModeHandler
parameter = ConvToStr(nnicks) + ":" +ConvToStr(nsecs);
nickfloodsettings *f = new nickfloodsettings(ServerInstance, nsecs, nnicks);
channel->Extend("nickflood", f);
- channel->SetMode('F', parameter);
+ channel->SetModeParam('F', parameter);
return MODEACTION_ALLOW;
}
else
@@ -167,7 +167,7 @@ class NickFlood : public ModeHandler
f = new nickfloodsettings(ServerInstance, nsecs, nnicks);
channel->Shrink("nickflood");
channel->Extend("nickflood", f);
- channel->SetMode('F', parameter);
+ channel->SetModeParam('F', parameter);
return MODEACTION_ALLOW;
}
else
@@ -192,7 +192,7 @@ class NickFlood : public ModeHandler
channel->GetExt("nickflood", f);
delete f;
channel->Shrink("nickflood");
- channel->SetMode('F', "");
+ channel->SetModeParam('F', "");
return MODEACTION_ALLOW;
}
}
diff --git a/src/modules/m_redirect.cpp b/src/modules/m_redirect.cpp
index 00c191d26..8e66060b8 100644
--- a/src/modules/m_redirect.cpp
+++ b/src/modules/m_redirect.cpp
@@ -68,14 +68,14 @@ class Redirect : public ModeHandler
* We used to do some checking for circular +L here, but there is no real need for this any more especially as we
* now catch +L looping in PreJoin. Remove it, since O(n) logic makes me sad, and we catch it anyway. :) -- w00t
*/
- channel->SetMode('L', parameter);
+ channel->SetModeParam('L', parameter);
return MODEACTION_ALLOW;
}
else
{
if (channel->IsModeSet('L'))
{
- channel->SetMode('L', "");
+ channel->SetModeParam('L', "");
return MODEACTION_ALLOW;
}
}