]> jfr.im git - irc/quakenet/snircd-patchqueue.git/commitdiff
freetargetandsilencecheckafterumodechecks: check +R and +q usermodes first, then...
authorwiebe <redacted>
Wed, 24 Mar 2010 12:04:16 +0000 (13:04 +0100)
committerwiebe <redacted>
Wed, 24 Mar 2010 12:04:16 +0000 (13:04 +0100)
freetargetandsilencecheckafterumodechecks.patch [new file with mode: 0644]
series

diff --git a/freetargetandsilencecheckafterumodechecks.patch b/freetargetandsilencecheckafterumodechecks.patch
new file mode 100644 (file)
index 0000000..0db0632
--- /dev/null
@@ -0,0 +1,55 @@
+check usermode +R first, then +q, and then free target limits and last silence list
+
+dont use a free target when the message is going to be stopped by +R or +q
+dont check target limits and silence list until the end,
+which are probably more costly than +R/+q checks
+
+diff -r a6514af6df3d ircd/ircd_relay.c
+--- a/ircd/ircd_relay.c        Wed Mar 24 12:31:16 2010 +0100
++++ b/ircd/ircd_relay.c        Wed Mar 24 12:59:31 2010 +0100
+@@ -393,10 +393,6 @@
+     send_reply(sptr, ERR_NOSUCHNICK, name);
+     return;
+   }
+-  if ((!IsRealChannelService(acptr) &&
+-       check_target_limit(sptr, acptr, cli_name(acptr), 0)) ||
+-      is_silenced(sptr, acptr))
+-    return;
+   /* ASUKA -- slug
+    * +R check, if target is +R and we're not +r (or opered) then
+@@ -413,6 +409,11 @@
+     return;
+   }
++  if ((!IsRealChannelService(acptr) &&
++       check_target_limit(sptr, acptr, cli_name(acptr), 0)) ||
++      is_silenced(sptr, acptr))
++    return;
++
+   /*
+    * send away message if user away
+    */
+@@ -444,10 +445,6 @@
+   if (0 == (acptr = FindUser(name)))
+     return;
+-  if ((!IsRealChannelService(acptr) && 
+-       check_target_limit(sptr, acptr, cli_name(acptr), 0)) ||
+-      is_silenced(sptr, acptr))
+-    return;
+   /* ASUKA -- slug
+    * +R check, if target is +R and we're not +r (or opered) then
+@@ -460,6 +457,11 @@
+   if (IsCommonChansOnly(acptr) && !IsXtraOp(sptr) && !common_chan_count(acptr, sptr, 1))
+     return;
++  if ((!IsRealChannelService(acptr) && 
++       check_target_limit(sptr, acptr, cli_name(acptr), 0)) ||
++      is_silenced(sptr, acptr))
++    return;
++
+   /*
+    * deliver the message
+    */
diff --git a/series b/series
index cdbce11ed24e15fafe40be28f86b944f50241458..524e18043cd23d0c7fc59d8251a9b3e1dd3fc017 100644 (file)
--- a/series
+++ b/series
@@ -14,6 +14,7 @@ checkoutput.patch
 checkendof.patch
 checkmscheck.patch
 commonchansumode.patch
+freetargetandsilencecheckafterumodechecks.patch
 who-accountid.patch
 centralizemodecccheck.patch
 hiskgline.patch