summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--poezio/text_buffer.py24
1 files changed, 18 insertions, 6 deletions
diff --git a/poezio/text_buffer.py b/poezio/text_buffer.py
index bf0ac966..64bc17f6 100644
--- a/poezio/text_buffer.py
+++ b/poezio/text_buffer.py
@@ -139,6 +139,7 @@ class TextBuffer:
history: bool = False,
user: Optional[str] = None,
highlight: bool = False,
+ top: Optional[bool] = False,
identifier: Optional[str] = None,
str_time: Optional[str] = None,
jid: Optional[str] = None,
@@ -168,16 +169,27 @@ 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
- nb = window.build_new_message(
+ if top == True:
+ nb = window.build_message_at_the_top(
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)
+ 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)
return min(ret_val, 1)