summaryrefslogtreecommitdiff
path: root/plugins/simple_notify.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/simple_notify.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/simple_notify.py')
-rw-r--r--plugins/simple_notify.py10
1 files changed, 5 insertions, 5 deletions
diff --git a/plugins/simple_notify.py b/plugins/simple_notify.py
index d274e0ee..62b1f81a 100644
--- a/plugins/simple_notify.py
+++ b/plugins/simple_notify.py
@@ -5,9 +5,9 @@ import shlex
class Plugin(BasePlugin):
def init(self):
- self.add_event_handler('private_msg', self.on_private_msg)
- self.add_event_handler('conversation_msg', self.on_conversation_msg)
- self.add_event_handler('highlight', self.on_highlight)
+ self.api.add_event_handler('private_msg', self.on_private_msg)
+ self.api.add_event_handler('conversation_msg', self.on_conversation_msg)
+ self.api.add_event_handler('highlight', self.on_highlight)
def on_private_msg(self, message, tab):
fro = message['from']
@@ -27,7 +27,7 @@ class Plugin(BasePlugin):
return
command_str = self.config.get('command', '').strip()
if not command_str:
- self.core.information('No notification command was provided in the configuration file', 'Warning')
+ self.api.information('No notification command was provided in the configuration file', 'Warning')
return
command = [arg % {'body': body.replace('\n', ' '), 'from': fro} for arg in shlex.split(command_str)]
self.core.exec_command(command)
@@ -36,4 +36,4 @@ class Plugin(BasePlugin):
return
after_command = [arg % {'body': body.replace('\n', ' '), 'from': fro} for arg in shlex.split(after_command_str)]
delayed_event = DelayedEvent(self.config.get('delay', 1), self.core.exec_command, after_command)
- self.core.add_timed_event(delayed_event)
+ self.api.add_timed_event(delayed_event)