0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-12-29 08:54:02 +01:00

override: Remove umode +p when deopering.

This commit is contained in:
Jilles Tjoelker 2013-10-25 17:49:58 +02:00
parent 0137d36122
commit e5c254d7d1

View file

@ -107,19 +107,22 @@ check_umode_change(void *vdata)
if (!MyClient(source_p)) if (!MyClient(source_p))
return; return;
if (data->oldumodes & UMODE_OPER && !IsOper(source_p))
source_p->umodes &= ~user_modes['p'];
/* didn't change +p umode, we don't need to do anything */ /* didn't change +p umode, we don't need to do anything */
if (!((data->oldumodes ^ source_p->umodes) & user_modes['p'])) if (!((data->oldumodes ^ source_p->umodes) & user_modes['p']))
return; return;
if (!IsOperOverride(source_p))
{
sendto_one_notice(source_p, ":*** You need oper:override privilege for +p");
source_p->umodes &= ~user_modes['p'];
return;
}
if (source_p->umodes & user_modes['p']) if (source_p->umodes & user_modes['p'])
{ {
if (!IsOperOverride(source_p))
{
sendto_one_notice(source_p, ":*** You need oper:override privilege for +p");
source_p->umodes &= ~user_modes['p'];
return;
}
update_session_deadline(source_p, NULL); update_session_deadline(source_p, NULL);
sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has enabled oper-override (+p)", sendto_realops_snomask(SNO_GENERAL, L_NETWIDE, "%s has enabled oper-override (+p)",