X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fchannels.cpp;h=67f908195de95eb130bdec2bdccd8c46be25154f;hb=d494fa6e094e85cd29235e995fb2b447d6e1f168;hp=0ff252c9517835100e8f7385668f35023aa9c061;hpb=e57d1b19ff4823b7885eb7f4d3b37c84d2edca0e;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/channels.cpp b/src/channels.cpp index 0ff252c95..67f908195 100644 --- a/src/channels.cpp +++ b/src/channels.cpp @@ -1,13 +1,15 @@ /* * InspIRCd -- Internet Relay Chat Daemon * + * Copyright (C) 2017 B00mX0r + * Copyright (C) 2013-2014, 2016-2020 Sadie Powell + * Copyright (C) 2013 Adam + * Copyright (C) 2012-2016, 2018 Attila Molnar + * Copyright (C) 2012, 2019 Robby * Copyright (C) 2009-2010 Daniel De Graaf - * Copyright (C) 2006-2008 Robin Burchell - * Copyright (C) 2006, 2008 Oliver Lupton - * Copyright (C) 2008 Pippijn van Steenhoven - * Copyright (C) 2003-2008 Craig Edwards - * Copyright (C) 2008 Thomas Stagner * Copyright (C) 2007 Dennis Friis + * Copyright (C) 2006-2009 Robin Burchell + * Copyright (C) 2006-2008, 2010 Craig Edwards * * This file is part of InspIRCd. InspIRCd is free software: you can * redistribute it and/or modify it under the terms of the GNU General Public @@ -176,6 +178,8 @@ 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 = ConvToNum(user->oper->getConfig("maxchans")); @@ -271,8 +275,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); @@ -471,12 +475,18 @@ const char* Channel::ChanModes(bool showsecret) 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); } +void Channel::WriteRemoteNotice(const std::string& text, char status) +{ + WriteNotice(text, status); + ServerInstance->PI->SendMessage(this, status, text, MSG_NOTICE); +} + /* returns the status character for a given user on a channel, e.g. @ for op, * % for halfop etc. If the user has several modes set, the highest mode * the user has must be returned.