From 9885203c6799c121f5bc8a733dc1937fe8c1b4d6 Mon Sep 17 00:00:00 2001 From: mathieui Date: Fri, 8 Mar 2013 22:53:35 +0100 Subject: 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 --- plugins/tell.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins/tell.py') diff --git a/plugins/tell.py b/plugins/tell.py index f2ed49c8..d4d722af 100644 --- a/plugins/tell.py +++ b/plugins/tell.py @@ -4,16 +4,16 @@ import common class Plugin(BasePlugin): def init(self): - self.add_tab_command(tabs.MucTab, 'tell', self.command_tell, + self.api.add_tab_command(tabs.MucTab, 'tell', self.command_tell, usage=' ', help='Will tell of when he next joins.', short='Send a message when someone joins') - self.add_tab_command(tabs.MucTab, 'untell', self.command_untell, + self.api.add_tab_command(tabs.MucTab, 'untell', self.command_untell, usage='', help='Remove the planned messages from /tell.', short='Cancel a /tell message', completion=self.completion_untell) - self.add_event_handler('muc_join', self.on_join) + self.api.add_event_handler('muc_join', self.on_join) # {tab -> {nick -> [messages]} self.tabs = {} @@ -31,20 +31,20 @@ class Plugin(BasePlugin): """/tell """ arg = common.shell_split(args) if len(arg) != 2: - self.core.command_help('tell') + self.command_help('tell') return nick, msg = arg - tab = self.core.current_tab() + tab = self.api.current_tab() if not tab in self.tabs: self.tabs[tab] = {} if not nick in self.tabs[tab]: self.tabs[tab][nick] = [] self.tabs[tab][nick].append(msg) - self.core.information('Will tell %s' % nick, 'Info') + self.api.information('Will tell %s' % nick, 'Info') def command_untell(self, args): """/untell """ - tab = self.core.current_tab() + tab = self.api.current_tab() if not tab in self.tabs: return nick = args @@ -53,7 +53,7 @@ class Plugin(BasePlugin): del self.tabs[tab][nick] def completion_untell(self, the_input): - tab = self.core.current_tab() + tab = self.api.current_tab() if not tab in self.tabs: return the_input.auto_completion([], '') return the_input.auto_completion(list(self.tabs[tab]), '') -- cgit v1.2.3