diff options
| author | 2018-09-11 08:52:12 +0100 | |
|---|---|---|
| committer | 2018-09-11 08:52:12 +0100 | |
| commit | 6c8399fa0fdcc42516cf72c0cfe78791b2ae93c7 (patch) | |
| tree | a4c1809e92fd80086a2fce51e0a0dce91b81f70c /IRCLineHandler.py | |
| parent | Pass around an IRCPrefix object instead of "nickname!username@hostname", fix a (diff) | |
| signature | ||
Respect RFC1459 casemapping rules
Diffstat (limited to 'IRCLineHandler.py')
| -rw-r--r-- | IRCLineHandler.py | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/IRCLineHandler.py b/IRCLineHandler.py index 4a19082c..d7d47f54 100644 --- a/IRCLineHandler.py +++ b/IRCLineHandler.py @@ -5,6 +5,7 @@ RE_PREFIXES = re.compile(r"\bPREFIX=\((\w+)\)(\W+)(?:\b|$)") RE_CHANMODES = re.compile( r"\bCHANMODES=(\w*),(\w*),(\w*),(\w*)(?:\b|$)") RE_CHANTYPES = re.compile(r"\bCHANTYPES=(\W+)(?:\b|$)") +RE_CASEMAPPING = re.compile(r"\bCASEMAPPING=(\S+)") RE_MODES = re.compile(r"[-+]\w+") CAPABILITIES = {"multi-prefix", "chghost", "invite-notify", "account-tag", @@ -136,6 +137,11 @@ class LineHandler(object): match = re.search(RE_CHANTYPES, isupport_line) if match: event["server"].channel_types = list(match.group(1)) + + match = re.search(RE_CASEMAPPING, isupport_line) + if match: + event["server"].case_mapping = match.group(1) + self.events.on("received.numeric.005").call( isupport=isupport_line, server=event["server"]) @@ -554,10 +560,11 @@ class LineHandler(object): # we need a registered nickname for this channel def handle_477(self, event): - if event["args"][1].lower() in event["server"].attempted_join: + channel_name = Utils.irc_lower(event["args"][1]) + if channel_name in event["server"].attempted_join: self.bot.add_timer("rejoin", 5, channel_name=event["args"][1], - key=event["server"].attempted_join[event["args"][1].lower()], + key=event["server"].attempted_join[channel_name], server_id=event["server"].id) # someone's been kicked from a channel |
