summaryrefslogtreecommitdiff
path: root/src/channels.cpp
diff options
context:
space:
mode:
authorw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-23 17:58:57 +0000
committerw00t <w00t@e03df62e-2008-0410-955e-edbf42e46eb7>2007-07-23 17:58:57 +0000
commita25ebde22705d1169b817a6a6d6a0b8a08d24467 (patch)
tree810f389ab25d0c13ba8902af212ec1b9803682b8 /src/channels.cpp
parentd6194cb02c55e202d58fdd0d4dd8a8890bf4b0d1 (diff)
Bit more tidying. Add some comments here, too.
git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@7504 e03df62e-2008-0410-955e-edbf42e46eb7
Diffstat (limited to 'src/channels.cpp')
-rw-r--r--src/channels.cpp22
1 files changed, 14 insertions, 8 deletions
diff --git a/src/channels.cpp b/src/channels.cpp
index 538aef171..edee36bf7 100644
--- a/src/channels.cpp
+++ b/src/channels.cpp
@@ -331,23 +331,29 @@ chanrec* chanrec::JoinUser(InspIRCd* Instance, userrec *user, const char* cn, bo
* OperMaxchans. For remote users which are not bound by the channel limits,
* we can extend infinitely. Otherwise, nope, youre restricted to MaxChans.
*/
- if (!IS_LOCAL(user) || override == true)
+
+
+
+ /*
+ * We place no restrictions on remote users, users that are override-joining, or users that are
+ * currently in under MaxChans channels. For all others, they won't get in here. -- w00t
+ */
+ if (!IS_LOCAL(user) || override == true || user->chans.size() < Instance->Config->MaxChans)
{
return chanrec::ForceChan(Instance, Ptr, user, privs);
}
- else if (IS_OPER(user))
+
+ /*
+ * If the above fails, and the user is an oper -- we let them in if they are under OperMaxChans.
+ * Otherwise, they're stuck, and need to override to get in, etc. -- w00t
+ */
+ if (IS_OPER(user))
{
- /* Oper allows extension up to the OperMaxchans value */
if (user->chans.size() < Instance->Config->OperMaxChans)
{
return chanrec::ForceChan(Instance, Ptr, user, privs);
}
}
- else if (user->chans.size() < Instance->Config->MaxChans)
- {
- return chanrec::ForceChan(Instance, Ptr, user, privs);
- }
-
user->WriteServ("405 %s %s :You are on too many channels",user->nick, cname);