summaryrefslogtreecommitdiff
path: root/plugins/admin.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-03-08 22:53:35 +0100
committermathieui <mathieui@mathieui.net>2013-03-08 22:53:35 +0100
commit9885203c6799c121f5bc8a733dc1937fe8c1b4d6 (patch)
tree4190635a7c9c78d2dce1a4c8357ccb887f12b8af /plugins/admin.py
parentdbde08a5267cf003d8a4a9c16f5b18275e9a4bd1 (diff)
downloadpoezio-9885203c6799c121f5bc8a733dc1937fe8c1b4d6.tar.gz
poezio-9885203c6799c121f5bc8a733dc1937fe8c1b4d6.tar.bz2
poezio-9885203c6799c121f5bc8a733dc1937fe8c1b4d6.tar.xz
poezio-9885203c6799c121f5bc8a733dc1937fe8c1b4d6.zip
Update the plugins to use the PluginAPI
Also: - Add get_conversation_messages() to PluginAPI - Make plugins_autoload colon-separated instead of space-separated (for consistency) - Replace a JID() with a safeJID() in the uptime plugin
Diffstat (limited to 'plugins/admin.py')
-rw-r--r--plugins/admin.py18
1 files changed, 9 insertions, 9 deletions
diff --git a/plugins/admin.py b/plugins/admin.py
index 0f61007b..fac34fdb 100644
--- a/plugins/admin.py
+++ b/plugins/admin.py
@@ -14,49 +14,49 @@ class Plugin(BasePlugin):
"""
def init(self):
for role in ('visitor', 'participant' , 'moderator'):
- self.add_tab_command(MucTab, role, self.role(role),
+ self.api.add_tab_command(MucTab, role, self.role(role),
help='Set the role of a nick to %s' % role,
usage= '<nick>',
short='Set the role to %s' % role,
completion=self.complete_nick)
for aff in ('member', 'owner', 'admin'):
- self.add_tab_command(MucTab, aff, self.affiliation(aff),
+ self.api.add_tab_command(MucTab, aff, self.affiliation(aff),
usage='<nick>',
help='Set the affiliation of a nick to %s' % aff,
short='Set the affiliation to %s' % aff,
completion=self.complete_nick)
- self.add_tab_command(MucTab, 'noaffiliation', self.affiliation('none'),
+ self.api.add_tab_command(MucTab, 'noaffiliation', self.affiliation('none'),
usage='<nick>',
help='Set the affiliation of a nick to none.',
short='Set the affiliation to none.',
completion=self.complete_nick)
- self.add_tab_command(MucTab, 'voice', self.affiliation('member'),
+ self.api.add_tab_command(MucTab, 'voice', self.affiliation('member'),
usage='<nick>',
help='Set the affiliation of a nick to member.',
short='Set the affiliation to member.',
completion=self.complete_nick)
- self.add_tab_command(MucTab, 'op', self.role('moderator'),
+ self.api.add_tab_command(MucTab, 'op', self.role('moderator'),
usage='<nick>',
help='Set the role of a nick to moderator.',
short='Set the role to moderator.',
completion=self.complete_nick)
- self.add_tab_command(MucTab, 'mute', self.role('visitor'),
+ self.api.add_tab_command(MucTab, 'mute', self.role('visitor'),
usage='<nick>',
help='Set the role of a nick to visitor.',
short='Set the role to visitor.',
completion=self.complete_nick)
def role(self, role):
- return lambda args: self.core.current_tab().command_role(args+' '+role)
+ return lambda args: self.api.current_tab().command_role(args+' '+role)
def affiliation(self, affiliation):
- return lambda args: self.core.current_tab().command_affiliation(
+ return lambda args: self.api.current_tab().command_affiliation(
args+' '+affiliation)
def complete_nick(self, the_input):
- tab = self.core.current_tab()
+ tab = self.api.current_tab()
compare_users = lambda x: x.last_talked
word_list = [user.nick for user in sorted(tab.users, key=compare_users, reverse=True)\
if user.nick != tab.own_nick]