#include "dynamic.h"
#include "wildcard.h"
#include "message.h"
+#include "commands.h"
+#include "xline.h"
using namespace std;
log(DEFAULT,"*** BUG *** give_ops was given an invalid parameter");
return 0;
}
- if (status < STATUS_OP)
+ if ((status < STATUS_OP) && (!is_uline(user->server)))
{
log(DEBUG,"%s cant give ops to %s because they nave status %d and needs %d",user->nick,dest,status,STATUS_OP);
WriteServ(user->fd,"482 %s %s :You're not a channel operator",user->nick, chan->name);
log(DEFAULT,"*** BUG *** give_hops was given an invalid parameter");
return 0;
}
- if (status != STATUS_OP)
+ if ((status < STATUS_OP) && (!is_uline(user->server)))
{
WriteServ(user->fd,"482 %s %s :You're not a channel operator",user->nick, chan->name);
return 0;
log(DEFAULT,"*** BUG *** give_voice was given an invalid parameter");
return 0;
}
- if (status < STATUS_HOP)
+ if ((status < STATUS_HOP) && (!is_uline(user->server)))
{
WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, chan->name);
return 0;
log(DEFAULT,"*** BUG *** take_ops was given an invalid parameter");
return 0;
}
- if (status < STATUS_OP)
+ if ((status < STATUS_OP) && (!is_uline(user->server)))
{
log(DEBUG,"%s cant give ops to %s because they have status %d and needs %d",user->nick,dest,status,STATUS_OP);
WriteServ(user->fd,"482 %s %s :You're not a channel operator",user->nick, chan->name);
log(DEFAULT,"*** BUG *** take_hops was given an invalid parameter");
return 0;
}
- if (status != STATUS_OP)
+ if ((status < STATUS_OP) && (!is_uline(user->server)))
{
WriteServ(user->fd,"482 %s %s :You're not a channel operator",user->nick, chan->name);
return 0;
log(DEFAULT,"*** BUG *** take_voice was given an invalid parameter");
return 0;
}
- if (status < STATUS_HOP)
+ if ((status < STATUS_HOP) && (!is_uline(user->server)))
{
WriteServ(user->fd,"482 %s %s :You must be at least a half-operator to change modes on this channel",user->nick, chan->name);
return 0;
break;
chan->limit = atoi(parameters[param]);
+
+ // reported by mech: large values cause underflow
+ if (chan->limit < 0)
+ chan->limit = MAXINT;
+
if (chan->limit)
{
strcat(outlist,"l");
Ptr = FindChan(parameters[0]);
if (Ptr)
{
- if ((cstatus(user,Ptr) < STATUS_HOP) && (Ptr))
+ log(DEBUG,"merge_mode2: found channel %s",Ptr->name);
+ if (Ptr)
{
- return;
+ if ((cstatus(user,Ptr) < STATUS_HOP) && (!is_uline(user->server)))
+ {
+ return;
+ }
+ process_modes(parameters,user,Ptr,cstatus(user,Ptr),pcnt,false,false,true);
}
-
- process_modes(parameters,user,Ptr,cstatus(user,Ptr),pcnt,false,false,true);
}
}