diff options
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 |