X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=ircd%2Fs_numeric.c;h=333d0f007f55c9a79dc47f9dafeb9c5f4c2f4280;hb=refs%2Fheads%2Fupstream;hp=8d9602be122bbdd4216e6f7a8900f53ba7ab8978;hpb=284b39b15f53f438c7f1a28e7e3a10e2e25bac3b;p=ircu2.10.12-pk.git diff --git a/ircd/s_numeric.c b/ircd/s_numeric.c index 8d9602b..333d0f0 100644 --- a/ircd/s_numeric.c +++ b/ircd/s_numeric.c @@ -17,8 +17,10 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - * - * $Id$ + */ +/** @file + * @brief Send a numeric message to a client. + * @version $Id$ */ #include "config.h" @@ -27,7 +29,7 @@ #include "client.h" #include "hash.h" #include "ircd.h" -#include "ircd_policy.h" +#include "ircd_features.h" #include "ircd_snprintf.h" #include "numnicks.h" #include "send.h" @@ -41,9 +43,18 @@ * Called when we get a numeric message from a remote _server_ and we are * supposed to forward it somewhere. Note that we always ignore numerics sent * to 'me' and simply drop the message if we can't handle with this properly: - * the savy approach is NEVER generate an error in response to an... error :) + * the savvy approach is NEVER generate an error in response to an... error :) */ +/** Forwards a numeric message from a remote server. + * @param numeric Value of numeric message. + * @param nnn If non-zero, treat parv[1] as a numnick; else as a client name. + * @param cptr Client that originated the numeric. + * @param sptr Peer that sent us the numeric. + * @param parc Count of valid arguments in \a parv. + * @param parv Argument list. + * @return Zero (always). + */ int do_numeric(int numeric, int nnn, struct Client *cptr, struct Client *sptr, int parc, char *parv[]) { @@ -79,28 +90,16 @@ int do_numeric(int numeric, int nnn, struct Client *cptr, struct Client *sptr, ircd_snprintf(0, num, sizeof(num), "%03d", numeric); -#ifdef HEAD_IN_SAND_REWRITE /* Since 2.10.10.pl14 we rewrite numerics from remote servers to appear to * come from the local server */ - if (IsOper(acptr)) { -#endif - if (acptr) - sendcmdto_one(sptr, num, num, acptr, "%C %s", acptr, parv[2]); - else - sendcmdto_channel_butone(sptr, num, num, achptr, cptr, - SKIP_DEAF | SKIP_BURST, "%H %s", achptr, - parv[2]); -#ifdef HEAD_IN_SAND_REWRITE - } else { - if (acptr) - sendcmdto_one(&me, num, num, acptr, "%C %s", acptr, parv[2]); - else - sendcmdto_channel_butone(&me, num, num, achptr, cptr, - SKIP_DEAF | SKIP_BURST, "%H %s", achptr, - parv[2]); - } -#endif - + if (acptr) + sendcmdto_one((feature_bool(FEAT_HIS_REWRITE) && !IsOper(acptr)) ? + &me : sptr, + num, num, acptr, "%C %s", acptr, parv[2]); + else + sendcmdto_channel_butone(feature_bool(FEAT_HIS_REWRITE) ? &me : sptr, + num, num, achptr, cptr, SKIP_DEAF | SKIP_BURST, + "%H %s", achptr, parv[2]); return 0; }