}
int cs_dospewemail(void *source, int cargc, char **cargv) {
- searchASTExpr *tree;
+ searchASTExpr tree;
- if(cargc < 1)
- return CMD_USAGE;
+ if(cargc < 1) {
+ chanservstdmessage(source, QM_NOTENOUGHPARAMS, "spewemail");
+ return CMD_ERROR;
+ }
cs_log(source, "SPEWEMAIL %s", cargv[0]);
tree = NSASTNode(match_parse, NSASTNode(qemail_parse), NSASTLiteral(cargv[0]));
- return ast_usersearch(tree, chanservmessagewrapper, source, chanservwallwrapper, printauth, showheader, (void *)QM_SPEWHEADER, 2000);
+ return ast_usersearch(&tree, chanservmessagewrapper, source, chanservwallwrapper, printauth, showheader, (void *)QM_SPEWHEADER, 2000, NULL);
}
int cs_dospewdb(void *source, int cargc, char **cargv) {
- searchASTExpr *tree;
+ searchASTExpr tree;
- if(cargc < 1)
- return CMD_USAGE;
+ if(cargc < 1) {
+ chanservstdmessage(source, QM_NOTENOUGHPARAMS, "spewdb");
+ return CMD_ERROR;
+ }
cs_log(source, "SPEWDB %s", cargv[0]);
NSASTNode(match_parse, NSASTNode(qemail_parse), NSASTLiteral(cargv[0])),
NSASTNode(match_parse, NSASTNode(qlasthost_parse), NSASTLiteral(cargv[0])),
);
- return ast_usersearch(tree, chanservmessagewrapper, source, chanservwallwrapper, printauth, showheader, (void *)QM_SPEWHEADER, 2000);
+ return ast_usersearch(&tree, chanservmessagewrapper, source, chanservwallwrapper, printauth, showheader, (void *)QM_SPEWHEADER, 2000, NULL);
}