X-Git-Url: https://git.netwichtig.de/gitweb/?a=blobdiff_plain;f=src%2Fcmd_notice.cpp;h=6a9af4a4046c055d1c6d36cb3a4b562ab9c200ed;hb=84a19a9ab6129deb71cdc24b216b74dd8eb80978;hp=1adb43923004829673ea243f73ed19f6cc434ea6;hpb=ced58c3be3f1da8dcf70c3904e5fe4bdaabf0e3d;p=user%2Fhenk%2Fcode%2Finspircd.git diff --git a/src/cmd_notice.cpp b/src/cmd_notice.cpp index 1adb43923..6a9af4a40 100644 --- a/src/cmd_notice.cpp +++ b/src/cmd_notice.cpp @@ -14,39 +14,19 @@ * --------------------------------------------------- */ -using namespace std; - -#include "inspircd_config.h" -#include "inspircd.h" -#include "inspircd_io.h" -#include -#include -#ifdef GCC3 -#include -#else -#include -#endif #include #include #include #include +#include "configreader.h" +#include "hash_map.h" #include "users.h" -#include "ctables.h" -#include "globals.h" #include "modules.h" -#include "dynamic.h" -#include "wildcard.h" #include "message.h" +#include "wildcard.h" #include "commands.h" -#include "mode.h" -#include "xline.h" -#include "inspstring.h" -#include "dnsqueue.h" #include "helperfuncs.h" #include "hashcomp.h" -#include "socketengine.h" -#include "typedefs.h" -#include "command_parse.h" #include "cmd_notice.h" extern ServerConfig* Config; @@ -55,11 +35,6 @@ extern int MODCOUNT; extern std::vector modules; extern std::vector factory; extern time_t TIME; -extern user_hash clientlist; -extern chan_hash chanlist; -extern std::vector all_opers; -extern std::vector local_users; -extern userrec* fd_ref_table[MAX_DESCRIPTORS]; void cmd_notice::Handle (char **parameters, int pcnt, userrec *user) { @@ -70,7 +45,7 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user) if (ServerInstance->Parser->LoopCall(this,parameters,pcnt,user,0,pcnt-2,0)) return; - if (parameters[0][0] == '$') + if ((parameters[0][0] == '$') && (*user->oper)) { // notice to server mask char* servermask = parameters[0]; @@ -115,11 +90,11 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user) } parameters[1] = (char*)temp.c_str(); - if (temp == "") - { - WriteServ(user->fd,"412 %s No text to send", user->nick); - return; - } + if (temp == "") + { + WriteServ(user->fd,"412 %s No text to send", user->nick); + return; + } ChanExceptSender(chan, user, status, "NOTICE %s :%s", chan->name, parameters[1]); @@ -159,5 +134,3 @@ void cmd_notice::Handle (char **parameters, int pcnt, userrec *user) WriteServ(user->fd,"401 %s %s :No such nick/channel",user->nick, parameters[0]); } } - -