]> jfr.im git - irc/quakenet/newserv.git/commitdiff
Fix policy enforcement message for TGs exceeding their clone limit.
authorGunnar Beutner <redacted>
Wed, 26 Jun 2013 15:32:15 +0000 (17:32 +0200)
committerGunnar Beutner <redacted>
Wed, 26 Jun 2013 15:32:15 +0000 (17:32 +0200)
--HG--
branch : shroudtrusts

trusts/trusts_policy.c

index 2f318af3ecf24f6fcd762ca6d40a5e4de768a5df..e394f91f7141aebad091eeef0185ff12a649dc24 100644 (file)
@@ -106,10 +106,10 @@ static int checkconnectionth(const char *username, struct irc_in_addr *ip, trust
 
         controlwall(NO_OPER, NL_TRUSTS, "Hard connection limit exceeded (group %s): %d connected, %d max.", tg->name->content, tg->count + usercountadjustment, tg->trustedfor);
         snprintf(message, messagelen, "Too many connections from your trust (%s) - see http://www.quakenet.org/help/trusts/connection-limit for details.", IPtostr(*ip));
-        return POLICY_FAILURE_GROUPCOUNT;
       }
-      
-      snprintf(message, messagelen, "Trust has %d out of %d allowed connections.", tg->count + usercountadjustment, tg->trustedfor);
+
+      snprintf(message, messagelen, "Too many connections from your trust (%s) - see http://www.quakenet.org/help/trusts/connection-limit for details.", IPtostr(*ip));
+      return POLICY_FAILURE_GROUPCOUNT;
     }
 
     if((tg->flags & TRUST_ENFORCE_IDENT) && (username[0] == '~')) {
@@ -141,6 +141,9 @@ static int checkconnectionth(const char *username, struct irc_in_addr *ip, trust
       tg->exts[countext] = (void *)(long)tg->count;
   }
 
+  if(tg->trustedfor > 0)
+    snprintf(message, messagelen, "Trust has %d out of %d allowed connections.", tg->count + usercountadjustment, tg->trustedfor);
+
   return POLICY_SUCCESS;
 }