mirror of
https://github.com/pissnet/pissircd.git
synced 2025-08-04 01:12:24 +01:00
- Made it so undefining SHOW_SECRET (not the default) properly hides +s channels from ircops
(except netadmins), as it should. Reported and patch supplied by Jason (#0002965).
This commit is contained in:
parent
32495af164
commit
e1dd8acd72
8 changed files with 16 additions and 17 deletions
2
Changes
2
Changes
|
@ -1265,3 +1265,5 @@
|
|||
- Added HOOKTYPE_SILENCED: this is called whenever a message did not get delivered to a user
|
||||
because the user was on the silence list.
|
||||
- Added OpenBSD 3.9 to the supported OS list.
|
||||
- Made it so undefining SHOW_SECRET (not the default) properly hides +s channels from ircops
|
||||
(except netadmins), as it should. Reported and patch supplied by Jason (#0002965).
|
||||
|
|
|
@ -613,6 +613,11 @@ typedef unsigned int u_int32_t; /* XXX Hope this works! */
|
|||
#define OPIsNetAdmin(x) ((x)->oflag & OFLAG_NETADMIN)
|
||||
#define OPIsCoAdmin(x) ((x)->oflag & OFLAG_COADMIN)
|
||||
#define OPIsWhois(x) ((x)->oflag & OFLAG_WHOIS)
|
||||
#ifdef SHOW_SECRET
|
||||
#define OPCanSeeSecret(x) IsAnOper(x)
|
||||
#else
|
||||
#define OPCanSeeSecret(x) IsNetAdmin(x)
|
||||
#endif
|
||||
|
||||
#define OPSetRehash(x) ((x)->oflag |= OFLAG_REHASH)
|
||||
#define OPSetDie(x) ((x)->oflag |= OFLAG_DIE)
|
||||
|
|
|
@ -269,7 +269,7 @@ DLLFUNC CMD_FUNC(m_list)
|
|||
else /* Just a normal channel */
|
||||
{
|
||||
chptr = find_channel(name, NullChn);
|
||||
if (chptr && (ShowChannel(sptr, chptr) || IsAnOper(sptr))) {
|
||||
if (chptr && (ShowChannel(sptr, chptr) || OPCanSeeSecret(sptr))) {
|
||||
#ifdef LIST_SHOW_MODES
|
||||
modebuf[0] = '[';
|
||||
channel_modes(sptr, &modebuf[1], parabuf, chptr);
|
||||
|
@ -364,7 +364,7 @@ void _send_list(aClient *cptr, int numsend)
|
|||
{
|
||||
if (SecretChannel(chptr)
|
||||
&& !IsMember(cptr, chptr)
|
||||
&& !IsAnOper(cptr))
|
||||
&& !OPCanSeeSecret(cptr))
|
||||
continue;
|
||||
|
||||
/* Much more readable like this -- codemastr */
|
||||
|
@ -405,7 +405,7 @@ void _send_list(aClient *cptr, int numsend)
|
|||
else
|
||||
strlcat(modebuf, "]", sizeof modebuf);
|
||||
#endif
|
||||
if (!IsAnOper(cptr))
|
||||
if (!OPCanSeeSecret(cptr))
|
||||
sendto_one(cptr,
|
||||
rpl_str(RPL_LIST), me.name,
|
||||
cptr->name,
|
||||
|
|
|
@ -126,7 +126,7 @@ DLLFUNC CMD_FUNC(m_names)
|
|||
|
||||
chptr = find_channel(para, (aChannel *)NULL);
|
||||
|
||||
if (!chptr || (!ShowChannel(sptr, chptr) && !IsAnOper(sptr)))
|
||||
if (!chptr || (!ShowChannel(sptr, chptr) && !OPCanSeeSecret(sptr)))
|
||||
{
|
||||
sendto_one(sptr, rpl_str(RPL_ENDOFNAMES), me.name,
|
||||
parv[0], para);
|
||||
|
|
|
@ -146,7 +146,7 @@ long flags = 0; /* cache: membership flags */
|
|||
if (parc > 2 || SecretChannel(chptr))
|
||||
{
|
||||
if (!ismember && !IsServer(sptr)
|
||||
&& !IsOper(sptr) && !IsULine(sptr))
|
||||
&& !OPCanSeeSecret(sptr) && !IsULine(sptr))
|
||||
{
|
||||
sendto_one(sptr, err_str(ERR_NOTONCHANNEL),
|
||||
me.name, parv[0], name);
|
||||
|
|
|
@ -796,7 +796,7 @@ static char *first_visible_channel(aClient *sptr, aClient *acptr, int *flg)
|
|||
cansee = 0;
|
||||
if (!cansee)
|
||||
{
|
||||
if (IsAnOper(sptr))
|
||||
if (OPCanSeeSecret(sptr))
|
||||
*flg |= FVC_HIDDEN;
|
||||
else
|
||||
continue;
|
||||
|
|
|
@ -209,11 +209,7 @@ DLLFUNC int m_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
|||
showchannel = 0;
|
||||
if (ShowChannel(sptr, chptr))
|
||||
showchannel = 1;
|
||||
#ifndef SHOW_SECRET
|
||||
if (IsAnOper(sptr) && !SecretChannel(chptr))
|
||||
#else
|
||||
if (IsAnOper(sptr))
|
||||
#endif
|
||||
if (OPCanSeeSecret(sptr))
|
||||
showchannel = 1;
|
||||
if ((acptr->umodes & UMODE_HIDEWHOIS) && !IsMember(sptr, chptr) && !IsAnOper(sptr))
|
||||
showchannel = 0;
|
||||
|
|
|
@ -214,7 +214,7 @@ int w_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
|||
if (!invis && HiddenChannel(chptr) &&
|
||||
!SecretChannel(chptr))
|
||||
showperson = 1;
|
||||
else if (IsAnOper(sptr) && SecretChannel(chptr)) {
|
||||
else if (OPCanSeeSecret(sptr) && SecretChannel(chptr)) {
|
||||
showperson = 1;
|
||||
showsecret = 1;
|
||||
}
|
||||
|
@ -266,11 +266,7 @@ int w_whois(aClient *cptr, aClient *sptr, int parc, char *parv[])
|
|||
showchannel = 0;
|
||||
if (ShowChannel(sptr, chptr))
|
||||
showchannel = 1;
|
||||
#ifndef SHOW_SECRET
|
||||
if (IsAnOper(sptr) && !SecretChannel(chptr))
|
||||
#else
|
||||
if (IsAnOper(sptr))
|
||||
#endif
|
||||
if (OPCanSeeSecret(sptr))
|
||||
showchannel = 1;
|
||||
if ((acptr->umodes & UMODE_HIDEWHOIS) && !IsMember(sptr, chptr) && !IsAnOper(sptr))
|
||||
showchannel = 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue