diff options
author | Peter Powell <petpow@saberuk.com> | 2013-07-10 15:23:46 +0100 |
---|---|---|
committer | Peter Powell <petpow@saberuk.com> | 2013-08-10 14:04:09 +0100 |
commit | 3d019b14ec0025ff38bbd40c868ddccd0b13d8a3 (patch) | |
tree | c872541f332ffdea8691ed7ec40c7904adf8a69e | |
parent | 4509cbcc0b57f9f397af26f5e8dbe629499c2b24 (diff) |
Require privs given on initial join to be in <options:defaultmodes>.
-rw-r--r-- | docs/conf/inspircd.conf.example | 2 | ||||
-rw-r--r-- | src/channels.cpp | 7 | ||||
-rw-r--r-- | src/configreader.cpp | 2 |
3 files changed, 7 insertions, 4 deletions
diff --git a/docs/conf/inspircd.conf.example b/docs/conf/inspircd.conf.example index ee268dcd2..0e5d40c08 100644 --- a/docs/conf/inspircd.conf.example +++ b/docs/conf/inspircd.conf.example @@ -617,7 +617,7 @@ # defaultmodes: What modes are set on a empty channel when a user # joins it and it is unregistered. This is similar to Asuka's # autochanmodes. - defaultmodes="nt" + defaultmodes="not" # xlinemessage: This is the text that is sent to a user when they are # banned from the server. diff --git a/src/channels.cpp b/src/channels.cpp index d82ad6c23..c7913606f 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -162,6 +162,9 @@ void Channel::SetDefaultModes() ModeHandler* mode = ServerInstance->Modes->FindMode(*n, MODETYPE_CHANNEL); if (mode) { + if (mode->GetPrefixRank()) + continue; + if (mode->GetNumParams(true)) list.GetToken(parameter); else @@ -223,7 +226,7 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co if (!chan) { - privs = "o"; + privs = ServerInstance->Config->DefaultModes.substr(0, ServerInstance->Config->DefaultModes.find(' ')); if (override == false) { @@ -343,7 +346,7 @@ void Channel::ForceJoin(User* user, const std::string* privs, bool bursting, boo for (std::string::const_iterator i = privs->begin(); i != privs->end(); ++i) { ModeHandler* mh = ServerInstance->Modes->FindMode(*i, MODETYPE_CHANNEL); - if (mh) + if (mh && mh->GetPrefixRank()) { std::string nick = user->nick; /* Set, and make sure that the mode handler knows this mode was now set */ diff --git a/src/configreader.cpp b/src/configreader.cpp index d7d448bc4..27b9e5c77 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -401,7 +401,7 @@ void ServerConfig::Fill() UndernetMsgPrefix = options->getBool("ircumsgprefix"); FullHostInTopic = options->getBool("hostintopic"); MaxTargets = security->getInt("maxtargets", 20, 1, 31); - DefaultModes = options->getString("defaultmodes", "nt"); + DefaultModes = options->getString("defaultmodes", "not"); PID = ConfValue("pid")->getString("file"); MaxChans = ConfValue("channels")->getInt("users", 20); OperMaxChans = ConfValue("channels")->getInt("opers", 60); |