]>
jfr.im git - irc/quakenet/newserv.git/blob - raw/raw.c
8 #include "../control/control.h"
9 #include "../nick/nick.h"
10 #include "../lib/irc_string.h"
11 #include "../lib/strlfunc.h"
12 #include "../localuser/localuserchannel.h"
13 #include "../lib/version.h"
14 #include "../core/modules.h"
18 int controlraw ( void * sender
, int cargc
, char ** cargv
);
21 registercontrolhelpcmd ( "raw" , NO_DEVELOPER
, 2 , & controlraw
, "Usage: raw <type> <text> \n type is one of client,server,raw \n USE THIS COMMAND WITH CAUTION, YOU WILL MOST LIKELY CORRUPT NEWSERV STATE." );
25 deregistercontrolcmd ( "raw" , controlraw
);
28 int controlraw ( void * sender
, int cargc
, char ** cargv
) {
29 nick
* np
=( nick
*) sender
;
33 controlreply ( sender
, "Sending Raw.. %s " , cargv
[ 1 ]);
34 if ( strcmp ( cargv
[ 0 ], "server" ) == 0 ) {
35 irc_send ( " %s %s " , mynumeric
-> content
, cargv
[ 1 ]);
36 controlwall ( NO_DEVELOPER
, NL_OPERATIONS
, " %s / %s sent SERVER RAW for %s " , np
-> nick
, np
-> authname
, cargv
[ 1 ]);
37 } else if ( strcmp ( cargv
[ 0 ], "client" ) == 0 ) {
38 controlwall ( NO_DEVELOPER
, NL_OPERATIONS
, " %s / %s sent CLIENT RAW for %s " , np
-> nick
, np
-> authname
, cargv
[ 1 ]);
39 irc_send ( " %s %s " , longtonumeric ( mynick
-> numeric
, 5 ), cargv
[ 1 ]);
40 } else if ( strcmp ( cargv
[ 0 ], "raw" ) == 0 ) {
41 controlwall ( NO_DEVELOPER
, NL_OPERATIONS
, " %s / %s sent RAW for %s " , np
-> nick
, np
-> authname
, cargv
[ 1 ]);
42 irc_send ( " %s " , cargv
[ 1 ]);
44 controlreply ( sender
, "Invalid Mode - server or client" );
48 controlreply ( sender
, "RAW sent." );