summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2019-08-22 13:45:44 +0200
committermathieui <mathieui@mathieui.net>2019-08-22 13:45:44 +0200
commit22ab7622f6557cbdb41e533de697dcd48a7db3dd (patch)
tree9297f81598e843f2adfb067156eb3e22404b0f45
parent4d57a1faf967fa4b5a0dcdd9e19bc413545616d9 (diff)
parent99e6f2611f3a200f022bfa60b6a941bc08db285a (diff)
downloadpoezio-22ab7622f6557cbdb41e533de697dcd48a7db3dd.tar.gz
poezio-22ab7622f6557cbdb41e533de697dcd48a7db3dd.tar.bz2
poezio-22ab7622f6557cbdb41e533de697dcd48a7db3dd.tar.xz
poezio-22ab7622f6557cbdb41e533de697dcd48a7db3dd.zip
Merge branch 'mam' into 'master'
MAM: Sudden change in the order of messages. See merge request poezio/poezio!40
-rw-r--r--poezio/mam.py4
-rw-r--r--poezio/text_buffer.py5
-rw-r--r--poezio/windows/text_win.py1
3 files changed, 7 insertions, 3 deletions
diff --git a/poezio/mam.py b/poezio/mam.py
index 92899284..25f56678 100644
--- a/poezio/mam.py
+++ b/poezio/mam.py
@@ -95,13 +95,13 @@ async def query(tab, remote_jid, top, start=None, end=None, before=None):
if 'conference' in list(iq['disco_info']['identities'])[0]:
try:
results = tab.core.xmpp['xep_0313'].retrieve(jid=remote_jid,
- iterator=True, reverse=top, start=start_date, end=end)
+ iterator=True, reverse=top, start=start, end=end)
except (IqError, IqTimeout):
return tab.core.information('Failed to retrieve messages', 'Error')
else:
try:
results = tab.core.xmpp['xep_0313'].retrieve(with_jid=remote_jid,
- iterator=True, reverse=top, start=start_date, end=end)
+ iterator=True, reverse=top, start=start, end=end)
except (IqError, IqTimeout):
return tab.core.information('Failed to retrieve messages', 'Error')
msg_count = 0
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: