diff options
author | Madhur Garg <madhurgarg96@gmail.com> | 2019-08-09 17:03:55 +0530 |
---|---|---|
committer | Madhur Garg <madhurgarg96@gmail.com> | 2019-08-22 00:54:25 +0530 |
commit | 8937a751d17932352499af25fdde36e07b10bcfb (patch) | |
tree | 568a9b1b82e86da97f1c1013eb75bd856cf1a969 | |
parent | e3485cc2b3df1d61ffdd1aebc1b235a9aa8c62b7 (diff) | |
download | poezio-8937a751d17932352499af25fdde36e07b10bcfb.tar.gz poezio-8937a751d17932352499af25fdde36e07b10bcfb.tar.bz2 poezio-8937a751d17932352499af25fdde36e07b10bcfb.tar.xz poezio-8937a751d17932352499af25fdde36e07b10bcfb.zip |
Added a check on the category of the chat group
-rw-r--r-- | poezio/mam.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/poezio/mam.py b/poezio/mam.py index b5ef7206..394c02b0 100644 --- a/poezio/mam.py +++ b/poezio/mam.py @@ -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] else: 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 try: 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') else: - if isinstance(self, tabs.MucTab): + if 'conference' in list(iq['disco_info']['identities'])[0]: + self.chat_category = 'conference' try: results = self.core.xmpp['xep_0313'].retrieve(jid=self.remote_jid, iterator=True, reverse=top, start=self.start_date, end=self.end_date) |