]>
jfr.im git - irc/quakenet/newserv.git/blob - trusts_newsearch/trusts_searchcommands.c
1 #include "trusts_newsearch.h"
2 #include "../newsearch/newsearch.h"
4 static void tsnsmessagewrapper(nick
*np
, char *format
, ...) {
9 vsnprintf(buf
, sizeof(buf
), format
, ap
);
12 controlreply(np
, "%s", buf
);
15 static void tsnswallwrapper(int level
, char *format
, ...) {
20 vsnprintf(buf
, sizeof(buf
), format
, ap
);
23 controlwall(NO_OPER
, level
, "%s", buf
);
26 int tsns_dotrustlist(void *source
, int cargc
, char **cargv
) {
28 searchASTExpr nodes
[2];
31 controlreply(source
,"Syntax: trustlist <#groupid>");
35 if(cargv
[0][0]== '#'){
36 tree
= NSASTNode(eq_parse
, NSASTNode(tsns_tgid_parse
), NSASTLiteral(&cargv
[0][1]));
38 tree
= NSASTNode(eq_parse
, NSASTNode(tsns_tgid_parse
), NSASTLiteral(cargv
[0]));
41 // nodes[0] = NSASTNode(tsns_tgid_parse);
42 // nodes[1] = cargv[0];
44 // NSASTManualNode(eq_parse, 2, nodes
46 return ast_tgsearch(&tree
, tsnsmessagewrapper
, source
, tsnswallwrapper
, printtgfull
, NULL
, NULL
, 1);
49 int tsns_dotrustdenylist(void *source
, int cargc
, char **cargv
) {
52 tree
= NSASTNode(gt_parse
, NSASTNode(tsns_tbid_parse
), NSASTLiteral("0"));
54 if(cargc
== 1){ /* just assume -private */
55 return ast_nodesearch(&tree
, tsnsmessagewrapper
, source
, tsnswallwrapper
, printtrust_blockprivate
, NULL
, NULL
, 500);
57 return ast_nodesearch(&tree
, tsnsmessagewrapper
, source
, tsnswallwrapper
, printtrust_block
, NULL
, NULL
, 500);