add get_conversation_messages for the plugin API
This commit is contained in:
parent
a090b235d7
commit
881de6a7c0
2 changed files with 15 additions and 0 deletions
12
src/core.py
12
src/core.py
|
@ -1734,3 +1734,15 @@ class Core(object):
|
||||||
self.remote_fifo = None
|
self.remote_fifo = None
|
||||||
else:
|
else:
|
||||||
pass
|
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()
|
||||||
|
|
|
@ -368,6 +368,9 @@ class ChatTab(Tab):
|
||||||
self.text_win.refresh(self._room)
|
self.text_win.refresh(self._room)
|
||||||
self.input.refresh()
|
self.input.refresh()
|
||||||
|
|
||||||
|
def get_conversation_messages(self):
|
||||||
|
return self._room.messages
|
||||||
|
|
||||||
def command_say(self, line):
|
def command_say(self, line):
|
||||||
raise NotImplementedError
|
raise NotImplementedError
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue