diff frontends/src/primitivus/chat.py @ 1125:d6c3fea5ecfe

quick_frontend, primitivus: add primitivus command ":history [limit]" (default value for limit is 50)
author souliane <souliane@mailoo.org>
date Sat, 23 Aug 2014 20:26:04 +0200
parents d1f6b927131e
children 8870417c8e8c
line wrap: on
line diff
--- a/frontends/src/primitivus/chat.py	Sun Aug 24 18:23:55 2014 +0200
+++ b/frontends/src/primitivus/chat.py	Sat Aug 23 20:26:04 2014 +0200
@@ -275,6 +275,16 @@
         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: