Commit b01c7965 authored by Madhur Garg's avatar Madhur Garg

Corrected indentation and coding style.

parent e3c1ac40
......@@ -1996,9 +1996,8 @@ class Core:
tab = self.tabs.by_name_and_class(bm.jid, tabs.MucTab)
nick = bm.nick if bm.nick else self.own_nick
if not tab:
self.open_new_room(
tab = self.open_new_room(
bm.jid, nick, focus=False, password=bm.password)
tab = self.tabs.by_name_and_class(bm.jid, tabs.MucTab)
self.initial_joins.append(bm.jid)
# do not join rooms that do not have autojoin
# but display them anyway
......
......@@ -153,14 +153,13 @@ def mam_scroll(tab):
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
if tab.text_win.pos + tab.text_win.height > len(tab.text_win.built_lines):
if before is None:
asyncio.ensure_future(query(tab, remote_jid, top, end=end))
asyncio.ensure_future(query(tab, remote_jid, top=True, end=end))
else:
asyncio.ensure_future(query(tab, remote_jid, top, before=before))
asyncio.ensure_future(query(tab, remote_jid, top=True, before=before))
tab.query_id = 1
tab.text_win.pos = len(tab.text_win.built_lines) - tab.text_win.height
if tab.text_win.pos < 0:
......
......@@ -169,12 +169,12 @@ 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
if top == True:
if top:
nb = window.build_message_at_the_top(
msg,
history=history,
timestamp=show_timestamps,
nick_size=nick_size)
msg,
history=history,
timestamp=show_timestamps,
nick_size=nick_size)
if ret_val == 0:
ret_val = nb
if window.pos != 0:
......
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