3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-12-25 12:12:53 +01:00

relay.showuser: show home network/nick, and relay nicks regardless of oper status

This commit is contained in:
James Lu 2015-08-29 19:49:37 -07:00
parent 5503477646
commit 94f83eb33b

View File

@ -1046,7 +1046,7 @@ def showuser(irc, source, args):
# for us. # for us.
return return
u = utils.nickToUid(irc, target) u = utils.nickToUid(irc, target)
if u and (utils.isOper(irc, source) or u == source): if u:
try: try:
userpair = getLocalUser(irc, u) or (irc.name, u) userpair = getLocalUser(irc, u) or (irc.name, u)
remoteusers = relayusers[userpair].items() remoteusers = relayusers[userpair].items()
@ -1055,6 +1055,8 @@ def showuser(irc, source, args):
else: else:
nicks = [] nicks = []
if remoteusers: if remoteusers:
nicks.append('%s (home network): \x02%s\x02' % (userpair[0],
world.networkobjects[userpair[0]].users[userpair[1]].nick))
for r in remoteusers: for r in remoteusers:
remotenet, remoteuser = r remotenet, remoteuser = r
remoteirc = world.networkobjects[remotenet] remoteirc = world.networkobjects[remotenet]
@ -1065,5 +1067,5 @@ def showuser(irc, source, args):
relay = findRelay((irc.name, ch)) relay = findRelay((irc.name, ch))
if relay: if relay:
relaychannels.append(''.join(relay)) relaychannels.append(''.join(relay))
if relaychannels: if relaychannels and (utils.isOper(irc, source) or u == source):
utils.msg(irc, source, "\x02Relay channels\x02: %s" % ' '.join(relaychannels)) utils.msg(irc, source, "\x02Relay channels\x02: %s" % ' '.join(relaychannels))