Merge branch 'mam' into 'master'

MAM: Sudden change in the order of messages.

See merge request poezio/poezio!40
This commit is contained in:
mathieui 2019-08-22 13:45:44 +02:00
commit 22ab7622f6
3 changed files with 7 additions and 3 deletions

View file

@ -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

View file

@ -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,

View file

@ -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: