Commit e3c1ac40 authored by Madhur Garg's avatar Madhur Garg

Initialized stanza_id in the basetabs.

parent 7e4735b0
......@@ -141,21 +141,18 @@ async def query(tab, remote_jid, top, start=None, end=None, before=None):
def mam_scroll(tab):
remote_jid = tab.jid
text_buffer = tab._text_buffer
try:
before = tab.stanza_id
except:
before = None
end = datetime.now()
if isinstance(tab, tabs.MucTab) is False:
for message in text_buffer.messages:
time = message.time
if time < end:
end = time
before = tab.stanza_id
end = datetime.now()
if isinstance(tab, tabs.MucTab) is False:
for message in text_buffer.messages:
time = message.time
if time < end:
end = time
end = end + timedelta(seconds=-1)
tzone = datetime.now().astimezone().tzinfo
end = end.replace(tzinfo=tzone).astimezone(tz=timezone.utc)
end = end.replace(tzinfo=None)
end = datetime.strftime(end, '%Y-%m-%dT%H:%M:%SZ')
tzone = datetime.now().astimezone().tzinfo
end = end.replace(tzinfo=tzone).astimezone(tz=timezone.utc)
end = end.replace(tzinfo=None)
end = datetime.strftime(end, '%Y-%m-%dT%H:%M:%SZ')
top = True
pos = tab.text_win.pos
tab.text_win.pos += tab.text_win.height - 1
......
......@@ -475,6 +475,7 @@ class ChatTab(Tab):
assert jid.domain
self._jid = jid
self.query_id = 0
self.stanza_id = None
self._name = jid.full # type: Optional[str]
self.text_win = None
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment