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

utils.applyModes: fix prefixmodes lists not being updated...

This commit is contained in:
James Lu 2015-07-21 19:57:22 -07:00
parent bad1132789
commit e2738e3909
2 changed files with 4 additions and 1 deletions

View File

@ -99,7 +99,9 @@ def getPrefixModes(irc, remoteirc, channel, user):
for pmode in ('owner', 'admin', 'op', 'halfop', 'voice'): for pmode in ('owner', 'admin', 'op', 'halfop', 'voice'):
if pmode not in remoteirc.cmodes: # Mode not supported by IRCd if pmode not in remoteirc.cmodes: # Mode not supported by IRCd
continue continue
if user in irc.channels[channel].prefixmodes[pmode+'s']: mlist = irc.channels[channel].prefixmodes[pmode+'s']
log.debug('(%s) getPrefixModes: checking if %r is in %r', irc.name, user, mlist)
if user in mlist:
modes += remoteirc.cmodes[pmode] modes += remoteirc.cmodes[pmode]
return modes return modes

View File

@ -233,6 +233,7 @@ def applyModes(irc, target, changedmodes):
pmodelist.add(mode[1]) pmodelist.add(mode[1])
else: else:
pmodelist.discard(mode[1]) pmodelist.discard(mode[1])
irc.channels[target].prefixmodes[pmode] = pmodelist
log.debug('(%s) Final prefixmodes list: %s', irc.name, irc.channels[target].prefixmodes) log.debug('(%s) Final prefixmodes list: %s', irc.name, irc.channels[target].prefixmodes)
if real_mode[0] in irc.prefixmodes: if real_mode[0] in irc.prefixmodes:
# Ignore other prefix modes such as InspIRCd's +Yy # Ignore other prefix modes such as InspIRCd's +Yy