+2001-06-25 Kevin L. Mitchell <klmitch@mit.edu>
+
+ * ircd/whocmds.c: include ircd_policy.h and implement
+ HEAD_IN_SAND_WHO_OPCOUNT--forward-port from pl15
+
+ * ircd/m_whois.c: forward-port of the idle-time hiding code from
+ pl15; this also required passing parc into do_whois(), which also
+ meant passing parc into do_wilds()--*sigh*
+
+ * include/ircd_policy.h: add a couple more HEAD_IN_SAND
+ #define's--WHOIS_IDLETIME and WHO_HOPCOUNT
+
2001-06-22 Kevin L. Mitchell <klmitch@mit.edu>
* tools/wrapper.c: add a wrapper program that can be used to
* braindead and silly. These aren't configurable as they are network
* policy, and should not be changed (depending on what network your
* on different ones of these should be defined
+ *
+ * If you want nothing to do with any of this nonsense, add the line
+ * #define INCLUDED_ircd_policy_h
+ * *above* the #ifndef above.
*/
/* CFV-165 - Hiding Nonessential information from non-opers
*/
#define HEAD_IN_SAND_WHOIS_SERVERNAME
+#define HEAD_IN_SAND_WHOIS_IDLETIME
#define HEAD_IN_SAND_WHO_SERVERNAME
+#define HEAD_IN_SAND_WHO_HOPCOUNT
/* CFV-165 - Hiding Nonessential information from non-opers
*
/*
* Send whois information for acptr to sptr
*/
-static void do_whois(struct Client* sptr, struct Client *acptr)
+static void do_whois(struct Client* sptr, struct Client *acptr, int parc)
{
struct Client *a2cptr=0;
struct Channel *chptr=0;
* probably a good place to add them :)
*/
- if (MyConnect(acptr))
+ if (MyConnect(acptr)
+#ifdef HEAD_IN_SAND_WHOIS_IDLETIME
+ && (sptr == acptr || IsAnOper(sptr) || parc >= 3)
+#endif
+ )
send_reply(sptr, RPL_WHOISIDLE, name, CurrentTime - user->last,
cli_firsttime(acptr));
}
* returns the number of people found (or, obviously, 0, if none where
* found).
*/
-static int do_wilds(struct Client* sptr,char *nick,int count)
+static int do_wilds(struct Client* sptr, char *nick, int count, int parc)
{
struct Client *acptr; /* Current client we're concidering */
struct User *user; /* the user portion of the client */
/* Should we show this person now? */
if (showperson) {
found++;
- do_whois(sptr,acptr);
+ do_whois(sptr, acptr, parc);
if (count+found>MAX_WHOIS_LINES)
return found;
continue;
if (!showperson)
continue;
- do_whois(sptr,acptr);
+ do_whois(sptr, acptr, parc);
found++;
if (count+found>MAX_WHOIS_LINES)
return found;
/* No wildcards */
acptr = FindUser(nick);
if (acptr && !IsServer(acptr)) {
- do_whois(sptr,acptr);
+ do_whois(sptr, acptr, parc);
found = 1;
}
}
else /* wilds */
- found=do_wilds(sptr,nick,total);
+ found=do_wilds(sptr, nick, total, parc);
if (!found)
send_reply(sptr, ERR_NOSUCHNICK, nick);
acptr = FindUser(nick);
if (acptr && !IsServer(acptr)) {
found++;
- do_whois(sptr,acptr);
+ do_whois(sptr, acptr, parc);
}
if (!found)
#include "hash.h"
#include "ircd.h"
#include "ircd_chattr.h"
+#include "ircd_policy.h"
#include "ircd_reply.h"
#include "ircd_string.h"
#include "list.h"
*p1++ = ' ';
if (!fields)
*p1++ = ':'; /* Place colon here for default reply */
+#ifdef HEAD_IN_SAND_WHO_HOPCOUNT
+ strcat(p1, sptr == acptr ? "0" : "3");
+ p1++;
+#else
p1 = sprintf_irc(p1, "%d", cli_hopcount(acptr));
+#endif
}
if (fields & WHO_FIELD_IDL)