From 3935bf3a30a409bfae09abfe5bcb99240236ed24 Mon Sep 17 00:00:00 2001 From: jesopo Date: Fri, 22 Nov 2019 11:48:29 +0000 Subject: [PATCH] IRCUser.get_identified_account() doesn't exist anymore --- modules/channel_access.py | 3 ++- modules/channel_op.py | 4 ++-- modules/ids.py | 2 +- modules/permissions/__init__.py | 4 ++++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/modules/channel_access.py b/modules/channel_access.py index 100b22e0..a7d75ac9 100644 --- a/modules/channel_access.py +++ b/modules/channel_access.py @@ -1,5 +1,6 @@ #--depends-on check_mode #--depends-on commands +#--depends-on permissions from src import ModuleManager, utils @@ -8,7 +9,7 @@ class Module(ModuleManager.BaseModule): def _has_channel_access(self, target, user, require_access): access = target.get_user_setting(user.get_id(), "access", []) - identified_account = user.get_identified_account() + identified = self.exports.get_one("is-identified")(user) return ((require_access in access or "*" in access ) and identified_account) diff --git a/modules/channel_op.py b/modules/channel_op.py index 168d5d81..bc307778 100644 --- a/modules/channel_op.py +++ b/modules/channel_op.py @@ -56,10 +56,10 @@ class Module(ModuleManager.BaseModule): mask_split[i] = (mask_part.replace("$n", user.nickname) .replace("$u", user.username) .replace("$h", user.hostname) - .replace("$a", user.get_identified_account() or "")) + .replace("$a", user.account or "")) return "$".join(mask_split) def _get_hostmask(self, channel, user): - if not user.get_identified_account() == None: + if not user.account == None: account_format = channel.get_setting("ban-format-account", None) if not account_format == None: return self._format_hostmask(user, account_format) diff --git a/modules/ids.py b/modules/ids.py index 20a641b7..1738c549 100644 --- a/modules/ids.py +++ b/modules/ids.py @@ -16,7 +16,7 @@ class Module(ModuleManager.BaseModule): @utils.kwarg("help", "Show what I think your account name is") def account(self, event): event["stdout"].write("%s: %s" % (event["user"].nickname, - event["user"].get_identified_account())) + self.exports.get_one("account-name")(event["user"]))) @utils.hook("received.command.channelid", channel_only=True) def channel_id(self, event): diff --git a/modules/permissions/__init__.py b/modules/permissions/__init__.py index 91f62794..55cc4a68 100644 --- a/modules/permissions/__init__.py +++ b/modules/permissions/__init__.py @@ -6,6 +6,10 @@ HOSTMASKS_SETTING = "hostmask-account" NO_PERMISSION = "You do not have permission to do that" class Module(ModuleManager.BaseModule): + def on_load(self): + self.exports.add("is-identified", self._is_identified) + self.exports.add("account-name", self._account_name) + @utils.hook("new.server") def new_server(self, event): hostmasks = {}