]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Merge throttle.
authorGunnar Beutner <redacted>
Mon, 12 Aug 2013 22:45:38 +0000 (00:45 +0200)
committerGunnar Beutner <redacted>
Mon, 12 Aug 2013 22:45:38 +0000 (00:45 +0200)
1  2 
trusts/trusts_commands.c
trusts/trusts_management.c

diff --combined trusts/trusts_commands.c
index c3a31028d7a8e3594edf28a31ab6f305de05e095,820a4a600ac9b1c66236f10a7752542598fc0a77..9fd092d3ad2a57fa41ee092f7e4c1d7c4cfc80be
@@@ -147,6 -147,13 +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;
@@@ -315,7 -322,7 +322,7 @@@ static int trusts_cmdtrustspew(void *so
      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;
index 387f6f80b4d52ea5ed2ca9f65c49e852a6345a6a,8aaa56840908e049def24ded3e05a43efb5b9896..4520fb5af633f09ff8db9a03bc1d3d0d6e2c89ca
@@@ -8,8 -8,8 +8,8 @@@
  #include "../core/schedule.h"
  #include "../irc/irc.h"
  #include "../lib/stringbuf.h"
 -#include "../noperserv/noperserv.h"
 -#include "../noperserv/noperserv_policy.h"
 +#include "../control/control.h"
 +#include "../control/control_policy.h"
  #include "trusts.h"
  
  MODULE_VERSION("");
@@@ -401,6 -401,20 +401,20 @@@ static int modifyreliableusername(void 
    return 1;
  }
  
+ static int modifyunthrottle(void *arg, char *num, nick *source, int override) {
+   trustgroup *tg = arg;
+   if(num[0] == '1') {
+     tg->flags |= TRUST_UNTHROTTLE;
+   } else if(num[0] == '0') {
+     tg->flags &= ~TRUST_UNTHROTTLE;
+   } else {
+     return 0;
+   }
+   return 1;
+ }
  static int modifyexpires(void *arg, char *expires, nick *source, int override) {
    trustgroup *tg = arg;
    int howlong = durationtolong(expires);
@@@ -803,6 -817,7 +817,7 @@@ static void setupmods(void) 
    MSGROUP(trustedfor);
    MSGROUP(cleanup);
    MSGROUP(protected);
+   MSGROUP(unthrottle);
  
    MSHOST(maxpernode);
    MSHOST(nodebits);