summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMadhur Garg <madhurgarg96@gmail.com>2019-08-22 06:23:30 +0530
committerMadhur Garg <madhurgarg96@gmail.com>2019-08-22 06:25:20 +0530
commit99e6f2611f3a200f022bfa60b6a941bc08db285a (patch)
tree9297f81598e843f2adfb067156eb3e22404b0f45
parent9470f4943b61a78f24267147ede40e1d34e97420 (diff)
downloadpoezio-99e6f2611f3a200f022bfa60b6a941bc08db285a.tar.gz
poezio-99e6f2611f3a200f022bfa60b6a941bc08db285a.tar.bz2
poezio-99e6f2611f3a200f022bfa60b6a941bc08db285a.tar.xz
poezio-99e6f2611f3a200f022bfa60b6a941bc08db285a.zip
Added 'top' attribute in the 'Message' object (The problem of the wrong order of messages was because of this.)
-rw-r--r--poezio/text_buffer.py5
-rw-r--r--poezio/windows/text_win.py1
2 files changed, 5 insertions, 1 deletions
diff --git a/poezio/text_buffer.py b/poezio/text_buffer.py
index eeb83be4..526e4b69 100644
--- a/poezio/text_buffer.py
+++ b/poezio/text_buffer.py
@@ -19,7 +19,7 @@ from poezio.theming import get_theme, dump_tuple
class Message:
__slots__ = ('txt', 'nick_color', 'time', 'str_time', 'nickname', 'user',
- 'identifier', 'highlight', 'me', 'old_message', 'revisions',
+ 'identifier', 'top', 'highlight', 'me', 'old_message', 'revisions',
'jid', 'ack')
def __init__(self,
@@ -30,6 +30,7 @@ class Message:
history: bool,
user: Optional[str],
identifier: Optional[str],
+ top: Optional[bool] = False,
str_time: Optional[str] = None,
highlight: bool = False,
old_message: Optional['Message'] = None,
@@ -61,6 +62,7 @@ class Message:
self.nickname = nickname
self.user = user
self.identifier = identifier
+ self.top = top
self.highlight = highlight
self.me = me
self.old_message = old_message
@@ -155,6 +157,7 @@ class TextBuffer:
history,
user,
identifier,
+ top,
str_time=str_time,
highlight=highlight,
jid=jid,
diff --git a/poezio/windows/text_win.py b/poezio/windows/text_win.py
index 8a55338a..ab3d3aee 100644
--- a/poezio/windows/text_win.py
+++ b/poezio/windows/text_win.py
@@ -164,6 +164,7 @@ class BaseTextWin(Win):
self.build_new_message(
message,
clean=False,
+ top=message.top,
timestamp=with_timestamps,
nick_size=nick_size)
if self.separator_after is message: