}
Channel::Channel(const std::string &cname, time_t ts)
+ : name(cname), age(ts), topicset(0)
{
if (!ServerInstance->chanlist->insert(std::make_pair(cname, this)).second)
throw CoreException("Cannot create duplicate channel " + cname);
-
- this->name = cname;
- this->age = ts ? ts : ServerInstance->Time();
-
- topicset = 0;
- modes.reset();
}
void Channel::SetMode(ModeHandler* mh, bool on)
ModeHandler* mode = ServerInstance->Modes->FindMode(*n, MODETYPE_CHANNEL);
if (mode)
{
+ if (mode->GetPrefixRank())
+ continue;
+
if (mode->GetNumParams(true))
list.GetToken(parameter);
else
if (!chan)
{
- privs = "o";
+ privs = ServerInstance->Config->DefaultModes.substr(0, ServerInstance->Config->DefaultModes.find(' '));
if (override == false)
{
{
// 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
- memb->modes = *privs;
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 */