summaryrefslogtreecommitdiff
path: root/plugins/tell.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/tell.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/tell.py')
-rw-r--r--plugins/tell.py16
1 files changed, 8 insertions, 8 deletions
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='<nick> <message>',
help='Will tell <nick> of <message> 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='<nick>',
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 <nick> <message>"""
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 <nick>"""
- 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]), '')