mirror of
https://github.com/jlu5/PyLink.git
synced 2024-12-25 20:22:45 +01:00
Irc: make prefixmodes a dict mapping chars to their prefixes
This is needed by TS6 support (#40), which send the characters (@+) instead of modes
This commit is contained in:
parent
65ef27fd4b
commit
a10a18d9cc
2
main.py
2
main.py
@ -43,7 +43,7 @@ class Irc():
|
|||||||
# capability information is received. This handling of irc.connected
|
# capability information is received. This handling of irc.connected
|
||||||
# is also dependent on the protocol module.
|
# is also dependent on the protocol module.
|
||||||
self.maxnicklen = 30
|
self.maxnicklen = 30
|
||||||
self.prefixmodes = 'ov'
|
self.prefixmodes = {'o': '@', 'v': '+'}
|
||||||
|
|
||||||
# Uplink SID (filled in by protocol module)
|
# Uplink SID (filled in by protocol module)
|
||||||
self.uplink = None
|
self.uplink = None
|
||||||
|
@ -535,7 +535,9 @@ def handle_events(irc, data):
|
|||||||
= caps['CHANMODES'].split(',')
|
= caps['CHANMODES'].split(',')
|
||||||
irc.umodes['*A'], irc.umodes['*B'], irc.umodes['*C'], irc.umodes['*D'] \
|
irc.umodes['*A'], irc.umodes['*B'], irc.umodes['*C'], irc.umodes['*D'] \
|
||||||
= caps['USERMODES'].split(',')
|
= caps['USERMODES'].split(',')
|
||||||
irc.prefixmodes = re.search(r'\((.*?)\)', caps['PREFIX']).group(1)
|
prefixsearch = re.search(r'\(([A-Za-z]+)\)(.*)', caps['PREFIX'])
|
||||||
|
irc.prefixmodes = dict(zip(prefixsearch.group(1), prefixsearch.group(2)))
|
||||||
|
log.debug('(%s) irc.prefixmodes set to %r', irc.name, irc.prefixmodes)
|
||||||
# Sanity check: set this AFTER we fetch the capabilities for the network!
|
# Sanity check: set this AFTER we fetch the capabilities for the network!
|
||||||
irc.connected.set()
|
irc.connected.set()
|
||||||
try:
|
try:
|
||||||
|
Loading…
Reference in New Issue
Block a user