diff --git a/Changes b/Changes
index 67a4876bc..e31d3ca6b 100644
--- a/Changes
+++ b/Changes
@@ -1992,3 +1992,5 @@ seen. gmtime warning still there
- (Hopefully) fixed some Ziplinks problems
- Added missing except tkl {} documentation
- Documentation update and cleanup
+- Added umode +p (hide channels in whois). For opers, channels are shown as "!#chan" to indicate
+ that the user is +p and the channel is only shown because you are an oper.
diff --git a/doc/unreal32docs.html b/doc/unreal32docs.html
index 96eb88661..2f9876dca 100644
--- a/doc/unreal32docs.html
+++ b/doc/unreal32docs.html
@@ -2018,6 +2018,10 @@ Set {
W |
Lets you see when people do a /whois on you (IRCops Only) |
+
+ p |
+ Hides the channels you are in in a /whois reply |
+
6 – User & Oper Commands Table
diff --git a/include/h.h b/include/h.h
index b091db40a..14558c7fc 100644
--- a/include/h.h
+++ b/include/h.h
@@ -429,7 +429,7 @@ extern long UMODE_DEAF; /* 0x10000000 Deaf */
extern long UMODE_HIDEOPER; /* 0x20000000 Hide oper mode */
extern long UMODE_SETHOST; /* 0x40000000 used sethost */
extern long UMODE_STRIPBADWORDS; /* 0x80000000 */
-
+extern long UMODE_HIDEWHOIS; /* hides channels in /whois */
extern long AllUmodes, SendUmodes;
#ifndef HAVE_STRLCPY
diff --git a/src/modules/m_whois.c b/src/modules/m_whois.c
index 335cbdeee..8006faef2 100644
--- a/src/modules/m_whois.c
+++ b/src/modules/m_whois.c
@@ -238,6 +238,8 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
if (IsAnOper(sptr))
#endif
showchannel = 1;
+ if ((acptr->umodes & UMODE_HIDEWHOIS) && !IsMember(sptr, chptr) && !IsAnOper(sptr))
+ showchannel = 0;
if (IsServices(acptr) && !IsNetAdmin(sptr))
showchannel = 0;
if (acptr == sptr)
@@ -256,13 +258,15 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
len = 0;
}
#ifdef SHOW_SECRET
- if (!(acptr == sptr) && IsAnOper(sptr)
+ if (IsAnOper(sptr)
#else
- if (!(acptr == sptr)
- && IsNetAdmin(sptr)
+ if (IsNetAdmin(sptr)
#endif
- && SecretChannel(chptr))
+ && SecretChannel(chptr) && !IsMember(sptr, chptr))
*(buf + len++) = '~';
+ if (acptr->umodes & UMODE_HIDEWHOIS && !IsMember(sptr, chptr)
+ && IsAnOper(sptr))
+ *(buf + len++) = '!';
if (is_chanowner(acptr, chptr))
*(buf + len++) = '*';
else if (is_chanprot(acptr, chptr))
diff --git a/src/umodes.c b/src/umodes.c
index cf02cacc4..63bc80d52 100644
--- a/src/umodes.c
+++ b/src/umodes.c
@@ -72,6 +72,7 @@ long UMODE_DEAF = 0L; /* Deaf */
long UMODE_HIDEOPER = 0L; /* Hide oper mode */
long UMODE_SETHOST = 0L; /* Used sethost */
long UMODE_STRIPBADWORDS = 0L; /* Strip badwords */
+long UMODE_HIDEWHOIS = 0L; /* Hides channels in /whois */
long AllUmodes; /* All umodes */
long SendUmodes; /* All umodes which are sent to other servers (global umodes) */
@@ -114,6 +115,7 @@ void umode_init(void)
UMODE_HIDEOPER = umode_gget('H'); /* 0x20000000 Hide oper mode */
UMODE_SETHOST = umode_gget('t'); /* 0x40000000 used sethost */
UMODE_STRIPBADWORDS = umode_gget('G'); /* 0x80000000 */
+ UMODE_HIDEWHOIS = umode_gget('p'); /* Hides channels in /whois */
}
void make_umodestr(void)