Commit 8937a751 authored by Madhur Garg's avatar Madhur Garg
Browse files

Added a check on the category of the chat group

parent e3485cc2
......@@ -21,7 +21,7 @@ def add_line(self, text_buffer: TextBuffer, text: str, str_time: str, nick: str,
time = time.replace(tzinfo=timezone.utc).astimezone(tz=None)
time = time.replace(tzinfo=None)
if '/' in nick:
if isinstance(self, tabs.MucTab):
if isinstance(self, tabs.MucTab) or self.chat_category == 'conference':
nick = nick.split('/')[1]
nick = nick.split('/')[0]
......@@ -46,6 +46,7 @@ async def query(self, remote_jid, start, end, top):
self.remote_jid = remote_jid
self.start_date = start
self.end_date = end
self.chat_category = 'account'
text_buffer = self._text_buffer
iq = await self.core.xmpp.plugin['xep_0030'].get_info(jid=remote_jid)
......@@ -67,7 +68,8 @@ async def query(self, remote_jid, start, end, top):
except (IqError, IqTimeout):
return self.core.information('Failed to retrieve messages', 'Error')
if isinstance(self, tabs.MucTab):
if 'conference' in list(iq['disco_info']['identities'])[0]:
self.chat_category = 'conference'
results = self.core.xmpp['xep_0313'].retrieve(jid=self.remote_jid,
iterator=True, reverse=top, start=self.start_date, end=self.end_date)
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