diff options
| author | 2019-10-27 10:19:00 +0000 | |
|---|---|---|
| committer | 2019-10-27 10:19:00 +0000 | |
| commit | 8f4b5a0e70804f8f19f8b9032b7d93857cda40e8 (patch) | |
| tree | c522c8a04f4173cfc104796dd5cf942f2c44a0fb /modules | |
| parent | fallback ActivityPub data encoding to utf8 (diff) | |
| signature | ||
move IRCLine related code from utils.irc to IRCLine.py
Diffstat (limited to 'modules')
| -rw-r--r-- | modules/admin.py | 4 | ||||
| -rw-r--r-- | modules/commands/outs.py | 4 | ||||
| -rw-r--r-- | modules/fake_echo.py | 2 | ||||
| -rw-r--r-- | modules/ircv3_multiline.py | 2 | ||||
| -rw-r--r-- | modules/line_handler/__init__.py | 4 | ||||
| -rw-r--r-- | modules/line_handler/channel.py | 6 |
6 files changed, 11 insertions, 11 deletions
diff --git a/modules/admin.py b/modules/admin.py index 29c91720..76b6bb0c 100644 --- a/modules/admin.py +++ b/modules/admin.py @@ -1,7 +1,7 @@ #--depends-on commands #--depends-on permissions -from src import ModuleManager, utils +from src import IRCLine, ModuleManager, utils class Module(ModuleManager.BaseModule): @utils.hook("received.command.nick", min_args=1) @@ -148,7 +148,7 @@ class Module(ModuleManager.BaseModule): raise utils.EventError("Please provide <hostname>:[+]<port>") port = int(port) - hostmask = utils.irc.parse_hostmask(event["args_split"][2]) + hostmask = IRCLine.parse_hostmask(event["args_split"][2]) nickname = hostmask.nickname username = hostmask.username or nickname realname = nickname diff --git a/modules/commands/outs.py b/modules/commands/outs.py index c81883ab..9098df63 100644 --- a/modules/commands/outs.py +++ b/modules/commands/outs.py @@ -1,5 +1,5 @@ import re -from src import utils +from src import IRCLine, utils STR_MORE = " (more...)" STR_MORE_LEN = len(STR_MORE.encode("utf8")) @@ -57,7 +57,7 @@ class Out(object): if truncated: valid, truncated = self._adjust_to_word_boundaries(valid, truncated) - line = utils.irc.parse_line(valid+STR_MORE) + line = IRCLine.parse_line(valid+STR_MORE) self._text = "%s%s" % (STR_CONTINUED, truncated) else: self._text = "" diff --git a/modules/fake_echo.py b/modules/fake_echo.py index ff0b9c40..bb7fbf43 100644 --- a/modules/fake_echo.py +++ b/modules/fake_echo.py @@ -4,7 +4,7 @@ class Module(ModuleManager.BaseModule): @utils.hook("raw.send.privmsg", priority=EventManager.PRIORITY_MONITOR) @utils.hook("raw.send.notice", priority=EventManager.PRIORITY_MONITOR) def send_message(self, event): - our_hostmask = utils.irc.parse_hostmask(event["server"].hostmask()) + our_hostmask = IRCLine.parse_hostmask(event["server"].hostmask()) echo = IRCLine.ParsedLine(event["line"].command, event["line"].args, source=our_hostmask, tags=event["line"].tags) diff --git a/modules/ircv3_multiline.py b/modules/ircv3_multiline.py index 51bdf312..e07b2400 100644 --- a/modules/ircv3_multiline.py +++ b/modules/ircv3_multiline.py @@ -15,7 +15,7 @@ class Module(ModuleManager.BaseModule): target = event["line"].args[0] lines = event["line"].args[1].split("\n") - batch = utils.irc.IRCSendBatch("draft/multiline", + batch = IRCLine.IRCSendBatch("draft/multiline", [target]) for line in lines: batch.add_line(utils.irc.protocol.privmsg(target, line)) diff --git a/modules/line_handler/__init__.py b/modules/line_handler/__init__.py index 714bc23b..b4146813 100644 --- a/modules/line_handler/__init__.py +++ b/modules/line_handler/__init__.py @@ -1,5 +1,5 @@ import enum -from src import EventManager, ModuleManager, utils +from src import EventManager, IRCLine, ModuleManager, utils from . import channel, core, ircv3, message, user class Module(ModuleManager.BaseModule): @@ -178,7 +178,7 @@ class Module(ModuleManager.BaseModule): batch_type = event["line"].args[1] args = event["line"].args[2:] - batch = utils.irc.IRCBatch(identifier, batch_type, args, + batch = IRCLine.IRCBatch(identifier, batch_type, args, event["line"].tags, source=event["line"].source) event["server"].batches[identifier] = batch diff --git a/modules/line_handler/channel.py b/modules/line_handler/channel.py index bcfcebcd..385bf6b2 100644 --- a/modules/line_handler/channel.py +++ b/modules/line_handler/channel.py @@ -1,4 +1,4 @@ -from src import utils +from src import IRCLine, utils def handle_332(events, event): channel = event["server"].channels.get(event["line"].args[1]) @@ -18,7 +18,7 @@ def topic(events, event): def handle_333(events, event): channel = event["server"].channels.get(event["line"].args[1]) - topic_setter = utils.irc.parse_hostmask(event["line"].args[2]) + topic_setter = IRCLine.parse_hostmask(event["line"].args[2]) topic_time = int(event["line"].args[3]) channel.set_topic_setter(topic_setter) @@ -42,7 +42,7 @@ def handle_353(event): nickname = nickname[1:] if event["server"].has_capability_str("userhost-in-names"): - hostmask = utils.irc.parse_hostmask(nickname) + hostmask = IRCLine.parse_hostmask(nickname) nickname = hostmask.nickname user = event["server"].get_user(hostmask.nickname, username=hostmask.username, hostname=hostmask.hostname) |
