Add usermode:servnotice priv
This commit is contained in:
parent
4af85fed0a
commit
848df803df
1 changed files with 20 additions and 7 deletions
|
@ -1116,11 +1116,6 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
if(MyConnect(source_p))
|
if(MyConnect(source_p))
|
||||||
{
|
{
|
||||||
source_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
|
source_p->umodes &= ~ConfigFileEntry.oper_only_umodes;
|
||||||
if (!(source_p->umodes & UMODE_SERVNOTICE) && source_p->snomask != 0)
|
|
||||||
{
|
|
||||||
source_p->snomask = 0;
|
|
||||||
showsnomask = true;
|
|
||||||
}
|
|
||||||
source_p->flags &= ~OPER_FLAGS;
|
source_p->flags &= ~OPER_FLAGS;
|
||||||
|
|
||||||
rb_dlinkFindDestroy(source_p, &local_oper_list);
|
rb_dlinkFindDestroy(source_p, &local_oper_list);
|
||||||
|
@ -1158,8 +1153,8 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
case 's':
|
case 's':
|
||||||
if (MyConnect(source_p))
|
if (MyConnect(source_p))
|
||||||
{
|
{
|
||||||
if(!IsOper(source_p)
|
if((ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE) &&
|
||||||
&& (ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE))
|
(!IsOper(source_p) || !HasPrivilege(source_p, "usermode:servnotice")))
|
||||||
{
|
{
|
||||||
if (what == MODE_ADD || source_p->umodes & UMODE_SERVNOTICE)
|
if (what == MODE_ADD || source_p->umodes & UMODE_SERVNOTICE)
|
||||||
badflag = true;
|
badflag = true;
|
||||||
|
@ -1218,6 +1213,18 @@ user_mode(struct Client *client_p, struct Client *source_p, int parc, const char
|
||||||
if(badflag)
|
if(badflag)
|
||||||
sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, source_p->name);
|
sendto_one(source_p, form_str(ERR_UMODEUNKNOWNFLAG), me.name, source_p->name);
|
||||||
|
|
||||||
|
if(MyClient(source_p))
|
||||||
|
{
|
||||||
|
if ((ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE) &&
|
||||||
|
!HasPrivilege(source_p, "usermode:servnotice"))
|
||||||
|
source_p->umodes &= ~UMODE_SERVNOTICE;
|
||||||
|
if (!(source_p->umodes & UMODE_SERVNOTICE) && source_p->snomask != 0)
|
||||||
|
{
|
||||||
|
source_p->snomask = 0;
|
||||||
|
showsnomask = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if(MyClient(source_p) && (source_p->snomask & SNO_NCHANGE) && !IsOperN(source_p))
|
if(MyClient(source_p) && (source_p->snomask & SNO_NCHANGE) && !IsOperN(source_p))
|
||||||
{
|
{
|
||||||
sendto_one_notice(source_p, ":*** You need oper and nick_changes flag for +s +n");
|
sendto_one_notice(source_p, ":*** You need oper and nick_changes flag for +s +n");
|
||||||
|
@ -1437,6 +1444,12 @@ oper_up(struct Client *source_p, struct oper_conf *oper_p)
|
||||||
source_p->snomask &= ~SNO_NCHANGE;
|
source_p->snomask &= ~SNO_NCHANGE;
|
||||||
if(!IsOperOperwall(source_p))
|
if(!IsOperOperwall(source_p))
|
||||||
source_p->umodes &= ~UMODE_OPERWALL;
|
source_p->umodes &= ~UMODE_OPERWALL;
|
||||||
|
if((ConfigFileEntry.oper_only_umodes & UMODE_SERVNOTICE) &&
|
||||||
|
!HasPrivilege(source_p, "usermode:servnotice"))
|
||||||
|
{
|
||||||
|
source_p->umodes &= ~UMODE_SERVNOTICE;
|
||||||
|
source_p->snomask = 0;
|
||||||
|
}
|
||||||
hdata.client = source_p;
|
hdata.client = source_p;
|
||||||
hdata.oldumodes = old;
|
hdata.oldumodes = old;
|
||||||
hdata.oldsnomask = oldsnomask;
|
hdata.oldsnomask = oldsnomask;
|
||||||
|
|
Loading…
Reference in a new issue