diff options
| -rw-r--r-- | modules/format_activity.py | 8 | ||||
| -rw-r--r-- | modules/line_handler/__init__.py | 2 | ||||
| -rw-r--r-- | modules/line_handler/user.py | 5 | ||||
| -rw-r--r-- | modules/print_activity.py | 1 |
4 files changed, 14 insertions, 2 deletions
diff --git a/modules/format_activity.py b/modules/format_activity.py index 0911f771..54a3b0c7 100644 --- a/modules/format_activity.py +++ b/modules/format_activity.py @@ -84,6 +84,14 @@ class Module(ModuleManager.BaseModule): def self_join(self, event): self._on_join(event, event["server"].get_user(event["server"].nickname)) + @utils.hook("received.chghost") + def _on_chghost(self, event): + line_minimal = "%s changed host (%s@%s)" % (event["user"].nickname, + event["username"], event["hostname"]) + line = "- %s" % line_minimal + self._event("chghost", event["server"], line, None, user=event["user"], + minimal=line_minimal) + def _on_part(self, event, user): reason = event["reason"] reason = "" if not reason else " (%s)" % reason diff --git a/modules/line_handler/__init__.py b/modules/line_handler/__init__.py index b4146813..5001266c 100644 --- a/modules/line_handler/__init__.py +++ b/modules/line_handler/__init__.py @@ -204,7 +204,7 @@ class Module(ModuleManager.BaseModule): # IRCv3 CHGHOST, a user's username and/or hostname has changed @utils.hook("raw.received.chghost") def chghost(self, event): - user.chghost(event) + user.chghost(self.events, event) # IRCv3 SETNAME, to change a user's realname @utils.hook("raw.received.setname") diff --git a/modules/line_handler/user.py b/modules/line_handler/user.py index a489d6bf..20521675 100644 --- a/modules/line_handler/user.py +++ b/modules/line_handler/user.py @@ -64,7 +64,7 @@ def away(events, event): user.away_message = None events.on("received.away.off").call(user=user, server=event["server"]) -def chghost(event): +def chghost(events, event): nickname = event["line"].source.nickname username = event["line"].args[0] hostname = event["line"].args[1] @@ -74,6 +74,9 @@ def chghost(event): event["server"].hostname = hostname target = event["server"].get_user(nickname) + events.on("received.chghost").call(user=target, server=event["server"], + username=username, hostname=hostname) + target.username = username target.hostname = hostname diff --git a/modules/print_activity.py b/modules/print_activity.py index f7e30feb..2a4ae77f 100644 --- a/modules/print_activity.py +++ b/modules/print_activity.py @@ -26,6 +26,7 @@ class Module(ModuleManager.BaseModule): @utils.hook("formatted.kick") @utils.hook("formatted.quit") @utils.hook("formatted.rename") + @utils.hook("formatted.chghost") def formatted(self, event): self._print(event) |
