quick_frontend, primitivus: add primitivus command ":history [limit]" (default value for limit is 50)

This commit is contained in:
souliane 2014-08-23 20:26:04 +02:00
commit 3cee372b02

View file

@ -275,6 +275,16 @@ class Chat(urwid.WidgetWrap, QuickChat):
self.present_wid.deleteValue(nick)
self.host.redraw()
def clearHistory(self):
"""Clear the content of this chat."""
del self.content[:]
def afterHistoryPrint(self):
"""Refresh or scroll down the focus after the history is printed"""
if len(self.content):
self.text_list.focus_position = len(self.content) - 1 # scroll down
self.host.redraw()
def printMessage(self, from_jid, msg, profile, timestamp=""):
assert isinstance(from_jid, JID)
try: