summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAttila Molnar <attilamolnar@hush.com>2014-02-18 13:41:01 +0100
committerAttila Molnar <attilamolnar@hush.com>2014-02-18 13:41:01 +0100
commit8f901b33a8d2ee0d318ae5feba3d84f1af939f22 (patch)
tree045c963aa883535deb11ccdd9e51bfd2020d9e7b /src
parent0556720b559d7ec5d8badacf0ac9b11e9c864847 (diff)
Change the parameter type of ModeHandler::GiveModeList() from ModeMasks to ModeType
Diffstat (limited to 'src')
-rw-r--r--src/mode.cpp4
-rw-r--r--src/modules/m_spanningtree/capab.cpp8
-rw-r--r--src/server.cpp2
3 files changed, 7 insertions, 7 deletions
diff --git a/src/mode.cpp b/src/mode.cpp
index eeab0de3a..90b8efeb8 100644
--- a/src/mode.cpp
+++ b/src/mode.cpp
@@ -764,7 +764,7 @@ PrefixMode* ModeParser::FindPrefix(unsigned const char pfxletter)
return NULL;
}
-std::string ModeParser::GiveModeList(ModeMasks m)
+std::string ModeParser::GiveModeList(ModeType mt)
{
std::string type1; /* Listmodes EXCEPT those with a prefix */
std::string type2; /* Modes that take a param when adding or removing */
@@ -773,7 +773,7 @@ std::string ModeParser::GiveModeList(ModeMasks m)
for (unsigned char mode = 'A'; mode <= 'z'; mode++)
{
- unsigned char pos = (mode-65) | m;
+ unsigned char pos = (mode-65) | ((mt == MODETYPE_CHANNEL) ? MASK_CHANNEL : MASK_USER);
/* One parameter when adding */
if (modehandlers[pos])
{
diff --git a/src/modules/m_spanningtree/capab.cpp b/src/modules/m_spanningtree/capab.cpp
index c52dffa41..dc48c87df 100644
--- a/src/modules/m_spanningtree/capab.cpp
+++ b/src/modules/m_spanningtree/capab.cpp
@@ -151,8 +151,8 @@ void TreeSocket::SendCapabilities(int phase)
" MAXAWAY="+ConvToStr(ServerInstance->Config->Limits.MaxAway)+
extra+
" PREFIX="+ServerInstance->Modes->BuildPrefixes()+
- " CHANMODES="+ServerInstance->Modes->GiveModeList(MASK_CHANNEL)+
- " USERMODES="+ServerInstance->Modes->GiveModeList(MASK_USER)
+ " CHANMODES="+ServerInstance->Modes->GiveModeList(MODETYPE_CHANNEL)+
+ " USERMODES="+ServerInstance->Modes->GiveModeList(MODETYPE_USER)
);
this->WriteLine("CAPAB END");
@@ -283,7 +283,7 @@ bool TreeSocket::Capab(const parameterlist &params)
}
else if (this->capab->CapKeys.find("CHANMODES") != this->capab->CapKeys.end())
{
- if (this->capab->CapKeys.find("CHANMODES")->second != ServerInstance->Modes->GiveModeList(MASK_CHANNEL))
+ if (this->capab->CapKeys.find("CHANMODES")->second != ServerInstance->Modes->GiveModeList(MODETYPE_CHANNEL))
reason = "One or more of the channel modes on the remote server are invalid on this server.";
}
@@ -305,7 +305,7 @@ bool TreeSocket::Capab(const parameterlist &params)
}
else if (this->capab->CapKeys.find("USERMODES") != this->capab->CapKeys.end())
{
- if (this->capab->CapKeys.find("USERMODES")->second != ServerInstance->Modes->GiveModeList(MASK_USER))
+ if (this->capab->CapKeys.find("USERMODES")->second != ServerInstance->Modes->GiveModeList(MODETYPE_USER))
reason = "One or more of the user modes on the remote server are invalid on this server.";
}
diff --git a/src/server.cpp b/src/server.cpp
index 5590f05f9..9e58c9cff 100644
--- a/src/server.cpp
+++ b/src/server.cpp
@@ -169,7 +169,7 @@ void ISupportManager::Build()
tokens["AWAYLEN"] = ConvToStr(ServerInstance->Config->Limits.MaxAway);
tokens["CASEMAPPING"] = "rfc1459";
- tokens["CHANMODES"] = ServerInstance->Modes->GiveModeList(MASK_CHANNEL);
+ tokens["CHANMODES"] = ServerInstance->Modes->GiveModeList(MODETYPE_CHANNEL);
tokens["CHANNELLEN"] = ConvToStr(ServerInstance->Config->Limits.ChanMax);
tokens["CHANTYPES"] = "#";
tokens["ELIST"] = "MU";