X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fchannels.cpp;h=5baaf03ee1aabb696ecb78ed345966a41c173ec0;hb=687778b72e31322a73b2e2e17af6bd0f2a2561bc;hp=e25500892baa8c8f3942884f183e329fc44e29e1;hpb=654355c2d114a68639ac36238291ebfceec2537d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/channels.cpp b/src/channels.cpp index e25500892..5baaf03ee 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -176,9 +176,11 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co if (!override) { unsigned int maxchans = user->GetClass()->maxchans; + if (!maxchans) + maxchans = ServerInstance->Config->MaxChans; if (user->IsOper()) { - unsigned int opermaxchans = ConvToInt(user->oper->getConfig("maxchans")); + unsigned int opermaxchans = ConvToNum(user->oper->getConfig("maxchans")); // If not set, use 2.0's , if that's not set either, use limit from CC if (!opermaxchans && user->HasPrivPermission("channels/high-join-limit")) opermaxchans = ServerInstance->Config->OperMaxChans; @@ -242,7 +244,7 @@ Channel* Channel::JoinUser(LocalUser* user, std::string cname, bool override, co { if (chan->IsBanned(user)) { - user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (You're banned)"); + user->WriteNumeric(ERR_BANNEDFROMCHAN, chan->name, "Cannot join channel (you're banned)"); return NULL; } } @@ -271,8 +273,8 @@ Membership* Channel::ForceJoin(User* user, const std::string* privs, bool bursti if (privs) { - // If the user was granted prefix modes (in the OnUserPreJoin hook, or he's a - // remote user and his own server set the modes), then set them internally now + // If the user was granted prefix modes (in the OnUserPreJoin hook, or they're a + // remote user and their own server set the modes), then set them internally now for (std::string::const_iterator i = privs->begin(); i != privs->end(); ++i) { PrefixMode* mh = ServerInstance->Modes->FindPrefixMode(*i); @@ -436,7 +438,7 @@ void Channel::Write(ClientProtocol::Event& protoev, char status, const CUList& e } } -const char* Channel::ChanModes(bool showkey) +const char* Channel::ChanModes(bool showsecret) { static std::string scratch; std::string sparam; @@ -455,9 +457,9 @@ const char* Channel::ChanModes(bool showkey) if (!pm) continue; - if (n == 'k' - 65 && !showkey) + if (pm->IsParameterSecret() && !showsecret) { - sparam += " "; + sparam += " <" + pm->name + ">"; } else { @@ -471,10 +473,11 @@ const char* Channel::ChanModes(bool showkey) return scratch.c_str(); } -void Channel::WriteNotice(const std::string& text) +void Channel::WriteNotice(const std::string& text, char status) { - ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, this, text, MSG_NOTICE); + ClientProtocol::Messages::Privmsg privmsg(ClientProtocol::Messages::Privmsg::nocopy, ServerInstance->FakeClient, this, text, MSG_NOTICE, status); Write(ServerInstance->GetRFCEvents().privmsg, privmsg); + ServerInstance->PI->SendMessage(this, status, text, MSG_NOTICE); } /* returns the status character for a given user on a channel, e.g. @ for op,