Commit 8e07c6d6 authored by Madhur Garg's avatar Madhur Garg

Added messages when the query is starting and ending.

parent 3e491589
......@@ -16,8 +16,11 @@ def add_line(text_buffer: TextBuffer, text: str, str_time: str, nick: str, top:
time = datetime.strftime(str_time, '%Y-%m-%d %H:%M:%S')
time = datetime.strptime(time, '%Y-%m-%d %H:%M:%S')
nick = nick.split('/')[1]
color = get_theme().COLOR_OWN_NICK
if '/' in nick:
nick = nick.split('/')[1]
color = get_theme().COLOR_OWN_NICK
else:
color = get_theme().COLOR_ME_MESSAGE
top = top
text_buffer.add_message(
text,
......@@ -42,6 +45,8 @@ async def query(self, remote_jid, start, end, top):
iterator=True, reverse=top, start=self.start_date, end=self.end_date)
msg_count = 0
msgs = []
timestamp = datetime.now()
add_line(text_buffer, 'Start of MAM query: ', timestamp, 'MAM', top)
async for rsm in results:
if top:
for msg in rsm['mam']['results']:
......@@ -64,6 +69,8 @@ async def query(self, remote_jid, start, end, top):
message = forwarded['stanza']
add_line(text_buffer, message['body'], timestamp, str(message['from']), top)
self.core.refresh_window()
timestamp = datetime.now()
add_line(text_buffer, 'End of MAM query: ', timestamp, 'MAM', top)
def mam_scroll(self):
......
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