mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-24 03:29:28 +01:00
relay: set umode +H (hideoper) on all remote opered clients
This commit is contained in:
parent
5480ae14c4
commit
8d19057118
@ -150,21 +150,26 @@ def getRemoteUser(irc, remoteirc, user, spawnIfMissing=True):
|
|||||||
host = userobj.host[:64]
|
host = userobj.host[:64]
|
||||||
realname = userobj.realname
|
realname = userobj.realname
|
||||||
modes = getSupportedUmodes(irc, remoteirc, userobj.modes)
|
modes = getSupportedUmodes(irc, remoteirc, userobj.modes)
|
||||||
if hasattr(userobj, 'opertype'):
|
opertype = 'IRC_Operator_(remote)'
|
||||||
# InspIRCd's special OPERTYPE command; this is mandatory
|
if ('o', None) in userobj.modes:
|
||||||
# and setting of umode +/-o will fail unless this
|
if hasattr(userobj, 'opertype'):
|
||||||
# is used instead. This also sets an oper type for
|
# InspIRCd's special OPERTYPE command; this is mandatory
|
||||||
# the user, which is used in WHOIS, etc.
|
# and setting of umode +/-o will fail unless this
|
||||||
|
# is used instead. This also sets an oper type for
|
||||||
|
# the user, which is used in WHOIS, etc.
|
||||||
|
|
||||||
# If an opertype exists for the user, add " (remote)"
|
# If an opertype exists for the user, add " (remote)"
|
||||||
# for the relayed clone, so that it shows in whois.
|
# for the relayed clone, so that it shows in whois.
|
||||||
# Janus does this too. :)
|
# Janus does this too. :)
|
||||||
# OPERTYPE uses underscores instead of spaces, FYI.
|
# OPERTYPE uses underscores instead of spaces, FYI.
|
||||||
log.debug('(%s) relay.getRemoteUser: setting OPERTYPE of client for %r to %s',
|
log.debug('(%s) relay.getRemoteUser: setting OPERTYPE of client for %r to %s',
|
||||||
irc.name, user, userobj.opertype)
|
irc.name, user, userobj.opertype)
|
||||||
opertype = userobj.opertype + '_(remote)'
|
opertype = userobj.opertype + '_(remote)'
|
||||||
else:
|
# Set hideoper on remote opers, to prevent inflating
|
||||||
opertype = 'IRC_Operator_(remote)'
|
# /lusers and various /stats
|
||||||
|
hideoper_mode = remoteirc.umodes.get('hideoper')
|
||||||
|
if hideoper_mode:
|
||||||
|
modes.append((hideoper_mode, None))
|
||||||
u = remoteirc.proto.spawnClient(remoteirc, nick, ident=ident,
|
u = remoteirc.proto.spawnClient(remoteirc, nick, ident=ident,
|
||||||
host=host, realname=realname,
|
host=host, realname=realname,
|
||||||
modes=modes, ts=userobj.ts,
|
modes=modes, ts=userobj.ts,
|
||||||
@ -619,7 +624,15 @@ def handle_mode(irc, numeric, command, args):
|
|||||||
if utils.isChannel(target):
|
if utils.isChannel(target):
|
||||||
relayModes(irc, remoteirc, numeric, target, modes)
|
relayModes(irc, remoteirc, numeric, target, modes)
|
||||||
else:
|
else:
|
||||||
|
# Set hideoper on remote opers, to prevent inflating
|
||||||
|
# /lusers and various /stats
|
||||||
|
hideoper_mode = remoteirc.umodes.get('hideoper')
|
||||||
modes = getSupportedUmodes(irc, remoteirc, modes)
|
modes = getSupportedUmodes(irc, remoteirc, modes)
|
||||||
|
if hideoper_mode:
|
||||||
|
if ('+o', None) in modes:
|
||||||
|
modes.append(('+%s' % hideoper_mode, None))
|
||||||
|
elif ('-o', None) in modes:
|
||||||
|
modes.append(('-%s' % hideoper_mode, None))
|
||||||
remoteuser = getRemoteUser(irc, remoteirc, target, spawnIfMissing=False)
|
remoteuser = getRemoteUser(irc, remoteirc, target, spawnIfMissing=False)
|
||||||
if remoteuser is None:
|
if remoteuser is None:
|
||||||
continue
|
continue
|
||||||
|
Loading…
Reference in New Issue
Block a user