]> jfr.im git - irc/quakenet/newserv.git/blobdiff - trusts/trusts_commands.c
CHANSERV: tell user when they can't attempts to auth any more, and drop max attempts...
[irc/quakenet/newserv.git] / trusts / trusts_commands.c
index 321c124df781b643caf89a0f60a79b03b1e188a3..9fd092d3ad2a57fa41ee092f7e4c1d7c4cfc80be 100644 (file)
@@ -18,7 +18,7 @@ static void deregistercommands(int, void *);
 
 extern void printnick_channels(searchCtx *, nick *, nick *);
 
-void calculatespaces(int spaces, int width, char *str, char **_prebuf, char **_postbuf) {
+void calculatespaces(int spaces, int width, const char *str, char **_prebuf, char **_postbuf) {
   static char prebuf[512], postbuf[512];
   int spacelen;
 
@@ -85,7 +85,8 @@ static void marktree(array *parents, unsigned int marker, trusthost *th, int sho
 }
 
 static void outputtree(nick *np, unsigned int marker, trustgroup *originalgroup, trusthost *th, int depth, int showchildren) {
-  char *cidrstr, *prespacebuf, *postspacebuf, parentbuf[512];
+  const char *cidrstr;
+  char *prespacebuf, *postspacebuf, parentbuf[512];
 
   if(th->marker != marker)
     return;
@@ -146,6 +147,13 @@ static char *formatflags(int flags) {
     strncat(buf, "reliable username", 512);
   }
 
+  if(flags & TRUST_UNTHROTTLE) {
+    if(buf[0])
+      strncat(buf, ", ", 512);
+
+    strncat(buf, "unthrottled", 512);
+  }
+
   buf[512-1] = '\0';
 
   return buf;
@@ -264,17 +272,6 @@ static int trusts_cmdtrustlist(void *source, int cargc, char **cargv) {
   return CMD_OK;
 }
 
-static int comparetgs(const void *_a, const void *_b) {
-  const trustgroup *a = _a;
-  const trustgroup *b = _b;
-
-  if(a->id > b->id)
-    return 1;
-  if(a->id < b-> id)
-    return -1;
-  return 0;
-}
-
 static int trusts_cmdtrustglinesuggest(void *source, int cargc, char **cargv) {
   nick *sender = source;
   char mask[512];
@@ -325,7 +322,7 @@ static int trusts_cmdtrustspew(void *source, int cargc, char **cargv) {
     return CMD_USAGE;
 
   tree = NSASTNode(tgroup_parse, NSASTLiteral(cargv[0]));
-  return ast_nicksearch(&tree, controlreply, sender, NULL, printnick_channels, NULL, NULL, 2000);
+  return ast_nicksearch(&tree, controlreply, sender, NULL, printnick_channels, NULL, NULL, 2000, NULL);
 }
 
 static int commandsregistered;