aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/core_modules/line_handler/__init__.py4
-rw-r--r--src/core_modules/line_handler/core.py6
2 files changed, 10 insertions, 0 deletions
diff --git a/src/core_modules/line_handler/__init__.py b/src/core_modules/line_handler/__init__.py
index a77dc451..f23a98ed 100644
--- a/src/core_modules/line_handler/__init__.py
+++ b/src/core_modules/line_handler/__init__.py
@@ -205,6 +205,10 @@ class Module(ModuleManager.BaseModule):
@utils.hook("raw.received.chghost")
def chghost(self, event):
user.chghost(self.events, event)
+ # RPL_VISIBLEHOST, telling us what our hostname (and sometimes username) is
+ @utils.hook("raw.received.396")
+ def handle_396(self, event):
+ core.handle_396(event)
# IRCv3 SETNAME, to change a user's realname
@utils.hook("raw.received.setname")
diff --git a/src/core_modules/line_handler/core.py b/src/core_modules/line_handler/core.py
index a7075613..8e60edfa 100644
--- a/src/core_modules/line_handler/core.py
+++ b/src/core_modules/line_handler/core.py
@@ -165,3 +165,9 @@ def handle_433(event):
_nick_in_use(event["server"])
def handle_437(event):
_nick_in_use(event["server"])
+
+def handle_396(event):
+ username, sep, hostname = event["line"][1].rpartition("@")
+ event["server"].hostname = hostname
+ if sep:
+ event["server"].username = username