aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-12-24 10:13:01 +0000
committerGravatar jesopo2019-12-24 10:13:01 +0000
commit3f3845a964569f181f5d22a3e6da093d89de0853 (patch)
treeca3152e31eb9fbd11042e1596e1713dac61d3f03
parentswitch channel_op ban masks to use utils.parse.parse_token_replace (diff)
signature
add hostmask_tracking.py to keep track of what hostmasks a user has used
-rw-r--r--modules/hostmask_tracking.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/hostmask_tracking.py b/modules/hostmask_tracking.py
new file mode 100644
index 00000000..73b95349
--- /dev/null
+++ b/modules/hostmask_tracking.py
@@ -0,0 +1,11 @@
+from src import ModuleManager, utils
+
+class Module(ModuleManager.BaseModule):
+ @utils.hook("new.user")
+ def new_user(self, event):
+ userhost = event["user"].userhost()
+ if not userhost == None:
+ known_hostmasks = event["user"].get_setting("known-hostmasks", [])
+ if not userhost in known_hostmasks:
+ known_hostmasks.append(userhost)
+ event["user"].set_setting("known-hostmasks", known_hostmasks)