summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-09-25 21:15:00 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-09-25 21:15:00 +0200
commit47c052acf47848a35987c6c41d9c20d390894f3e (patch)
tree9496787ceaf7ede29d6a20c851aa401f2f25b2a0
parentc80022e816e96580d48286011337528a929f4ec8 (diff)
downloadpoezio-47c052acf47848a35987c6c41d9c20d390894f3e.tar.gz
poezio-47c052acf47848a35987c6c41d9c20d390894f3e.tar.bz2
poezio-47c052acf47848a35987c6c41d9c20d390894f3e.tar.xz
poezio-47c052acf47848a35987c6c41d9c20d390894f3e.zip
Add a send_message() function for plugins
-rw-r--r--src/core.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py
index 88c926a9..1f60e252 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1637,3 +1637,13 @@ class Core(object):
if not self.running or self.background is True:
return
curses.doupdate()
+
+ def send_message(self, msg):
+ """
+ Function to use in plugins to send a message in the current conversation.
+ Returns False if the current tab is not a conversation tab
+ """
+ if not isinstance(self.current_tab(), tabs.ChatTab):
+ return False
+ self.current_tab().command_say(msg)
+ return True