diff options
author | Florent Le Coz <louiz@louiz.org> | 2011-10-29 07:05:19 +0200 |
---|---|---|
committer | Florent Le Coz <louiz@louiz.org> | 2011-10-29 07:05:19 +0200 |
commit | 881de6a7c02e4c11957a1bb0dd3b31b8884fa8b0 (patch) | |
tree | 4685a5ed23128458435ce92258eb6fb70c95e03a /src | |
parent | a090b235d70c826ad823898800917c04e84a5535 (diff) | |
download | poezio-881de6a7c02e4c11957a1bb0dd3b31b8884fa8b0.tar.gz poezio-881de6a7c02e4c11957a1bb0dd3b31b8884fa8b0.tar.bz2 poezio-881de6a7c02e4c11957a1bb0dd3b31b8884fa8b0.tar.xz poezio-881de6a7c02e4c11957a1bb0dd3b31b8884fa8b0.zip |
add get_conversation_messages for the plugin API
Diffstat (limited to 'src')
-rw-r--r-- | src/core.py | 12 | ||||
-rw-r--r-- | src/tabs.py | 3 |
2 files changed, 15 insertions, 0 deletions
diff --git a/src/core.py b/src/core.py index 5f734142..b39bf904 100644 --- a/src/core.py +++ b/src/core.py @@ -1734,3 +1734,15 @@ class Core(object): self.remote_fifo = None else: pass + + def get_conversation_messages(self): + """ + Returns a list of all the messages in the current chat. + If the current tab is not a ChatTab, returns None. + + Messages are namedtuples of the form + ('txt nick_color time str_time nickname user') + """ + if not isinstance(self.current_tab(), tabs.ChatTab): + return None + return self.current_tab().get_conversation_messages() diff --git a/src/tabs.py b/src/tabs.py index a349da0b..8606c450 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -368,6 +368,9 @@ class ChatTab(Tab): self.text_win.refresh(self._room) self.input.refresh() + def get_conversation_messages(self): + return self._room.messages + def command_say(self, line): raise NotImplementedError |