mirror of
https://github.com/jlu5/PyLink.git
synced 2025-06-02 04:47:56 +02:00
Show oper types on WHOIS
This commit is contained in:
parent
8d19057118
commit
26e102f01a
@ -75,7 +75,13 @@ def handle_whois(irc, source, command, args):
|
|||||||
# 313: sends a string denoting the target's operator privilege,
|
# 313: sends a string denoting the target's operator privilege,
|
||||||
# only if they have umode +o.
|
# only if they have umode +o.
|
||||||
if ('o', None) in user.modes:
|
if ('o', None) in user.modes:
|
||||||
f(irc, server, 313, source, "%s :is an IRC Operator" % nick)
|
if hasattr(user, 'opertype'):
|
||||||
|
opertype = user.opertype.replace("_", " ")
|
||||||
|
else:
|
||||||
|
opertype = "IRC Operator"
|
||||||
|
# Let's be gramatically correct.
|
||||||
|
n = 'n' if opertype[0].lower() in 'aeiou' else ''
|
||||||
|
f(irc, server, 313, source, "%s :is a%s %s" % (nick, n, opertype))
|
||||||
# 379: RPL_WHOISMODES, used by UnrealIRCd and InspIRCd.
|
# 379: RPL_WHOISMODES, used by UnrealIRCd and InspIRCd.
|
||||||
# Only show this to opers!
|
# Only show this to opers!
|
||||||
if sourceisOper:
|
if sourceisOper:
|
||||||
|
@ -150,7 +150,7 @@ 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)
|
||||||
opertype = 'IRC_Operator_(remote)'
|
opertype = ''
|
||||||
if ('o', None) in userobj.modes:
|
if ('o', None) in userobj.modes:
|
||||||
if hasattr(userobj, 'opertype'):
|
if hasattr(userobj, 'opertype'):
|
||||||
# InspIRCd's special OPERTYPE command; this is mandatory
|
# InspIRCd's special OPERTYPE command; this is mandatory
|
||||||
@ -165,6 +165,8 @@ def getRemoteUser(irc, remoteirc, user, spawnIfMissing=True):
|
|||||||
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:
|
||||||
|
opertype = 'IRC_Operator_(remote)'
|
||||||
# Set hideoper on remote opers, to prevent inflating
|
# Set hideoper on remote opers, to prevent inflating
|
||||||
# /lusers and various /stats
|
# /lusers and various /stats
|
||||||
hideoper_mode = remoteirc.umodes.get('hideoper')
|
hideoper_mode = remoteirc.umodes.get('hideoper')
|
||||||
@ -175,6 +177,7 @@ def getRemoteUser(irc, remoteirc, user, spawnIfMissing=True):
|
|||||||
modes=modes, ts=userobj.ts,
|
modes=modes, ts=userobj.ts,
|
||||||
opertype=opertype).uid
|
opertype=opertype).uid
|
||||||
remoteirc.users[u].remote = (irc.name, user)
|
remoteirc.users[u].remote = (irc.name, user)
|
||||||
|
remoteirc.users[u].opertype = opertype
|
||||||
away = userobj.away
|
away = userobj.away
|
||||||
if away:
|
if away:
|
||||||
remoteirc.proto.awayClient(remoteirc, u, away)
|
remoteirc.proto.awayClient(remoteirc, u, away)
|
||||||
|
@ -195,6 +195,7 @@ def _operUp(irc, target, opertype=None):
|
|||||||
otype = 'IRC_Operator'
|
otype = 'IRC_Operator'
|
||||||
log.debug('(%s) Sending OPERTYPE from %s to oper them up.',
|
log.debug('(%s) Sending OPERTYPE from %s to oper them up.',
|
||||||
irc.name, target)
|
irc.name, target)
|
||||||
|
userobj.opertype = otype
|
||||||
_send(irc, target, 'OPERTYPE %s' % otype)
|
_send(irc, target, 'OPERTYPE %s' % otype)
|
||||||
|
|
||||||
def _sendModes(irc, numeric, target, modes, ts=None):
|
def _sendModes(irc, numeric, target, modes, ts=None):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user