]> jfr.im git - irc/quakenet/snircd-patchqueue.git/blobdiff - commonchansumode.patch
opername: prefix jupe reasons with the oper's opername
[irc/quakenet/snircd-patchqueue.git] / commonchansumode.patch
index a7a4d3837f49d1224df7c652b4b8f8f1ae0881b8..5cfbd69f4fa9da90ce5e24c5b0243d1ce872116a 100644 (file)
@@ -2,19 +2,19 @@ Add usermode +q which requires users /msg'ing or /notice'ing you to be in at lea
 This is designed to stop the spam bots which sit outside a channel, while a spy sits inside, preventing channel operators dealing with the problem.
 We currently also block invites, this might not be such a good idea, but these days everyone can get Q.
 
-diff -r 4296495df0fb include/channel.h
---- a/include/channel.h        Mon Jan 12 18:07:52 2009 +0100
-+++ b/include/channel.h        Mon Jan 12 18:14:16 2009 +0100
-@@ -462,5 +462,6 @@
+diff -r 3825aab95440 include/channel.h
+--- a/include/channel.h        Mon Aug 10 14:18:18 2009 +0100
++++ b/include/channel.h        Mon Aug 10 14:18:25 2009 +0100
+@@ -463,5 +463,6 @@
  extern void free_ban(struct Ban *ban);
  
  extern unsigned int get_channel_marker(void);
 +extern int common_chan_count(struct Client *a, struct Client *b, int max);
  
  #endif /* INCLUDED_channel_h */
-diff -r 4296495df0fb include/client.h
---- a/include/client.h Mon Jan 12 18:07:52 2009 +0100
-+++ b/include/client.h Mon Jan 12 18:14:16 2009 +0100
+diff -r 3825aab95440 include/client.h
+--- a/include/client.h Mon Aug 10 14:18:18 2009 +0100
++++ b/include/client.h Mon Aug 10 14:18:25 2009 +0100
 @@ -90,7 +90,7 @@
  #define FlagClr(set,flag) ((set)->bits[FLAGSET_INDEX(flag)] &= ~FLAGSET_MASK(flag))
  
@@ -24,7 +24,7 @@ diff -r 4296495df0fb include/client.h
  
  /** Character to indicate no oper name available */
  #define NOOPERNAMECHARACTER '-'
-@@ -192,7 +192,8 @@
+@@ -194,7 +194,8 @@
      FLAG_NOIDLE,                    /**< user's idletime is hidden */
      FLAG_XTRAOP,                    /**< oper has special powers */
      FLAG_OPERNAME,                  /**< Server sends oper name in mode string */
@@ -34,7 +34,7 @@ diff -r 4296495df0fb include/client.h
      FLAG_LAST_FLAG,                 /**< number of flags */
      FLAG_LOCAL_UMODES = FLAG_LOCOP, /**< First local mode flag */
      FLAG_GLOBAL_UMODES = FLAG_OPER  /**< First global mode flag */
-@@ -622,6 +623,8 @@
+@@ -626,6 +627,8 @@
  #define IsParanoid(x)           HasFlag(x, FLAG_PARANOID)
  /** Return non-zero if the server should send opername information */
  #define IsSendOperName(x)         HasFlag(x, FLAG_OPERNAME)
@@ -43,7 +43,7 @@ diff -r 4296495df0fb include/client.h
  
  /** Return non-zero if the client has operator or server privileges. */
  #define IsPrivileged(x)         (IsAnOper(x) || IsServer(x))
-@@ -685,6 +688,8 @@
+@@ -689,6 +692,8 @@
  #define SetAccountOnly(x)       SetFlag(x, FLAG_ACCOUNTONLY)
  /** Mark a client as having mode +P (paranoid). */
  #define SetParanoid(x)          SetFlag(x, FLAG_PARANOID)
@@ -52,7 +52,7 @@ diff -r 4296495df0fb include/client.h
  
  /** Return non-zero if \a sptr sees \a acptr as an operator. */
  #define SeeOper(sptr,acptr) (IsAnOper(acptr) && (HasPriv(acptr, PRIV_DISPLAY) \
-@@ -730,6 +735,8 @@
+@@ -736,6 +741,8 @@
  #define ClearAccountOnly(x)     ClrFlag(x, FLAG_ACCOUNTONLY)
  /** Remove mode +P (paranoid) from a client */
  #define ClearParanoid(x)        ClrFlag(x, FLAG_PARANOID)
@@ -61,10 +61,10 @@ diff -r 4296495df0fb include/client.h
  
  /* free flags */
  #define FREEFLAG_SOCKET       0x0001  /**< socket needs to be freed */
-diff -r 4296495df0fb include/numeric.h
---- a/include/numeric.h        Mon Jan 12 18:07:52 2009 +0100
-+++ b/include/numeric.h        Mon Jan 12 18:14:16 2009 +0100
-@@ -420,6 +420,7 @@
+diff -r 3825aab95440 include/numeric.h
+--- a/include/numeric.h        Mon Aug 10 14:18:18 2009 +0100
++++ b/include/numeric.h        Mon Aug 10 14:18:25 2009 +0100
+@@ -421,6 +421,7 @@
  /*    ERR_HTMDISABLED      486           unreal */
  #define ERR_ACCOUNTONLY      486      /* QuakeNet/ASUKA extension */
  /*      ERR_CHANTOORECENT    487           IRCnet extension (?) */
@@ -72,10 +72,10 @@ diff -r 4296495df0fb include/numeric.h
  /*      ERR_TSLESSCHAN       488           IRCnet extension (?) */
  #define ERR_VOICENEEDED      489        /* Undernet extension */
  
-diff -r 4296495df0fb ircd/channel.c
---- a/ircd/channel.c   Mon Jan 12 18:07:52 2009 +0100
-+++ b/ircd/channel.c   Mon Jan 12 18:14:16 2009 +0100
-@@ -3801,3 +3801,39 @@
+diff -r 3825aab95440 ircd/channel.c
+--- a/ircd/channel.c   Mon Aug 10 14:18:18 2009 +0100
++++ b/ircd/channel.c   Mon Aug 10 14:18:25 2009 +0100
+@@ -3804,3 +3804,39 @@
  
    return marker;
  }
@@ -115,10 +115,10 @@ diff -r 4296495df0fb ircd/channel.c
 +
 +  return count;
 +}
-diff -r 4296495df0fb ircd/ircd_relay.c
---- a/ircd/ircd_relay.c        Mon Jan 12 18:07:52 2009 +0100
-+++ b/ircd/ircd_relay.c        Mon Jan 12 18:14:17 2009 +0100
-@@ -308,6 +308,10 @@
+diff -r 3825aab95440 ircd/ircd_relay.c
+--- a/ircd/ircd_relay.c        Mon Aug 10 14:18:18 2009 +0100
++++ b/ircd/ircd_relay.c        Mon Aug 10 14:18:25 2009 +0100
+@@ -309,6 +309,10 @@
    if (IsAccountOnly(acptr) && !IsAccount(sptr) && !IsXtraOp(sptr))
      return;
  
@@ -129,7 +129,7 @@ diff -r 4296495df0fb ircd/ircd_relay.c
    if (!(is_silenced(sptr, acptr)))
      sendcmdto_one(sptr, CMD_PRIVATE, acptr, "%s :%s", name, text);
  }
-@@ -360,6 +364,9 @@
+@@ -361,6 +365,9 @@
    if (IsAccountOnly(acptr) && !IsAccount(sptr) && !IsXtraOp(sptr))
      return;
  
@@ -139,31 +139,31 @@ diff -r 4296495df0fb ircd/ircd_relay.c
    if (!(is_silenced(sptr, acptr)))
      sendcmdto_one(sptr, CMD_NOTICE, acptr, "%s :%s", name, text);
  }
-@@ -396,6 +403,11 @@
+@@ -400,6 +407,11 @@
+     return;
+   }
  
-   if (IsAccountOnly(acptr) && !IsAccount(sptr) && !IsXtraOp(sptr)) {
-     send_reply(sptr, ERR_ACCOUNTONLY, cli_name(acptr), feature_str(FEAT_URLREG));
++  if (IsCommonChansOnly(acptr) && !IsXtraOp(sptr) && !common_chan_count(acptr, sptr, 1)) {
++    send_reply(sptr, ERR_COMMONCHANSONLY, cli_name(acptr));
 +    return;
 +  }
 +
-+  if (IsCommonChansOnly(acptr) && !IsXtraOp(sptr) && !common_chan_count(acptr, sptr, 1)) {
-+    send_reply(sptr, ERR_COMMONCHANSONLY, cli_name(acptr));
-     return;
-   }
-@@ -441,6 +453,9 @@
+   /*
+    * send away message if user away
     */
+@@ -444,6 +456,9 @@
    if (IsAccountOnly(acptr) && !IsAccount(sptr) && !IsXtraOp(sptr))
-+    return;
-+
-+  if (IsCommonChansOnly(acptr) && !IsXtraOp(sptr) && !common_chan_count(acptr, sptr, 1))
      return;
  
++  if (IsCommonChansOnly(acptr) && !IsXtraOp(sptr) && !common_chan_count(acptr, sptr, 1))
++    return;
++
    /*
-diff -r 4296495df0fb ircd/m_invite.c
---- a/ircd/m_invite.c  Mon Jan 12 18:07:52 2009 +0100
-+++ b/ircd/m_invite.c  Mon Jan 12 18:14:17 2009 +0100
+    * deliver the message
+    */
+diff -r 3825aab95440 ircd/m_invite.c
+--- a/ircd/m_invite.c  Mon Aug 10 14:18:18 2009 +0100
++++ b/ircd/m_invite.c  Mon Aug 10 14:18:25 2009 +0100
 @@ -171,6 +171,9 @@
      return 0;
    }
@@ -174,9 +174,9 @@ diff -r 4296495df0fb ircd/m_invite.c
    if (check_target_limit(sptr, acptr, cli_name(acptr), 0))
      return 0;
  
-diff -r 4296495df0fb ircd/s_err.c
---- a/ircd/s_err.c     Mon Jan 12 18:07:52 2009 +0100
-+++ b/ircd/s_err.c     Mon Jan 12 18:14:17 2009 +0100
+diff -r 3825aab95440 ircd/s_err.c
+--- a/ircd/s_err.c     Mon Aug 10 14:18:18 2009 +0100
++++ b/ircd/s_err.c     Mon Aug 10 14:18:25 2009 +0100
 @@ -1006,7 +1006,7 @@
  /* 486 */
    { ERR_ACCOUNTONLY, "%s :You must be authed in order to message this user -- For details of how to obtain an account visit %s", "486" },
@@ -186,9 +186,9 @@ diff -r 4296495df0fb ircd/s_err.c
  /* 488 */
    { 0 },
  /* 489 */
-diff -r 4296495df0fb ircd/s_user.c
---- a/ircd/s_user.c    Mon Jan 12 18:07:52 2009 +0100
-+++ b/ircd/s_user.c    Mon Jan 12 18:14:17 2009 +0100
+diff -r 3825aab95440 ircd/s_user.c
+--- a/ircd/s_user.c    Mon Aug 10 14:18:18 2009 +0100
++++ b/ircd/s_user.c    Mon Aug 10 14:18:25 2009 +0100
 @@ -546,7 +546,8 @@
    { FLAG_NOCHAN,      'n' },
    { FLAG_NOIDLE,      'I' },
@@ -199,8 +199,8 @@ diff -r 4296495df0fb ircd/s_user.c
  };
  
  /** Length of #userModeList. */
-@@ -856,7 +857,9 @@
-       send_reply(source, ERR_ACCOUNTONLY, cli_name(source), feature_str(FEAT_URLREG));
+@@ -857,7 +858,9 @@
+       send_reply(source, ERR_ACCOUNTONLY, cli_name(dest), feature_str(FEAT_URLREG));
      return 0;
    }
 -          
@@ -210,16 +210,16 @@ diff -r 4296495df0fb ircd/s_user.c
    if (is_notice)
      sendcmdto_one(source, CMD_NOTICE, dest, "%C :%s", dest, text);
    else
-@@ -1427,6 +1430,12 @@
-           SetParanoid(sptr);
+@@ -1429,6 +1432,12 @@
          else
            ClearParanoid(sptr);
-+      break;
+       break;
 +      case 'q':
 +      if (what == MODE_ADD)
 +          SetCommonChansOnly(sptr);
 +        else
 +          ClearCommonChansOnly(sptr);
-       break;
++      break;
        case 'r':
        if ((what == MODE_ADD) && *(p + 1)) {
+         account = *(++p);