summaryrefslogtreecommitdiff
path: root/src/modules/m_spanningtree/fjoin.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-01 13:53:27 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2008-04-01 13:53:27 +0000
commit1f9ef4081211739c7c04211a9d77549d25c09f7a (patch)
treed7bc1589bb5fd322016cb0dc8ae7da930b56cbdd /src/modules/m_spanningtree/fjoin.cpp
parentbeaaee86df1e13f68fc5d6fb1f0ce61e3d3412a9 (diff)
Configurable prefixes for chanmodes +qa: prefixes can be turned on or off individually and seperately, per server as well as per mode, and prefixes are no longer limited to ~&. *** SERVICES AUTHORS *** This involves a protocol change. FJOIN now sends the userlist with format modes,nick instead of prefixes,nick.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@9241 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/modules/m_spanningtree/fjoin.cpp')
-rw-r--r--src/modules/m_spanningtree/fjoin.cpp20
1 files changed, 12 insertions, 8 deletions
diff --git a/src/modules/m_spanningtree/fjoin.cpp b/src/modules/m_spanningtree/fjoin.cpp
index a4fe5836a..0f33d65bd 100644
--- a/src/modules/m_spanningtree/fjoin.cpp
+++ b/src/modules/m_spanningtree/fjoin.cpp
@@ -112,22 +112,26 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
const char* usr = item.c_str();
if (usr && *usr)
{
- const char* permissions = usr;
- /* Iterate through all the prefix values, convert them from prefixes to mode letters */
+ const char* unparsedmodes = usr;
std::string modes;
- while ((*permissions) && (*permissions != ','))
+
+
+ /* Iterate through all modes for this user and check they are valid. */
+ while ((*unparsedmodes) && (*unparsedmodes != ','))
{
- ModeHandler* mh = Instance->Modes->FindPrefix(*permissions);
+ ModeHandler *mh = Instance->Modes->FindMode(*unparsedmodes, MODETYPE_CHANNEL);
if (mh)
- modes = modes + mh->GetModeChar();
+ modes += *unparsedmodes;
else
{
- this->SendError(std::string("Invalid prefix '")+(*permissions)+"' in FJOIN");
+ this->SendError(std::string("Invalid prefix '")+(*unparsedmodes)+"' in FJOIN");
return false;
}
+
usr++;
- permissions++;
+ unparsedmodes++;
}
+
/* Advance past the comma, to the nick */
usr++;
@@ -140,7 +144,7 @@ bool TreeSocket::ForceJoin(const std::string &source, std::deque<std::string> &p
if ((!route_back_again) || (route_back_again->GetSocket() != this))
continue;
- /* Add any permissions this user had to the mode stack */
+ /* Add any modes this user had to the mode stack */
for (std::string::iterator x = modes.begin(); x != modes.end(); ++x)
modestack.Push(*x, who->nick);