aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-09-16 18:43:57 +0100
committerGravatar jesopo2019-09-16 18:43:57 +0100
commit334d580c57551cb0489ff334ad5e716c7c73f93e (patch)
treef00f955c9dc83f9c8218688447b4ec2cb7d05b83
parentupdate channel.topic_setter-related code (diff)
'seperate_hostmask()' -> 'parse_hostmask()'
-rw-r--r--modules/admin.py2
-rw-r--r--modules/fake_echo.py2
-rw-r--r--modules/line_handler/channel.py4
-rw-r--r--src/utils/irc/__init__.py4
4 files changed, 6 insertions, 6 deletions
diff --git a/modules/admin.py b/modules/admin.py
index 12c1895d..4d4250bc 100644
--- a/modules/admin.py
+++ b/modules/admin.py
@@ -131,7 +131,7 @@ class Module(ModuleManager.BaseModule):
raise utils.EventError("Please provide <hostname>:[+]<port>")
port = int(port)
- hostmask = utils.irc.seperate_hostmask(event["args_split"][2])
+ hostmask = utils.irc.parse_hostmask(event["args_split"][2])
nickname = hostmask.nickname
username = hostmask.username or nickname
realname = nickname
diff --git a/modules/fake_echo.py b/modules/fake_echo.py
index 88a73a5b..ff0b9c40 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.seperate_hostmask(event["server"].hostmask())
+ our_hostmask = utils.irc.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/line_handler/channel.py b/modules/line_handler/channel.py
index a7693b7e..c96c7c31 100644
--- a/modules/line_handler/channel.py
+++ b/modules/line_handler/channel.py
@@ -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.seperate_hostmask(event["line"].args[2])
+ topic_setter = utils.irc.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.seperate_hostmask(nickname)
+ hostmask = utils.irc.parse_hostmask(nickname)
nickname = hostmask.nickname
user = event["server"].get_user(hostmask.nickname)
user.username = hostmask.username
diff --git a/src/utils/irc/__init__.py b/src/utils/irc/__init__.py
index 0584d7c1..57c65fdb 100644
--- a/src/utils/irc/__init__.py
+++ b/src/utils/irc/__init__.py
@@ -30,7 +30,7 @@ def lower(case_mapping: str, s: str) -> str:
def equals(case_mapping: str, s1: str, s2: str) -> bool:
return lower(case_mapping, s1) == lower(case_mapping, s2)
-def seperate_hostmask(hostmask: str) -> IRCLine.Hostmask:
+def parse_hostmask(hostmask: str) -> IRCLine.Hostmask:
nickname, _, username = hostmask.partition("!")
username, _, hostname = username.partition("@")
return IRCLine.Hostmask(nickname, username, hostname, hostmask)
@@ -66,7 +66,7 @@ def parse_line(line: str) -> IRCLine.ParsedLine:
if line[0] == ":":
source_str, line = line[1:].split(" ", 1)
- source = seperate_hostmask(source_str)
+ source = parse_hostmask(source_str)
command, sep, line = line.partition(" ")
args = [] # type: typing.List[str]