From 254b8953c4a63416a7d49088990bbd2768ca4ec6 Mon Sep 17 00:00:00 2001 From: Madhur Garg Date: Wed, 21 Aug 2019 17:06:54 +0530 Subject: Removed repetitive code. --- poezio/text_buffer.py | 32 +++++++++++--------------------- 1 file changed, 11 insertions(+), 21 deletions(-) (limited to 'poezio/text_buffer.py') diff --git a/poezio/text_buffer.py b/poezio/text_buffer.py index 3d1f8266..eeb83be4 100644 --- a/poezio/text_buffer.py +++ b/poezio/text_buffer.py @@ -169,27 +169,17 @@ class TextBuffer: nick_size = config.get('max_nick_length') for window in self._windows: # make the associated windows # build the lines from the new message - if top: - nb = window.build_message_at_the_top( - msg, - history=history, - timestamp=show_timestamps, - nick_size=nick_size) - if ret_val == 0: - ret_val = nb - if window.pos != 0: - window.scroll_up(nb) - else: - nb = window.build_new_message( - msg, - history=history, - highlight=highlight, - timestamp=show_timestamps, - nick_size=nick_size) - if ret_val == 0: - ret_val = nb - if window.pos != 0: - window.scroll_up(nb) + nb = window.build_new_message( + msg, + history=history, + highlight=highlight, + timestamp=show_timestamps, + top=top, + nick_size=nick_size) + if ret_val == 0: + ret_val = nb + if window.pos != 0: + window.scroll_up(nb) return min(ret_val, 1) -- cgit v1.2.3