1
0
mirror of https://github.com/anope/anope.git synced 2026-06-25 13:36:36 +02:00

Move oper count and vhost stuff to set/remove mode internal

This commit is contained in:
Adam
2014-01-09 17:01:18 -05:00
parent 0b0db75ba5
commit 15a27c69ba
+15 -14
View File
@@ -463,6 +463,12 @@ void User::SetModeInternal(const MessageSource &source, UserMode *um, const Anop
this->modes[um->name] = param;
if (um->name == "OPER")
++OperCount;
if (um->name == "CLOAK" || um->name == "VHOST")
this->UpdateHost();
FOREACH_MOD(OnUserModeSet, (source, this, um->name));
}
@@ -473,6 +479,15 @@ void User::RemoveModeInternal(const MessageSource &source, UserMode *um)
this->modes.erase(um->name);
if (um->name == "OPER")
--OperCount;
if (um->name == "CLOAK" || um->name == "VHOST")
{
this->vhost.clear();
this->UpdateHost();
}
FOREACH_MOD(OnUserModeUnset, (source, this, um->name));
}
@@ -592,20 +607,6 @@ void User::SetModesInternal(const MessageSource &source, const char *umodes, ...
}
else
this->RemoveModeInternal(source, um);
if (um->name == "OPER")
{
if (add)
++OperCount;
else
--OperCount;
}
else if (um->name == "CLOAK" || um->name == "VHOST")
{
if (!add && !this->vhost.empty())
this->vhost.clear();
this->UpdateHost();
}
}
}