add hostmask_tracking.py to keep track of what hostmasks a user has used

This commit is contained in:
jesopo 2019-12-24 10:13:01 +00:00
parent 38235b1667
commit 3f3845a964

View file

@ -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)