mirror of
https://github.com/jlu5/PyLink.git
synced 2024-11-01 01:09:22 +01:00
utils.isOper: check for both umode +o and login status
Also, make commands.status show this isOper result.
This commit is contained in:
parent
3646930d34
commit
880b59c2c1
@ -14,9 +14,10 @@ def status(irc, source, args):
|
||||
Returns your current PyLink login status."""
|
||||
identified = irc.users[source].identified
|
||||
if identified:
|
||||
utils.msg(irc, source, 'You are identified as %s.' % identified)
|
||||
utils.msg(irc, source, 'You are identified as \x02%s\x02.' % identified)
|
||||
else:
|
||||
utils.msg(irc, source, 'You are not identified as anyone.')
|
||||
utils.msg(irc, source, 'Operator access: \x02%s\x02' % bool(utils.isOper(irc, source)))
|
||||
|
||||
@utils.add_cmd
|
||||
def identify(irc, source, args):
|
||||
|
5
utils.py
5
utils.py
@ -350,9 +350,10 @@ def isInternalServer(irc, sid):
|
||||
def isOper(irc, uid):
|
||||
"""<irc object> <UID>
|
||||
|
||||
Returns whether <UID> is an opered client.
|
||||
Returns whether <UID> has operator status on PyLink. This can be achieved
|
||||
by either identifying to PyLink as admin, or having user mode +o set.
|
||||
"""
|
||||
return (uid in irc.users and ("o", None) in irc.users[uid].modes)
|
||||
return (uid in irc.users and (("o", None) in irc.users[uid].modes or irc.users[uid].identified))
|
||||
|
||||
def getHostmask(irc, user):
|
||||
userobj = irc.users.get(user)
|
||||
|
Loading…
Reference in New Issue
Block a user