diff options
| author | 2017-12-26 10:32:36 +0000 | |
|---|---|---|
| committer | 2017-12-26 10:32:36 +0000 | |
| commit | 0cc72d5d66bc3a6abf7757c7202905bd656ddf1d (patch) | |
| tree | a2591a46c4e25f359b7ed6990f31d91be22d4d1d /IRCServer.py | |
| parent | NR: Indicate interesting activity at locations (diff) | |
| signature | ||
Added a "replay" system to EventManager hooks, to replay missed .calls
Diffstat (limited to 'IRCServer.py')
| -rw-r--r-- | IRCServer.py | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/IRCServer.py b/IRCServer.py index 44ffb89c..926631a1 100644 --- a/IRCServer.py +++ b/IRCServer.py @@ -135,18 +135,23 @@ class Server(object): user.part_channel(channel) del self.channels[channel.name] def parse_line(self, line): - if not line: return + if not line: + return original_line = line prefix, final = None, None - if line[0]==":": + if line[0] == ":": prefix, line = line[1:].split(" ", 1) + command, line = (line.split(" ", 1) + [""])[:2] - if line[:1]==":": + + if line[0] == ":": final, line = line[1:], "" elif " :" in line: line, final = line.split(" :", 1) + args_split = line.split(" ") if line else [] - if final: args_split.append(final) + if final: + args_split.append(final) IRCLineHandler.handle(original_line, prefix, command, args_split, final!=None, self.bot, self) self.check_users() def check_users(self): |
