3
0
mirror of https://github.com/jlu5/PyLink.git synced 2024-11-01 01:09:22 +01:00

utils.parseModes: check to make sure target channel/user exists

This commit is contained in:
James Lu 2015-09-25 20:25:30 -07:00
parent aaeeedadf2
commit da3251cce2

View File

@ -176,10 +176,12 @@ def parseModes(irc, target, args):
args = args[1:]
if usermodes:
log.debug('(%s) Using irc.umodes for this query: %s', irc.name, irc.umodes)
assert target in irc.users, "Unknown user %r." % target
supported_modes = irc.umodes
oldmodes = irc.users[target].modes
else:
log.debug('(%s) Using irc.cmodes for this query: %s', irc.name, irc.cmodes)
assert target in irc.channels, "Unknown channel %r." % target
supported_modes = irc.cmodes
oldmodes = irc.channels[target].modes
res = []