Do not refresh the screen on each input

parent f4d4a205
......@@ -17,7 +17,7 @@ port = 5222
resource =
# the nick you will use when joining a room with no associated nick
# If this is empty, the $USER environn<ement variable will be used
# If this is empty, the $USER environnement variable will be used
default_nick =
# Jabber identifiant. Specify it only if you want to connect using an existing
......
......@@ -491,6 +491,7 @@ class TextWin(Win):
if txt.startswith('\n'):
txt = txt[1:]
first = False
log.debug('%s built\n' % len(lines))
return lines
return lines[-len(messages):] # return only the needed number of lines
......
......@@ -26,7 +26,6 @@ import sleekxmpp
from config import config
from logger import logger
from handler import Handler
class Connection(sleekxmpp.ClientXMPP):
"""
......
......@@ -822,8 +822,8 @@ class Core(object):
body = message['body']
if body:
date = date if delayed == True else None
if not delayed:
logger.groupchat(room_from, nick_from, body)
# if not delayed:
# logger.groupchat(room_from, nick_from, body)
self.add_message_to_text_buffer(room, body, date, nick_from)
self.refresh_window()
self.doupdate()
......@@ -1344,7 +1344,9 @@ class Core(object):
if not key:
return
res = self.current_tab().on_input(key)
self.refresh_window()
if res:
log.debug('RES is true')
self.refresh_window()
def on_roster_enter_key(self, roster_row):
"""
......
......@@ -96,7 +96,7 @@ class Room(TextBuffer):
when we receive an history message said by someone who is not
in the room anymore
"""
self.log_message(txt, time, nickname)
# self.log_message(txt, time, nickname)
if txt.startswith('/me '):
txt = "* " + nickname + ' ' + txt[4:]
nickname = None
......
......@@ -254,8 +254,10 @@ class MucTab(Tab):
"\n": self.on_enter
}
if key in key_func:
return key_func[key]()
return self.input.do_command(key)
key_func[key]()
return False
self.input.do_command(key)
return False
def completion(self):
"""
......@@ -373,7 +375,8 @@ class PrivateTab(Tab):
"\n": self.on_enter
}
if key in key_func:
return key_func[key]()
key_func[key]()
return False
return self.input.do_command(key)
def on_enter(self):
......@@ -471,7 +474,7 @@ class RosterInfoTab(Tab):
}
res = self.input.do_command(key)
if res:
return res
return False
if key in key_commands:
return key_commands[key]()
......@@ -621,7 +624,8 @@ class ConversationTab(Tab):
"\n": self.on_enter
}
if key in key_func:
return key_func[key]()
key_func[key]()
return False
return self.input.do_command(key)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment