diff options
| author | 2019-09-19 18:16:10 +0100 | |
|---|---|---|
| committer | 2019-09-19 18:16:10 +0100 | |
| commit | efc0e197e5565a0d68b2fbe778abac5690deb5c1 (patch) | |
| tree | cf19ed5abbadd8dae030e136bb9cc07cce5e9ffe | |
| parent | add missing IRCLine import (diff) | |
| signature | ||
Allow passing source Hostmask to IRCBatch
| -rw-r--r-- | modules/line_handler/__init__.py | 2 | ||||
| -rw-r--r-- | src/utils/irc/__init__.py | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/modules/line_handler/__init__.py b/modules/line_handler/__init__.py index 0df30109..714bc23b 100644 --- a/modules/line_handler/__init__.py +++ b/modules/line_handler/__init__.py @@ -179,7 +179,7 @@ class Module(ModuleManager.BaseModule): args = event["line"].args[2:] batch = utils.irc.IRCBatch(identifier, batch_type, args, - event["line"].tags) + event["line"].tags, source=event["line"].source) event["server"].batches[identifier] = batch self.events.on("received.batch.start").call(batch=batch, diff --git a/src/utils/irc/__init__.py b/src/utils/irc/__init__.py index 57c65fdb..bd7c09ec 100644 --- a/src/utils/irc/__init__.py +++ b/src/utils/irc/__init__.py @@ -258,11 +258,12 @@ def parse_ctcp(s: str) -> typing.Optional[CTCPMessage]: class IRCBatch(object): def __init__(self, identifier: str, batch_type: str, args: typing.List[str], - tags: typing.Dict[str, str]=None): + tags: typing.Dict[str, str]=None, source: IRCLine.Hostmask=None): self.identifier = identifier self.type = batch_type self.args = args self.tags = tags or {} + self.source = source self._lines = [] # type: typing.List[IRCLine.ParsedLine] def add_line(self, line: IRCLine.ParsedLine): self._lines.append(line) |
