summaryrefslogtreecommitdiff
path: root/plugins/display_corrections.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/display_corrections.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/display_corrections.py')
-rw-r--r--plugins/display_corrections.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/display_corrections.py b/plugins/display_corrections.py
index 6e122bfe..cad5a327 100644
--- a/plugins/display_corrections.py
+++ b/plugins/display_corrections.py
@@ -8,14 +8,14 @@ import tabs
class Plugin(BasePlugin):
def init(self):
for tab_type in (tabs.MucTab, tabs.PrivateTab, tabs.ConversationTab):
- self.add_tab_command(tab_type, 'display_corrections',
+ self.api.add_tab_command(tab_type, 'display_corrections',
handler=self.command_display_corrections,
usage='<number>',
help='Display all the corrections of the number-th last corrected message.',
short='Display the corrections of a message')
def find_corrected(self, nb):
- messages = self.core.get_conversation_messages()
+ messages = self.api.get_conversation_messages()
if not messages:
return None
for message in messages[::-1]:
@@ -32,7 +32,7 @@ class Plugin(BasePlugin):
try:
nb = int(args[0])
except:
- return self.core.command_help('display_corrections')
+ return self.api.run_command('/help display_corrections')
else:
nb = 1
message = self.find_corrected(nb)
@@ -41,9 +41,9 @@ class Plugin(BasePlugin):
while message:
display.append('%s %s%s%s %s' % (message.str_time, '* ' if message.me else '', message.nickname, '' if message.me else '>', message.txt))
message = message.old_message
- self.core.information('Older versions:\n' + '\n'.join(display[::-1]), 'Info')
+ self.api.information('Older versions:\n' + '\n'.join(display[::-1]), 'Info')
else:
- self.core.information('No corrected message found.', 'Warning')
+ self.api.information('No corrected message found.', 'Warning')
def cleanup(self):
del self.config