From 443016b4f2fccca39755c1d7e33edfe1ec61718f Mon Sep 17 00:00:00 2001 From: brain Date: Thu, 22 Apr 2004 13:55:16 +0000 Subject: Added tons of services/uline stuff. DO NOT USE YET! services data isnt replicated across the network! git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@688 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/mode.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'src/mode.cpp') diff --git a/src/mode.cpp b/src/mode.cpp index 3458cab28..38756ffcf 100644 --- a/src/mode.cpp +++ b/src/mode.cpp @@ -32,6 +32,7 @@ #include "dynamic.h" #include "wildcard.h" #include "message.h" +#include "commands.h" using namespace std; @@ -64,7 +65,7 @@ int give_ops(userrec *user,char *dest,chanrec *chan,int status) 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); @@ -119,7 +120,7 @@ int give_hops(userrec *user,char *dest,chanrec *chan,int status) 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; @@ -169,7 +170,7 @@ int give_voice(userrec *user,char *dest,chanrec *chan,int status) 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; @@ -219,7 +220,7 @@ int take_ops(userrec *user,char *dest,chanrec *chan,int status) 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); @@ -273,7 +274,7 @@ int take_hops(userrec *user,char *dest,chanrec *chan,int status) 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; @@ -323,7 +324,7 @@ int take_voice(userrec *user,char *dest,chanrec *chan,int status) 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; @@ -1723,12 +1724,15 @@ void merge_mode2(char **parameters, int pcnt, userrec* user) 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); } } -- cgit v1.2.3