aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar jesopo2019-11-22 11:48:29 +0000
committerGravatar jesopo2019-11-22 11:50:23 +0000
commit3935bf3a30a409bfae09abfe5bcb99240236ed24 (patch)
tree8db4b36198e3ebd47228cfe8bcc1032f4b5df74f
parentcorrectly detect when a track has tags (lastfm) (diff)
signature
IRCUser.get_identified_account() doesn't exist anymore
-rw-r--r--modules/channel_access.py3
-rw-r--r--modules/channel_op.py4
-rw-r--r--modules/ids.py2
-rw-r--r--modules/permissions/__init__.py4
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 = {}